UX: Ensure tag-info does not persist onto non-tag routes (#24462)

This commit is contained in:
David Taylor 2023-11-20 15:43:35 +00:00 committed by GitHub
parent 1a43010603
commit 3408db94f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -26,7 +26,7 @@
@parentCategory={{this.model.subcategoryList.parentCategory}}
/>
{{/if}}
{{#if this.showTagInfo}}
{{#if (and this.showTagInfo this.model.tag)}}
<TagInfo @tag={{this.model.tag}} @list={{this.model.list}} />
{{/if}}
</:header>

View File

@ -475,6 +475,17 @@ acceptance("Tag info", function (needs) {
);
});
test("tag info hides when tag filter removed", async function (assert) {
await visit("/tag/happy-monkey");
await click("#show-tag-info");
assert.dom(".tag-info .tag-name").exists();
await visit("/latest");
assert.dom(".tag-info").doesNotExist("tag info is not shown on homepage");
});
test("can filter tags page by category", async function (assert) {
await visit("/tag/planters");