We used many global functions to handle tests when they should be imported like other libraries in our application. This also gets us closer to the way Ember CLI prefers our tests to be laid out.
23 lines
608 B
JavaScript
23 lines
608 B
JavaScript
import { test } from "qunit";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
import {
|
|
nextTopicUrl,
|
|
previousTopicUrl,
|
|
setTopicId,
|
|
} from "discourse/lib/topic-list-tracker";
|
|
acceptance("Topic list tracking");
|
|
|
|
test("Navigation", async (assert) => {
|
|
await visit("/");
|
|
let url = await nextTopicUrl();
|
|
assert.equal(url, "/t/error-after-upgrade-to-0-9-7-9/11557");
|
|
|
|
setTopicId(11557);
|
|
|
|
url = await nextTopicUrl();
|
|
assert.equal(url, "/t/welcome-to-meta-discourse-org/1");
|
|
|
|
url = await previousTopicUrl();
|
|
assert.equal(url, "/t/error-after-upgrade-to-0-9-7-9/11557");
|
|
});
|