FIX: Ensure category-tag filter routes are functioning (#17420)
This regressed as part of the changes in fc36ac6c
.
This commit also introduces a test which would have caught the issue.
This commit is contained in:
parent
5a4c35f627
commit
0ffa93ccaf
|
@ -107,15 +107,15 @@ export default {
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
app.register(
|
app.register(
|
||||||
`route:tag.show-${filterDasherized}-category`,
|
`route:tags.show-category-${filterDasherized}`,
|
||||||
TagShowRoute.extend({ navMode: filter })
|
TagShowRoute.extend({ navMode: filter })
|
||||||
);
|
);
|
||||||
app.register(
|
app.register(
|
||||||
`route:tag.show-${filterDasherized}-category-none`,
|
`route:tags.show-category-none-${filterDasherized}`,
|
||||||
TagShowRoute.extend({ navMode: filter, noSubcategories: true })
|
TagShowRoute.extend({ navMode: filter, noSubcategories: true })
|
||||||
);
|
);
|
||||||
app.register(
|
app.register(
|
||||||
`route:tag.show-${filterDasherized}-category-all`,
|
`route:tags.show-category-all-${filterDasherized}`,
|
||||||
TagShowRoute.extend({ navMode: filter, noSubcategories: false })
|
TagShowRoute.extend({ navMode: filter, noSubcategories: false })
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
@ -284,6 +284,7 @@ acceptance("Tag info", function (needs) {
|
||||||
[
|
[
|
||||||
"/tags/c/faq/4/planters/l/latest.json",
|
"/tags/c/faq/4/planters/l/latest.json",
|
||||||
"/tags/c/feature/2/planters/l/latest.json",
|
"/tags/c/feature/2/planters/l/latest.json",
|
||||||
|
"/tags/c/feature/2/planters/l/top.json",
|
||||||
"/tags/c/feature/2/none/planters/l/latest.json",
|
"/tags/c/feature/2/none/planters/l/latest.json",
|
||||||
].forEach((url) => {
|
].forEach((url) => {
|
||||||
server.get(url, () => {
|
server.get(url, () => {
|
||||||
|
@ -497,6 +498,17 @@ acceptance("Tag info", function (needs) {
|
||||||
assert.strictEqual(currentURL(), "/tags/c/feature/2/none/planters");
|
assert.strictEqual(currentURL(), "/tags/c/feature/2/none/planters");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("can visit show-category-latest routes", async function (assert) {
|
||||||
|
await visit("/tags/c/feature/2/planters");
|
||||||
|
|
||||||
|
await click(".nav-item_latest a[href]");
|
||||||
|
// await pauseTest();
|
||||||
|
assert.strictEqual(currentURL(), "/tags/c/feature/2/planters/l/latest");
|
||||||
|
|
||||||
|
await click(".nav-item_top a[href]");
|
||||||
|
assert.strictEqual(currentURL(), "/tags/c/feature/2/planters/l/top");
|
||||||
|
});
|
||||||
|
|
||||||
test("admin can manage tags", async function (assert) {
|
test("admin can manage tags", async function (assert) {
|
||||||
updateCurrentUser({ moderator: false, admin: true });
|
updateCurrentUser({ moderator: false, admin: true });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue