diff --git a/.eslintrc b/.eslintrc
index 148fa3b11a3..0f2d2c87436 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -62,6 +62,7 @@
"triggerEvent": true,
"visible": true,
"visit": true,
+ "pauseTest": true
},
"rules": {
"block-scoped-var": 2,
diff --git a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6 b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6
index 4bfb0ffeabf..72db37455bf 100644
--- a/app/assets/javascripts/discourse/routes/build-topic-route.js.es6
+++ b/app/assets/javascripts/discourse/routes/build-topic-route.js.es6
@@ -113,6 +113,7 @@ export default function(filter, extras) {
model.get("for_period") ||
(filter.indexOf("top/") >= 0 ? filter.split("/")[1] : ""),
selected: [],
+ expandAllPinned: false,
expandGloballyPinned: true
};
diff --git a/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs
index 095518f07aa..5b45e1b45d9 100644
--- a/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs
+++ b/app/assets/javascripts/discourse/templates/list/topic-list-item.raw.hbs
@@ -68,4 +68,4 @@
{{number topic.views numberKey="views_long"}} |
-{{raw "list/activity-column" topic=topic class="num" tagName="td"}}
\ No newline at end of file
+{{raw "list/activity-column" topic=topic class="num" tagName="td"}}
diff --git a/test/javascripts/acceptance/topic-discovery-test.js.es6 b/test/javascripts/acceptance/topic-discovery-test.js.es6
index 54e578b9a70..e060c94d66f 100644
--- a/test/javascripts/acceptance/topic-discovery-test.js.es6
+++ b/test/javascripts/acceptance/topic-discovery-test.js.es6
@@ -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"
+ );
+});
diff --git a/test/javascripts/fixtures/discovery_fixtures.js.es6 b/test/javascripts/fixtures/discovery_fixtures.js.es6
index 378a8b77307..1de2598980a 100644
--- a/test/javascripts/fixtures/discovery_fixtures.js.es6
+++ b/test/javascripts/fixtures/discovery_fixtures.js.es6
@@ -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,