mirror of
https://github.com/hanzoai/forum.git
synced 2026-09-30 21:51:19 +00:00
Enables our new eslint rules which enforce consistent i18n imports. For more info, see https://github.com/discourse/lint-configs/commit/0d58b40cd7d170a9f70bcef5c173f95eeb498298
32 lines
895 B
JavaScript
32 lines
895 B
JavaScript
import { visit } from "@ember/test-helpers";
|
|
import { test } from "qunit";
|
|
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
|
|
import { i18n } from "discourse-i18n";
|
|
|
|
acceptance("New Topics - New new view enabled", function (needs) {
|
|
needs.user({
|
|
new_new_view_enabled: true,
|
|
});
|
|
|
|
needs.pretender((server, helper) => {
|
|
server.get("/new.json", () => {
|
|
return helper.response({
|
|
topic_list: { can_create_topic: true, topics: [] },
|
|
});
|
|
});
|
|
});
|
|
|
|
test("visiting new page when there are no new topics", async function (assert) {
|
|
await visit("/new");
|
|
|
|
const text = new DOMParser().parseFromString(
|
|
i18n("topics.none.educate.new_new", {
|
|
userPrefsUrl: "/u/eviltrout/preferences/tracking",
|
|
}),
|
|
"text/html"
|
|
).documentElement.textContent;
|
|
|
|
assert.dom(".topic-list-bottom .education").hasText(text);
|
|
});
|
|
});
|