mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 04:16:00 +08:00
DEV: Add integration test for refreshing discovery-topics views
This test would have detected the regression which was fixed in f94c01b2337a4fadcfa4489ab86e673ff721b1bc
This commit is contained in:
parent
78c6fc6e43
commit
6750c682ac
@ -156,4 +156,26 @@ acceptance("Topic Discovery", function (needs) {
|
||||
await click(".navigation-container a[href='/categories']");
|
||||
assert.strictEqual(currentURL(), "/categories", "switches to categories");
|
||||
});
|
||||
|
||||
test("refreshing tabs", async function (assert) {
|
||||
const assertShowingLatest = () => {
|
||||
assert.strictEqual(currentURL(), "/latest", "stays on latest");
|
||||
const el = query(".topic-list-body .topic-list-item:first-of-type");
|
||||
assert.strictEqual(el.closest(".hidden"), null, "topic list is visible");
|
||||
assert.strictEqual(
|
||||
el.dataset.topicId,
|
||||
"11557",
|
||||
"shows the correct topic"
|
||||
);
|
||||
};
|
||||
|
||||
await visit("/latest");
|
||||
assertShowingLatest();
|
||||
|
||||
await click(".navigation-container a[href='/latest']");
|
||||
assertShowingLatest();
|
||||
|
||||
await click("#site-logo");
|
||||
assertShowingLatest();
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user