mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 07:17:19 +08:00
FIX: expandAllPinned
was not resetting after visiting a category
This resulted in a bug where if you saw a pinned topic in a category, then went back to latest, the same topic would show an excerpt even though it shouldn't on the latest view. See: https://meta.discourse.org/t/pinned-post-excerpt-no-longer-appears-after-refreshing-the-page/106222
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
acceptance("Topic Discovery");
|
||||
acceptance("Topic Discovery", {
|
||||
settings: {
|
||||
show_pinned_excerpt_desktop: true
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.test("Visit Discovery Pages", async assert => {
|
||||
await visit("/");
|
||||
@ -59,3 +63,16 @@ QUnit.test("Visit Discovery Pages", async assert => {
|
||||
"The featured topics are there too"
|
||||
);
|
||||
});
|
||||
|
||||
QUnit.test("Clearing state after leaving a category", async assert => {
|
||||
await visit("/c/dev");
|
||||
assert.ok(
|
||||
exists(".topic-list-item[data-topic-id=11994] .topic-excerpt"),
|
||||
"it expands pinned topics in a subcategory"
|
||||
);
|
||||
await visit("/");
|
||||
assert.ok(
|
||||
!exists(".topic-list-item[data-topic-id=11557] .topic-excerpt"),
|
||||
"it doesn't expand all pinned in the latest category"
|
||||
);
|
||||
});
|
||||
|
@ -4962,7 +4962,8 @@ export default {
|
||||
bumped: true,
|
||||
bumped_at: "2014-01-16T11:04:32.000-05:00",
|
||||
unseen: false,
|
||||
pinned: false,
|
||||
pinned: true,
|
||||
excerpt: "Hello world",
|
||||
visible: true,
|
||||
closed: false,
|
||||
archived: false,
|
||||
|
Reference in New Issue
Block a user