DEV: Replace equal() with strictEqual() (#14827)

This commit is contained in:
Jarek Radosz
2021-11-08 10:26:28 +01:00
committed by GitHub
parent 016aa06229
commit d162229758
263 changed files with 2827 additions and 2363 deletions

View File

@@ -15,7 +15,7 @@ acceptance("Account Created", function () {
await visit("/u/account-created"); await visit("/u/account-created");
assert.ok(exists(".account-created")); assert.ok(exists(".account-created"));
assert.equal( assert.strictEqual(
queryAll(".account-created .ac-message").text().trim(), queryAll(".account-created .ac-message").text().trim(),
"Hello World", "Hello World",
"it displays the message" "it displays the message"
@@ -34,7 +34,7 @@ acceptance("Account Created", function () {
await visit("/u/account-created"); await visit("/u/account-created");
assert.ok(exists(".account-created")); assert.ok(exists(".account-created"));
assert.equal( assert.strictEqual(
queryAll(".account-created .ac-message").text().trim(), queryAll(".account-created .ac-message").text().trim(),
"Hello World", "Hello World",
"it displays the message" "it displays the message"
@@ -42,9 +42,9 @@ acceptance("Account Created", function () {
await click(".activation-controls .resend"); await click(".activation-controls .resend");
assert.equal(currentRouteName(), "account-created.resent"); assert.strictEqual(currentRouteName(), "account-created.resent");
const email = queryAll(".account-created .ac-message b").text(); const email = queryAll(".account-created .ac-message b").text();
assert.equal(email, "eviltrout@example.com"); assert.strictEqual(email, "eviltrout@example.com");
}); });
test("account created - update email - cancel", async function (assert) { test("account created - update email - cancel", async function (assert) {
@@ -59,12 +59,12 @@ acceptance("Account Created", function () {
await click(".activation-controls .edit-email"); await click(".activation-controls .edit-email");
assert.equal(currentRouteName(), "account-created.edit-email"); assert.strictEqual(currentRouteName(), "account-created.edit-email");
assert.ok(exists(".activation-controls .btn-primary:disabled")); assert.ok(exists(".activation-controls .btn-primary:disabled"));
await click(".activation-controls .edit-cancel"); await click(".activation-controls .edit-cancel");
assert.equal(currentRouteName(), "account-created.index"); assert.strictEqual(currentRouteName(), "account-created.index");
}); });
test("account created - update email - submit", async function (assert) { test("account created - update email - submit", async function (assert) {
@@ -87,8 +87,8 @@ acceptance("Account Created", function () {
await click(".activation-controls .btn-primary"); await click(".activation-controls .btn-primary");
assert.equal(currentRouteName(), "account-created.resent"); assert.strictEqual(currentRouteName(), "account-created.resent");
const email = queryAll(".account-created .ac-message b").text(); const email = queryAll(".account-created .ac-message b").text();
assert.equal(email, "newemail@example.com"); assert.strictEqual(email, "newemail@example.com");
}); });
}); });

View File

@@ -14,7 +14,7 @@ acceptance("Admin - Badges - Mass Award", function (needs) {
await click( await click(
'.admin-badge-list-item span[data-badge-name="Both image and icon"]' '.admin-badge-list-item span[data-badge-name="Both image and icon"]'
); );
assert.equal( assert.strictEqual(
query("label.grant-existing-holders").textContent.trim(), query("label.grant-existing-holders").textContent.trim(),
I18n.t("admin.badges.mass_award.grant_existing_holders"), I18n.t("admin.badges.mass_award.grant_existing_holders"),
"checkbox for granting existing holders is displayed" "checkbox for granting existing holders is displayed"

View File

@@ -51,7 +51,7 @@ acceptance("Admin - Badges - Show", function (needs) {
); );
assert.ok(exists(".icon-picker"), "icon picker is visible"); assert.ok(exists(".icon-picker"), "icon picker is visible");
assert.ok(!exists(".image-uploader"), "image uploader is not visible"); assert.ok(!exists(".image-uploader"), "image uploader is not visible");
assert.equal(query(".icon-picker").textContent.trim(), "fa-rocket"); assert.strictEqual(query(".icon-picker").textContent.trim(), "fa-rocket");
}); });
test("existing badge that has an image URL", async function (assert) { test("existing badge that has an image URL", async function (assert) {
@@ -92,6 +92,6 @@ acceptance("Admin - Badges - Show", function (needs) {
await click("input#badge-icon"); await click("input#badge-icon");
assert.ok(exists(".icon-picker"), "icon picker is becomes visible"); assert.ok(exists(".icon-picker"), "icon picker is becomes visible");
assert.ok(!exists(".image-uploader"), "image uploader becomes hidden"); assert.ok(!exists(".image-uploader"), "image uploader becomes hidden");
assert.equal(query(".icon-picker").textContent.trim(), "fa-rocket"); assert.strictEqual(query(".icon-picker").textContent.trim(), "fa-rocket");
}); });
}); });

View File

@@ -32,8 +32,8 @@ acceptance("Admin - Emails", function (needs) {
await fillIn("textarea.email-body", EMAIL.trim()); await fillIn("textarea.email-body", EMAIL.trim());
await click(".email-advanced-test button"); await click(".email-advanced-test button");
assert.equal(queryAll(".text pre").text(), "Hello, this is a test!"); assert.strictEqual(queryAll(".text pre").text(), "Hello, this is a test!");
assert.equal( assert.strictEqual(
queryAll(".elided pre").text(), queryAll(".elided pre").text(),
"---\n\nThis part should be elided." "---\n\nThis part should be elided."
); );

View File

@@ -20,8 +20,8 @@ acceptance("Admin - Themes - Install modal", function (needs) {
await click(".install-theme-content .inputs .advanced-repo"); await click(".install-theme-content .inputs .advanced-repo");
await fillIn(branchInput, "tests-passed"); await fillIn(branchInput, "tests-passed");
await click(privateRepoCheckbox); await click(privateRepoCheckbox);
assert.equal(query(urlInput).value, themeUrl, "url input is filled"); assert.strictEqual(query(urlInput).value, themeUrl, "url input is filled");
assert.equal( assert.strictEqual(
query(branchInput).value, query(branchInput).value,
"tests-passed", "tests-passed",
"branch input is filled" "branch input is filled"
@@ -36,8 +36,8 @@ acceptance("Admin - Themes - Install modal", function (needs) {
await click(".create-actions .btn-primary"); await click(".create-actions .btn-primary");
await click("#remote"); await click("#remote");
assert.equal(query(urlInput).value, "", "url input is reset"); assert.strictEqual(query(urlInput).value, "", "url input is reset");
assert.equal(query(branchInput).value, "", "branch input is reset"); assert.strictEqual(query(branchInput).value, "", "branch input is reset");
assert.ok( assert.ok(
!query(privateRepoCheckbox).checked, !query(privateRepoCheckbox).checked,
"private repo checkbox unchecked" "private repo checkbox unchecked"
@@ -60,7 +60,7 @@ acceptance("Admin - Themes - Install modal", function (needs) {
await fillIn(urlInput, themeUrl); await fillIn(urlInput, themeUrl);
await click(".install-theme-content .inputs .advanced-repo"); await click(".install-theme-content .inputs .advanced-repo");
await click(privateRepoCheckbox); await click(privateRepoCheckbox);
assert.equal(query(urlInput).value, themeUrl, "url input is filled"); assert.strictEqual(query(urlInput).value, themeUrl, "url input is filled");
assert.ok( assert.ok(
query(privateRepoCheckbox).checked, query(privateRepoCheckbox).checked,
"private repo checkbox is checked" "private repo checkbox is checked"
@@ -84,7 +84,7 @@ acceptance("Admin - Themes - Install modal", function (needs) {
test("modal can be auto-opened with the right query params", async function (assert) { test("modal can be auto-opened with the right query params", async function (assert) {
await visit("/admin/customize/themes?repoUrl=testUrl&repoName=testName"); await visit("/admin/customize/themes?repoUrl=testUrl&repoName=testName");
assert.ok(query(".admin-install-theme-modal"), "modal is visible"); assert.ok(query(".admin-install-theme-modal"), "modal is visible");
assert.equal( assert.strictEqual(
query(".install-theme code").textContent.trim(), query(".install-theme code").textContent.trim(),
"testUrl", "testUrl",
"repo url is visible" "repo url is visible"
@@ -101,7 +101,7 @@ acceptance("Admin - Themes - Install modal", function (needs) {
), ),
"no install button is shown for installed themes" "no install button is shown for installed themes"
); );
assert.equal( assert.strictEqual(
query( query(
'.popular-theme-item[data-name="Graceful"] .popular-theme-buttons' '.popular-theme-item[data-name="Graceful"] .popular-theme-buttons'
).textContent.trim(), ).textContent.trim(),

View File

@@ -54,7 +54,7 @@ acceptance("Admin - Site Settings", function (needs) {
test("links to staff action log", async function (assert) { test("links to staff action log", async function (assert) {
await visit("/admin/site_settings"); await visit("/admin/site_settings");
assert.equal( assert.strictEqual(
queryAll(".row.setting .setting-label h3 a").attr("href"), queryAll(".row.setting .setting-label h3 a").attr("href"),
"/admin/logs/staff_action_logs?filters=%7B%22subject%22%3A%22title%22%2C%22action_name%22%3A%22change_site_setting%22%7D&force_refresh=true", "/admin/logs/staff_action_logs?filters=%7B%22subject%22%3A%22title%22%2C%22action_name%22%3A%22change_site_setting%22%7D&force_refresh=true",
"it links to the staff action log" "it links to the staff action log"
@@ -64,7 +64,11 @@ acceptance("Admin - Site Settings", function (needs) {
test("changing value updates dirty state", async function (assert) { test("changing value updates dirty state", async function (assert) {
await visit("/admin/site_settings"); await visit("/admin/site_settings");
await fillIn("#setting-filter", " title "); await fillIn("#setting-filter", " title ");
assert.equal(count(".row.setting"), 1, "filter returns 1 site setting"); assert.strictEqual(
count(".row.setting"),
1,
"filter returns 1 site setting"
);
assert.ok(!exists(".row.setting.overridden"), "setting isn't overriden"); assert.ok(!exists(".row.setting.overridden"), "setting isn't overriden");
await fillIn(".input-setting-string", "Test"); await fillIn(".input-setting-string", "Test");
@@ -111,31 +115,31 @@ acceptance("Admin - Site Settings", function (needs) {
test("always shows filtered site settings if a filter is set", async function (assert) { test("always shows filtered site settings if a filter is set", async function (assert) {
await visit("/admin/site_settings"); await visit("/admin/site_settings");
await fillIn("#setting-filter", "title"); await fillIn("#setting-filter", "title");
assert.equal(count(".row.setting"), 1); assert.strictEqual(count(".row.setting"), 1);
// navigate away to the "Dashboard" page // navigate away to the "Dashboard" page
await click(".nav.nav-pills li:nth-child(1) a"); await click(".nav.nav-pills li:nth-child(1) a");
assert.equal(count(".row.setting"), 0); assert.strictEqual(count(".row.setting"), 0);
// navigate back to the "Settings" page // navigate back to the "Settings" page
await click(".nav.nav-pills li:nth-child(2) a"); await click(".nav.nav-pills li:nth-child(2) a");
assert.equal(count(".row.setting"), 1); assert.strictEqual(count(".row.setting"), 1);
}); });
test("filter settings by plugin name", async function (assert) { test("filter settings by plugin name", async function (assert) {
await visit("/admin/site_settings"); await visit("/admin/site_settings");
await fillIn("#setting-filter", "plugin:discourse-logo"); await fillIn("#setting-filter", "plugin:discourse-logo");
assert.equal(count(".row.setting"), 1); assert.strictEqual(count(".row.setting"), 1);
// inexistent plugin // inexistent plugin
await fillIn("#setting-filter", "plugin:discourse-plugin"); await fillIn("#setting-filter", "plugin:discourse-plugin");
assert.equal(count(".row.setting"), 0); assert.strictEqual(count(".row.setting"), 0);
}); });
test("category name is preserved", async function (assert) { test("category name is preserved", async function (assert) {
await visit("admin/site_settings/category/basic?filter=menu"); await visit("admin/site_settings/category/basic?filter=menu");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"admin/site_settings/category/basic?filter=menu" "admin/site_settings/category/basic?filter=menu"
); );
@@ -145,16 +149,16 @@ acceptance("Admin - Site Settings", function (needs) {
await visit("admin/site_settings"); await visit("admin/site_settings");
await click(".admin-nav .basic a"); await click(".admin-nav .basic a");
assert.equal(currentURL(), "/admin/site_settings/category/basic"); assert.strictEqual(currentURL(), "/admin/site_settings/category/basic");
await fillIn("#setting-filter", "menu"); await fillIn("#setting-filter", "menu");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/admin/site_settings/category/basic?filter=menu" "/admin/site_settings/category/basic?filter=menu"
); );
await fillIn("#setting-filter", "contact"); await fillIn("#setting-filter", "contact");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/admin/site_settings/category/all_results?filter=contact" "/admin/site_settings/category/all_results?filter=contact"
); );

View File

@@ -18,14 +18,14 @@ acceptance("Admin - Site Texts", function (needs) {
await fillIn(".site-text-search", "Test"); await fillIn(".site-text-search", "Test");
assert.equal(currentURL(), "/admin/customize/site_texts?q=Test"); assert.strictEqual(currentURL(), "/admin/customize/site_texts?q=Test");
assert.ok(exists(".site-text")); assert.ok(exists(".site-text"));
assert.ok(exists(".site-text:not(.overridden)")); assert.ok(exists(".site-text:not(.overridden)"));
assert.ok(exists(".site-text.overridden")); assert.ok(exists(".site-text.overridden"));
// Only show overridden // Only show overridden
await click(".search-area .filter-options input"); await click(".search-area .filter-options input");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/admin/customize/site_texts?overridden=true&q=Test" "/admin/customize/site_texts?overridden=true&q=Test"
); );
@@ -37,7 +37,7 @@ acceptance("Admin - Site Texts", function (needs) {
test("edit and revert a site text by key", async function (assert) { test("edit and revert a site text by key", async function (assert) {
await visit("/admin/customize/site_texts/site.test?locale=en"); await visit("/admin/customize/site_texts/site.test?locale=en");
assert.equal(queryAll(".title h3").text(), "site.test"); assert.strictEqual(queryAll(".title h3").text(), "site.test");
assert.ok(!exists(".saved")); assert.ok(!exists(".saved"));
assert.ok(!exists(".revert-site-text")); assert.ok(!exists(".revert-site-text"));

View File

@@ -35,7 +35,7 @@ acceptance("Admin - Suspend User", function (needs) {
await visit("/admin/users/1234/regular"); await visit("/admin/users/1234/regular");
await click(".suspend-user"); await click(".suspend-user");
assert.equal(count(".suspend-user-modal:visible"), 1); assert.strictEqual(count(".suspend-user-modal:visible"), 1);
await click(".d-modal-cancel"); await click(".d-modal-cancel");
@@ -46,24 +46,24 @@ acceptance("Admin - Suspend User", function (needs) {
await visit("/admin/users/1234/regular"); await visit("/admin/users/1234/regular");
await click(".suspend-user"); await click(".suspend-user");
assert.equal(count(".suspend-user-modal:visible"), 1); assert.strictEqual(count(".suspend-user-modal:visible"), 1);
await fillIn("input.suspend-reason", "for breaking the rules"); await fillIn("input.suspend-reason", "for breaking the rules");
await fillIn(".suspend-message", "this is an email reason why"); await fillIn(".suspend-message", "this is an email reason why");
await click(".d-modal-cancel"); await click(".d-modal-cancel");
assert.equal(count(".bootbox.modal:visible"), 1); assert.strictEqual(count(".bootbox.modal:visible"), 1);
await click(".modal-footer .btn-default"); await click(".modal-footer .btn-default");
assert.equal(count(".suspend-user-modal:visible"), 1); assert.strictEqual(count(".suspend-user-modal:visible"), 1);
assert.equal( assert.strictEqual(
query(".suspend-message").value, query(".suspend-message").value,
"this is an email reason why" "this is an email reason why"
); );
await click(".d-modal-cancel"); await click(".d-modal-cancel");
assert.equal(count(".bootbox.modal:visible"), 1); assert.strictEqual(count(".bootbox.modal:visible"), 1);
assert.ok(!exists(".suspend-user-modal:visible")); assert.ok(!exists(".suspend-user-modal:visible"));
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
@@ -81,7 +81,11 @@ acceptance("Admin - Suspend User", function (needs) {
await click(".suspend-user"); await click(".suspend-user");
assert.equal(count(".perform-suspend[disabled]"), 1, "disabled by default"); assert.strictEqual(
count(".perform-suspend[disabled]"),
1,
"disabled by default"
);
await suspendUntilCombobox.expand(); await suspendUntilCombobox.expand();
await suspendUntilCombobox.selectRowByValue("tomorrow"); await suspendUntilCombobox.selectRowByValue("tomorrow");

View File

@@ -4,13 +4,13 @@ import I18n from "I18n";
import { test } from "qunit"; import { test } from "qunit";
function assertNoSecondary(assert) { function assertNoSecondary(assert) {
assert.equal( assert.strictEqual(
queryAll(".display-row.email .value a").text(), queryAll(".display-row.email .value a").text(),
"eviltrout@example.com", "eviltrout@example.com",
"it should display the primary email" "it should display the primary email"
); );
assert.equal( assert.strictEqual(
queryAll(".display-row.secondary-emails .value").text().trim(), queryAll(".display-row.secondary-emails .value").text().trim(),
I18n.t("user.email.no_secondary"), I18n.t("user.email.no_secondary"),
"it should not display secondary emails" "it should not display secondary emails"
@@ -18,13 +18,13 @@ function assertNoSecondary(assert) {
} }
function assertMultipleSecondary(assert, firstEmail, secondEmail) { function assertMultipleSecondary(assert, firstEmail, secondEmail) {
assert.equal( assert.strictEqual(
queryAll(".display-row.secondary-emails .value li:first-of-type a").text(), queryAll(".display-row.secondary-emails .value li:first-of-type a").text(),
firstEmail, firstEmail,
"it should display the first secondary email" "it should display the first secondary email"
); );
assert.equal( assert.strictEqual(
queryAll(".display-row.secondary-emails .value li:last-of-type a").text(), queryAll(".display-row.secondary-emails .value li:last-of-type a").text(),
secondEmail, secondEmail,
"it should display the second secondary email" "it should display the second secondary email"
@@ -43,7 +43,7 @@ acceptance("Admin - User Emails", function (needs) {
test("viewing self with multiple secondary emails", async function (assert) { test("viewing self with multiple secondary emails", async function (assert) {
await visit("/admin/users/3/markvanlan"); await visit("/admin/users/3/markvanlan");
assert.equal( assert.strictEqual(
queryAll(".display-row.email .value a").text(), queryAll(".display-row.email .value a").text(),
"markvanlan@example.com", "markvanlan@example.com",
"it should display the user's primary email" "it should display the user's primary email"

View File

@@ -101,19 +101,25 @@ acceptance("Admin - User Index", function (needs) {
test("can edit username", async function (assert) { test("can edit username", async function (assert) {
await visit("/admin/users/2/sam"); await visit("/admin/users/2/sam");
assert.equal(queryAll(".display-row.username .value").text().trim(), "sam"); assert.strictEqual(
queryAll(".display-row.username .value").text().trim(),
"sam"
);
// Trying cancel. // Trying cancel.
await click(".display-row.username button"); await click(".display-row.username button");
await fillIn(".display-row.username .value input", "new-sam"); await fillIn(".display-row.username .value input", "new-sam");
await click(".display-row.username a"); await click(".display-row.username a");
assert.equal(queryAll(".display-row.username .value").text().trim(), "sam"); assert.strictEqual(
queryAll(".display-row.username .value").text().trim(),
"sam"
);
// Doing edit. // Doing edit.
await click(".display-row.username button"); await click(".display-row.username button");
await fillIn(".display-row.username .value input", "new-sam"); await fillIn(".display-row.username .value input", "new-sam");
await click(".display-row.username button"); await click(".display-row.username button");
assert.equal( assert.strictEqual(
queryAll(".display-row.username .value").text().trim(), queryAll(".display-row.username .value").text().trim(),
"new-sam" "new-sam"
); );
@@ -122,7 +128,7 @@ acceptance("Admin - User Index", function (needs) {
test("shows the number of post edits", async function (assert) { test("shows the number of post edits", async function (assert) {
await visit("/admin/users/1/eviltrout"); await visit("/admin/users/1/eviltrout");
assert.equal(queryAll(".post-edits-count .value").text().trim(), "6"); assert.strictEqual(queryAll(".post-edits-count .value").text().trim(), "6");
assert.ok( assert.ok(
exists(".post-edits-count .controls .btn.btn-icon"), exists(".post-edits-count .controls .btn.btn-icon"),
@@ -137,7 +143,7 @@ acceptance("Admin - User Index", function (needs) {
await click(".post-edits-count .controls .btn.btn-icon"); await click(".post-edits-count .controls .btn.btn-icon");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
`/admin/reports/post_edits?filters=${filter}`, `/admin/reports/post_edits?filters=${filter}`,
"it redirects to the right admin report" "it redirects to the right admin report"
@@ -156,7 +162,7 @@ acceptance("Admin - User Index", function (needs) {
test("will clear unsaved groups when switching user", async function (assert) { test("will clear unsaved groups when switching user", async function (assert) {
await visit("/admin/users/2/sam"); await visit("/admin/users/2/sam");
assert.equal( assert.strictEqual(
queryAll(".display-row.username .value").text().trim(), queryAll(".display-row.username .value").text().trim(),
"sam", "sam",
"the name should be correct" "the name should be correct"
@@ -165,11 +171,15 @@ acceptance("Admin - User Index", function (needs) {
const groupChooser = selectKit(".group-chooser"); const groupChooser = selectKit(".group-chooser");
await groupChooser.expand(); await groupChooser.expand();
await groupChooser.selectRowByValue(42); await groupChooser.selectRowByValue(42);
assert.equal(groupChooser.header().value(), 42, "group should be set"); assert.strictEqual(
groupChooser.header().value(),
"42",
"group should be set"
);
await visit("/admin/users/1/eviltrout"); await visit("/admin/users/1/eviltrout");
assert.equal( assert.strictEqual(
queryAll(".display-row.username .value").text().trim(), queryAll(".display-row.username .value").text().trim(),
"eviltrout", "eviltrout",
"the name should be correct" "the name should be correct"
@@ -185,7 +195,7 @@ acceptance("Admin - User Index", function (needs) {
await visit("/admin/users/3/user1"); await visit("/admin/users/3/user1");
await click(".grant-admin"); await click(".grant-admin");
assert.ok(exists(".bootbox")); assert.ok(exists(".bootbox"));
assert.equal( assert.strictEqual(
I18n.t("admin.user.grant_admin_confirm"), I18n.t("admin.user.grant_admin_confirm"),
query(".modal-body").textContent.trim() query(".modal-body").textContent.trim()
); );

View File

@@ -48,7 +48,7 @@ acceptance("Admin - Users List", function (needs) {
await click(".show-emails"); await click(".show-emails");
assert.equal( assert.strictEqual(
queryAll(".users-list .user:nth-child(1) .email").text(), queryAll(".users-list .user:nth-child(1) .email").text(),
"<small>eviltrout@example.com</small>", "<small>eviltrout@example.com</small>",
"shows the emails" "shows the emails"
@@ -56,7 +56,7 @@ acceptance("Admin - Users List", function (needs) {
await click(".hide-emails"); await click(".hide-emails");
assert.equal( assert.strictEqual(
queryAll(".users-list .user:nth-child(1) .email").text(), queryAll(".users-list .user:nth-child(1) .email").text(),
"", "",
"hides the emails" "hides the emails"
@@ -71,7 +71,7 @@ acceptance("Admin - Users List", function (needs) {
await visit("/admin/users/list/active"); await visit("/admin/users/list/active");
assert.equal(queryAll(".admin-title h2").text(), activeTitle); assert.strictEqual(queryAll(".admin-title h2").text(), activeTitle);
assert.ok( assert.ok(
queryAll(".users-list .user:nth-child(1) .username") queryAll(".users-list .user:nth-child(1) .username")
.text() .text()
@@ -80,7 +80,7 @@ acceptance("Admin - Users List", function (needs) {
await click('a[href="/admin/users/list/new"]'); await click('a[href="/admin/users/list/new"]');
assert.equal(queryAll(".admin-title h2").text(), suspectTitle); assert.strictEqual(queryAll(".admin-title h2").text(), suspectTitle);
assert.ok( assert.ok(
queryAll(".users-list .user:nth-child(1) .username") queryAll(".users-list .user:nth-child(1) .username")
.text() .text()
@@ -89,7 +89,7 @@ acceptance("Admin - Users List", function (needs) {
await click(".users-list .sortable:nth-child(4)"); await click(".users-list .sortable:nth-child(4)");
assert.equal(queryAll(".admin-title h2").text(), suspectTitle); assert.strictEqual(queryAll(".admin-title h2").text(), suspectTitle);
assert.ok( assert.ok(
queryAll(".users-list .user:nth-child(1) .username") queryAll(".users-list .user:nth-child(1) .username")
.text() .text()
@@ -98,7 +98,7 @@ acceptance("Admin - Users List", function (needs) {
await click('a[href="/admin/users/list/active"]'); await click('a[href="/admin/users/list/active"]');
assert.equal(queryAll(".admin-title h2").text(), activeTitle); assert.strictEqual(queryAll(".admin-title h2").text(), activeTitle);
assert.ok( assert.ok(
queryAll(".users-list .user:nth-child(1) .username") queryAll(".users-list .user:nth-child(1) .username")
.text() .text()

View File

@@ -27,7 +27,7 @@ acceptance("Admin - Watched Words", function (needs) {
await fillIn(".admin-controls .controls input[type=text]", "li"); await fillIn(".admin-controls .controls input[type=text]", "li");
assert.equal( assert.strictEqual(
count(".watched-words-list .watched-word"), count(".watched-words-list .watched-word"),
1, 1,
"When filtering, show words even if checkbox is unchecked." "When filtering, show words even if checkbox is unchecked."
@@ -67,7 +67,7 @@ acceptance("Admin - Watched Words", function (needs) {
found.push(true); found.push(true);
} }
}); });
assert.equal(found.length, 1); assert.strictEqual(found.length, 1);
}); });
test("remove words", async function (assert) { test("remove words", async function (assert) {
@@ -84,23 +84,23 @@ acceptance("Admin - Watched Words", function (needs) {
await click(`#${$(word).attr("id")} .delete-word-record`); await click(`#${$(word).attr("id")} .delete-word-record`);
assert.equal(count(".watched-words-list .watched-word"), 2); assert.strictEqual(count(".watched-words-list .watched-word"), 2);
}); });
test("test modal - replace", async function (assert) { test("test modal - replace", async function (assert) {
await visit("/admin/customize/watched_words/action/replace"); await visit("/admin/customize/watched_words/action/replace");
await click(".watched-word-test"); await click(".watched-word-test");
await fillIn(".modal-body textarea", "Hi there!"); await fillIn(".modal-body textarea", "Hi there!");
assert.equal(find(".modal-body li .match").text(), "Hi"); assert.strictEqual(find(".modal-body li .match").text(), "Hi");
assert.equal(find(".modal-body li .replacement").text(), "hello"); assert.strictEqual(find(".modal-body li .replacement").text(), "hello");
}); });
test("test modal - tag", async function (assert) { test("test modal - tag", async function (assert) {
await visit("/admin/customize/watched_words/action/tag"); await visit("/admin/customize/watched_words/action/tag");
await click(".watched-word-test"); await click(".watched-word-test");
await fillIn(".modal-body textarea", "Hello world!"); await fillIn(".modal-body textarea", "Hello world!");
assert.equal(find(".modal-body li .match").text(), "Hello"); assert.strictEqual(find(".modal-body li .match").text(), "Hello");
assert.equal(find(".modal-body li .tag").text(), "greeting"); assert.strictEqual(find(".modal-body li .tag").text(), "greeting");
}); });
}); });
@@ -131,6 +131,6 @@ acceptance("Admin - Watched Words - Bad regular expressions", function (needs) {
test("shows an error message if regex is invalid", async function (assert) { test("shows an error message if regex is invalid", async function (assert) {
await visit("/admin/customize/watched_words/action/block"); await visit("/admin/customize/watched_words/action/block");
assert.equal(count(".admin-watched-words .alert-error"), 1); assert.strictEqual(count(".admin-watched-words .alert-error"), 1);
}); });
}); });

View File

@@ -22,7 +22,7 @@ acceptance("Auth Complete", function (needs) {
test("when login not required", async function (assert) { test("when login not required", async function (assert) {
await visit("/"); await visit("/");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"discovery.latest", "discovery.latest",
"it stays on the homepage" "it stays on the homepage"
@@ -38,7 +38,11 @@ acceptance("Auth Complete", function (needs) {
this.siteSettings.login_required = true; this.siteSettings.login_required = true;
await visit("/"); await visit("/");
assert.equal(currentRouteName(), "login", "it redirects to the login page"); assert.strictEqual(
currentRouteName(),
"login",
"it redirects to the login page"
);
assert.ok( assert.ok(
exists("#discourse-modal div.create-account-body"), exists("#discourse-modal div.create-account-body"),

View File

@@ -167,7 +167,10 @@ acceptance("Bookmarking", function (needs) {
exists(".bookmark-options-panel"), exists(".bookmark-options-panel"),
"it should reopen the options panel" "it should reopen the options panel"
); );
assert.equal(selectKit(".bookmark-option-selector").header().value(), 1); assert.strictEqual(
selectKit(".bookmark-option-selector").header().value(),
"1"
);
}); });
test("Saving a bookmark with no reminder or name", async function (assert) { test("Saving a bookmark with no reminder or name", async function (assert) {
@@ -236,17 +239,17 @@ acceptance("Bookmarking", function (needs) {
await click("#tap_tile_tomorrow"); await click("#tap_tile_tomorrow");
await openEditBookmarkModal(); await openEditBookmarkModal();
assert.equal( assert.strictEqual(
queryAll("#bookmark-name").val(), queryAll("#bookmark-name").val(),
"Test name", "Test name",
"it should prefill the bookmark name" "it should prefill the bookmark name"
); );
assert.equal( assert.strictEqual(
queryAll("#custom-date > input").val(), queryAll("#custom-date > input").val(),
tomorrow, tomorrow,
"it should prefill the bookmark date" "it should prefill the bookmark date"
); );
assert.equal( assert.strictEqual(
queryAll("#custom-time").val(), queryAll("#custom-time").val(),
"08:00", "08:00",
"it should prefill the bookmark time" "it should prefill the bookmark time"
@@ -265,17 +268,17 @@ acceptance("Bookmarking", function (needs) {
await click("#tap_tile_post_local_date"); await click("#tap_tile_post_local_date");
await openEditBookmarkModal(); await openEditBookmarkModal();
assert.equal( assert.strictEqual(
queryAll("#bookmark-name").val(), queryAll("#bookmark-name").val(),
"Test name", "Test name",
"it should prefill the bookmark name" "it should prefill the bookmark name"
); );
assert.equal( assert.strictEqual(
queryAll("#custom-date > input").val(), queryAll("#custom-date > input").val(),
postDateFormatted, postDateFormatted,
"it should prefill the bookmark date" "it should prefill the bookmark date"
); );
assert.equal( assert.strictEqual(
queryAll("#custom-time").val(), queryAll("#custom-time").val(),
"10:35", "10:35",
"it should prefill the bookmark time" "it should prefill the bookmark time"
@@ -342,7 +345,7 @@ acceptance("Bookmarking", function (needs) {
await openBookmarkModal(1); await openBookmarkModal(1);
await click("#save-bookmark"); await click("#save-bookmark");
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.edit_bookmark"), I18n.t("bookmarked.edit_bookmark"),
"A topic level bookmark button has a label 'Edit Bookmark'" "A topic level bookmark button has a label 'Edit Bookmark'"
@@ -360,7 +363,7 @@ acceptance("Bookmarking", function (needs) {
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
await click("#topic-footer-button-bookmark"); await click("#topic-footer-button-bookmark");
assert.equal( assert.strictEqual(
query("#discourse-modal-title").innerText, query("#discourse-modal-title").innerText,
I18n.t("post.bookmarks.create_for_topic"), I18n.t("post.bookmarks.create_for_topic"),
"The create modal says creating a topic bookmark" "The create modal says creating a topic bookmark"
@@ -373,7 +376,7 @@ acceptance("Bookmarking", function (needs) {
"the first post is not marked as being bookmarked" "the first post is not marked as being bookmarked"
); );
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.edit_bookmark"), I18n.t("bookmarked.edit_bookmark"),
"A topic level bookmark button has a label 'Edit Bookmark'" "A topic level bookmark button has a label 'Edit Bookmark'"
@@ -381,7 +384,7 @@ acceptance("Bookmarking", function (needs) {
await click("#topic-footer-button-bookmark"); await click("#topic-footer-button-bookmark");
assert.equal( assert.strictEqual(
query("#discourse-modal-title").innerText, query("#discourse-modal-title").innerText,
I18n.t("post.bookmarks.edit_for_topic"), I18n.t("post.bookmarks.edit_for_topic"),
"The edit modal says editing a topic bookmark" "The edit modal says editing a topic bookmark"
@@ -392,7 +395,7 @@ acceptance("Bookmarking", function (needs) {
await click("#topic-footer-button-bookmark"); await click("#topic-footer-button-bookmark");
assert.equal( assert.strictEqual(
query("input#bookmark-name").value, query("input#bookmark-name").value,
"Test name", "Test name",
"The topic level bookmark editing preserves the values entered" "The topic level bookmark editing preserves the values entered"
@@ -409,7 +412,7 @@ acceptance("Bookmarking", function (needs) {
); );
// deleting all bookmarks in the topic // deleting all bookmarks in the topic
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.clear_bookmarks"), I18n.t("bookmarked.clear_bookmarks"),
"the footer button says Clear Bookmarks because there is more than one" "the footer button says Clear Bookmarks because there is more than one"
@@ -421,7 +424,7 @@ acceptance("Bookmarking", function (needs) {
!exists(".topic-post:first-child button.bookmark.bookmarked"), !exists(".topic-post:first-child button.bookmark.bookmarked"),
"the first post bookmark is deleted" "the first post bookmark is deleted"
); );
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.title"), I18n.t("bookmarked.title"),
"the topic level bookmark is deleted" "the topic level bookmark is deleted"
@@ -433,7 +436,7 @@ acceptance("Bookmarking", function (needs) {
await click("#topic-footer-button-bookmark"); await click("#topic-footer-button-bookmark");
await click("#save-bookmark"); await click("#save-bookmark");
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.edit_bookmark"), I18n.t("bookmarked.edit_bookmark"),
"A topic level bookmark button has a label 'Edit Bookmark'" "A topic level bookmark button has a label 'Edit Bookmark'"
@@ -456,7 +459,7 @@ acceptance("Bookmarking", function (needs) {
await click(".bootbox.modal .btn-primary"); await click(".bootbox.modal .btn-primary");
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.title"), I18n.t("bookmarked.title"),
"A topic level bookmark button no longer says 'Edit Bookmark' after deletion" "A topic level bookmark button no longer says 'Edit Bookmark' after deletion"
@@ -468,7 +471,7 @@ acceptance("Bookmarking", function (needs) {
await openBookmarkModal(2); await openBookmarkModal(2);
await click("#save-bookmark"); await click("#save-bookmark");
assert.equal( assert.strictEqual(
query("#topic-footer-button-bookmark").innerText, query("#topic-footer-button-bookmark").innerText,
I18n.t("bookmarked.edit_bookmark"), I18n.t("bookmarked.edit_bookmark"),
"A topic level bookmark button has a label 'Edit Bookmark'" "A topic level bookmark button has a label 'Edit Bookmark'"

View File

@@ -60,7 +60,7 @@ acceptance("Category Banners", function (needs) {
await click(".modal-footer>.btn-primary"); await click(".modal-footer>.btn-primary");
assert.ok(!visible(".bootbox.modal"), "it closes the modal"); assert.ok(!visible(".bootbox.modal"), "it closes the modal");
assert.ok(visible(".category-read-only-banner"), "it shows a banner"); assert.ok(visible(".category-read-only-banner"), "it shows a banner");
assert.equal( assert.strictEqual(
count(".category-read-only-banner .inner"), count(".category-read-only-banner .inner"),
1, 1,
"it allows staff to embed html in the message" "it allows staff to embed html in the message"

View File

@@ -22,6 +22,6 @@ acceptance("CategoryChooser", function (needs) {
test("prefill category when category_id is set", async function (assert) { test("prefill category when category_id is set", async function (assert) {
await visit("/new-topic?category_id=1"); await visit("/new-topic?category_id=1");
assert.equal(selectKit(".category-chooser").header().value(), 1); assert.strictEqual(selectKit(".category-chooser").header().value(), "1");
}); });
}); });

View File

@@ -17,10 +17,10 @@ acceptance("Category Edit - security", function (needs) {
const firstRow = queryAll(".row-body").first(); const firstRow = queryAll(".row-body").first();
const badgeName = firstRow.find(".group-name-label").text(); const badgeName = firstRow.find(".group-name-label").text();
assert.equal(badgeName, "everyone"); assert.strictEqual(badgeName, "everyone");
const permission = firstRow.find(".d-icon-check-square"); const permission = firstRow.find(".d-icon-check-square");
assert.equal(permission.length, 3); assert.strictEqual(permission.length, 3);
}); });
test("removing a permission", async function (assert) { test("removing a permission", async function (assert) {
@@ -58,8 +58,8 @@ acceptance("Category Edit - security", function (needs) {
const addedRow = queryAll(".row-body").last(); const addedRow = queryAll(".row-body").last();
assert.equal(addedRow.find(".group-name-label").text(), "staff"); assert.strictEqual(addedRow.find(".group-name-label").text(), "staff");
assert.equal( assert.strictEqual(
addedRow.find(".d-icon-check-square").length, addedRow.find(".d-icon-check-square").length,
3, 3,
"new row permissions match default 'everyone' permissions" "new row permissions match default 'everyone' permissions"
@@ -78,12 +78,16 @@ acceptance("Category Edit - security", function (needs) {
await availableGroups.expand(); await availableGroups.expand();
await availableGroups.selectRowByValue("everyone"); await availableGroups.selectRowByValue("everyone");
assert.equal(count(".row-body"), 1, "adds back the permission tp the list"); assert.strictEqual(
count(".row-body"),
1,
"adds back the permission tp the list"
);
const firstRow = queryAll(".row-body").first(); const firstRow = queryAll(".row-body").first();
assert.equal(firstRow.find(".group-name-label").text(), "everyone"); assert.strictEqual(firstRow.find(".group-name-label").text(), "everyone");
assert.equal( assert.strictEqual(
firstRow.find(".d-icon-check-square").length, firstRow.find(".d-icon-check-square").length,
1, 1,
"adds only 'See' permission for a new row" "adds only 'See' permission for a new row"
@@ -97,7 +101,7 @@ acceptance("Category Edit - security", function (needs) {
const everyoneRow = queryAll(".row-body").first(); const everyoneRow = queryAll(".row-body").first();
assert.equal( assert.strictEqual(
everyoneRow.find(".reply-granted, .create-granted").length, everyoneRow.find(".reply-granted, .create-granted").length,
2, 2,
"everyone has full permissions by default" "everyone has full permissions by default"
@@ -108,7 +112,7 @@ acceptance("Category Edit - security", function (needs) {
const staffRow = queryAll(".row-body").last(); const staffRow = queryAll(".row-body").last();
assert.equal( assert.strictEqual(
staffRow.find(".reply-granted, .create-granted").length, staffRow.find(".reply-granted, .create-granted").length,
2, 2,
"staff group also has full permissions" "staff group also has full permissions"
@@ -116,13 +120,13 @@ acceptance("Category Edit - security", function (needs) {
await click(everyoneRow.find(".reply-toggle")[0]); await click(everyoneRow.find(".reply-toggle")[0]);
assert.equal( assert.strictEqual(
everyoneRow.find(".reply-granted, .create-granted").length, everyoneRow.find(".reply-granted, .create-granted").length,
0, 0,
"everyone does not have reply or create" "everyone does not have reply or create"
); );
assert.equal( assert.strictEqual(
staffRow.find(".reply-granted, .create-granted").length, staffRow.find(".reply-granted, .create-granted").length,
2, 2,
"staff group still has full permissions" "staff group still has full permissions"
@@ -130,19 +134,19 @@ acceptance("Category Edit - security", function (needs) {
await click(staffRow.find(".reply-toggle")[0]); await click(staffRow.find(".reply-toggle")[0]);
assert.equal( assert.strictEqual(
everyoneRow.find(".reply-granted, .create-granted").length, everyoneRow.find(".reply-granted, .create-granted").length,
0, 0,
"everyone permission unchanged" "everyone permission unchanged"
); );
assert.equal( assert.strictEqual(
staffRow.find(".reply-granted").length, staffRow.find(".reply-granted").length,
0, 0,
"staff does not have reply permission" "staff does not have reply permission"
); );
assert.equal( assert.strictEqual(
staffRow.find(".create-granted").length, staffRow.find(".create-granted").length,
0, 0,
"staff does not have create permission" "staff does not have create permission"
@@ -150,13 +154,13 @@ acceptance("Category Edit - security", function (needs) {
await click(everyoneRow.find(".create-toggle")[0]); await click(everyoneRow.find(".create-toggle")[0]);
assert.equal( assert.strictEqual(
everyoneRow.find(".reply-granted, .create-granted").length, everyoneRow.find(".reply-granted, .create-granted").length,
2, 2,
"everyone has full permissions" "everyone has full permissions"
); );
assert.equal( assert.strictEqual(
staffRow.find(".reply-granted, .create-granted").length, staffRow.find(".reply-granted, .create-granted").length,
2, 2,
"staff group has full permissions (inherited from everyone)" "staff group has full permissions (inherited from everyone)"

View File

@@ -17,22 +17,22 @@ acceptance("Category Edit", function (needs) {
await visit("/c/bug"); await visit("/c/bug");
await click("button.edit-category"); await click("button.edit-category");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/bug/edit/general", "/c/bug/edit/general",
"it jumps to the correct screen" "it jumps to the correct screen"
); );
assert.equal( assert.strictEqual(
queryAll(".category-breadcrumb .badge-category").text(), queryAll(".category-breadcrumb .badge-category").text(),
"bug" "bug"
); );
assert.equal( assert.strictEqual(
queryAll(".category-color-editor .badge-category").text(), queryAll(".category-color-editor .badge-category").text(),
"bug" "bug"
); );
await fillIn("input.category-name", "testing"); await fillIn("input.category-name", "testing");
assert.equal( assert.strictEqual(
queryAll(".category-color-editor .badge-category").text(), queryAll(".category-color-editor .badge-category").text(),
"testing" "testing"
); );
@@ -43,7 +43,7 @@ acceptance("Category Edit", function (needs) {
await fillIn(".d-editor-input", "this is the new topic template"); await fillIn(".d-editor-input", "this is the new topic template");
await click("#save-category"); await click("#save-category");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/bug/edit/general", "/c/bug/edit/general",
"it stays on the edit screen" "it stays on the edit screen"
@@ -55,7 +55,7 @@ acceptance("Category Edit", function (needs) {
await searchPriorityChooser.selectRowByValue(1); await searchPriorityChooser.selectRowByValue(1);
await click("#save-category"); await click("#save-category");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/bug/edit/settings", "/c/bug/edit/settings",
"it stays on the edit screen" "it stays on the edit screen"
@@ -72,7 +72,7 @@ acceptance("Category Edit", function (needs) {
test("Index Route", async function (assert) { test("Index Route", async function (assert) {
await visit("/c/bug/edit"); await visit("/c/bug/edit");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/bug/edit/general", "/c/bug/edit/general",
"it redirects to the general tab" "it redirects to the general tab"
@@ -81,12 +81,12 @@ acceptance("Category Edit", function (needs) {
test("Slugless Route", async function (assert) { test("Slugless Route", async function (assert) {
await visit("/c/1-category/edit"); await visit("/c/1-category/edit");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/1-category/edit/general", "/c/1-category/edit/general",
"it goes to the general tab" "it goes to the general tab"
); );
assert.equal(queryAll("input.category-name").val(), "bug"); assert.strictEqual(queryAll("input.category-name").val(), "bug");
}); });
test("Error Saving", async function (assert) { test("Error Saving", async function (assert) {
@@ -95,7 +95,10 @@ acceptance("Category Edit", function (needs) {
await click("#save-category"); await click("#save-category");
assert.ok(visible(".bootbox")); assert.ok(visible(".bootbox"));
assert.equal(queryAll(".bootbox .modal-body").html(), "duplicate email"); assert.strictEqual(
queryAll(".bootbox .modal-body").html(),
"duplicate email"
);
await click(".bootbox .btn-primary"); await click(".bootbox .btn-primary");
assert.ok(!visible(".bootbox")); assert.ok(!visible(".bootbox"));
@@ -156,6 +159,6 @@ acceptance("Category Edit - no permission to edit", function (needs) {
test("returns 404", async function (assert) { test("returns 404", async function (assert) {
await visit("/c/bug/edit"); await visit("/c/bug/edit");
assert.equal(currentURL(), "/404"); assert.strictEqual(currentURL(), "/404");
}); });
}); });

View File

@@ -19,17 +19,17 @@ acceptance("Category New", function (needs) {
assert.notOk(exists(".category-breadcrumb")); assert.notOk(exists(".category-breadcrumb"));
await fillIn("input.category-name", "testing"); await fillIn("input.category-name", "testing");
assert.equal(queryAll(".badge-category").text(), "testing"); assert.strictEqual(queryAll(".badge-category").text(), "testing");
await click("#save-category"); await click("#save-category");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/c/testing/edit/general", "/c/testing/edit/general",
"it transitions to the category edit route" "it transitions to the category edit route"
); );
assert.equal( assert.strictEqual(
queryAll(".edit-category-title h2").text(), queryAll(".edit-category-title h2").text(),
I18n.t("category.edit_dialog_title", { I18n.t("category.edit_dialog_title", {
categoryName: "testing", categoryName: "testing",

View File

@@ -20,8 +20,11 @@ acceptance("Click Track", function (needs) {
assert.ok(!exists(".user-card.show"), "card should not appear"); assert.ok(!exists(".user-card.show"), "card should not appear");
await click('article[data-post-id="3651"] a.mention'); await click('article[data-post-id="3651"] a.mention');
assert.equal(count(".user-card.show"), 1, "card appear"); assert.strictEqual(count(".user-card.show"), 1, "card appear");
assert.equal(currentURL(), "/t/internationalization-localization/280"); assert.strictEqual(
currentURL(),
"/t/internationalization-localization/280"
);
assert.ok(!tracked); assert.ok(!tracked);
}); });
}); });

View File

@@ -41,15 +41,21 @@ acceptance("Composer Actions", function (needs) {
await click("article#post_3 button.reply"); await click("article#post_3 button.reply");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rowByIndex(0).value(), "reply_as_new_topic"); assert.strictEqual(
assert.equal( composerActions.rowByIndex(0).value(),
"reply_as_new_topic"
);
assert.strictEqual(
composerActions.rowByIndex(1).value(), composerActions.rowByIndex(1).value(),
"reply_as_private_message" "reply_as_private_message"
); );
assert.equal(composerActions.rowByIndex(2).value(), "reply_to_topic"); assert.strictEqual(composerActions.rowByIndex(2).value(), "reply_to_topic");
assert.equal(composerActions.rowByIndex(3).value(), "toggle_whisper"); assert.strictEqual(composerActions.rowByIndex(3).value(), "toggle_whisper");
assert.equal(composerActions.rowByIndex(4).value(), "toggle_topic_bump"); assert.strictEqual(
assert.equal(composerActions.rowByIndex(5).value(), undefined); composerActions.rowByIndex(4).value(),
"toggle_topic_bump"
);
assert.strictEqual(composerActions.rowByIndex(5).value(), null);
}); });
test("replying to post - reply_as_private_message", async function (assert) { test("replying to post - reply_as_private_message", async function (assert) {
@@ -62,7 +68,7 @@ acceptance("Composer Actions", function (needs) {
await composerActions.selectRowByValue("reply_as_private_message"); await composerActions.selectRowByValue("reply_as_private_message");
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal(privateMessageUsers.header().value(), "codinghorror"); assert.strictEqual(privateMessageUsers.header().value(), "codinghorror");
assert.ok( assert.ok(
queryAll(".d-editor-input").val().indexOf("Continuing the discussion") >= queryAll(".d-editor-input").val().indexOf("Continuing the discussion") >=
0 0
@@ -82,15 +88,15 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("reply_to_topic"); await composerActions.selectRowByValue("reply_to_topic");
assert.equal( assert.strictEqual(
queryAll(".action-title .topic-link").text().trim(), queryAll(".action-title .topic-link").text().trim(),
"Internationalization / localization" "Internationalization / localization"
); );
assert.equal( assert.strictEqual(
queryAll(".action-title .topic-link").attr("href"), queryAll(".action-title .topic-link").attr("href"),
"/t/internationalization-localization/280" "/t/internationalization-localization/280"
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"test replying to topic when initially replied to post" "test replying to topic when initially replied to post"
); );
@@ -110,7 +116,7 @@ acceptance("Composer Actions", function (needs) {
!exists(".composer-actions svg.d-icon-far-eye-slash"), !exists(".composer-actions svg.d-icon-far-eye-slash"),
"whisper icon is not visible" "whisper icon is not visible"
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-share"), count(".composer-actions svg.d-icon-share"),
1, 1,
"reply icon is visible" "reply icon is visible"
@@ -119,7 +125,7 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("toggle_whisper"); await composerActions.selectRowByValue("toggle_whisper");
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-far-eye-slash"), count(".composer-actions svg.d-icon-far-eye-slash"),
1, 1,
"whisper icon is visible" "whisper icon is visible"
@@ -152,8 +158,8 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("reply_as_new_topic"); await composerActions.selectRowByValue("reply_as_new_topic");
assert.equal(categoryChooserReplyArea.header().name(), "faq"); assert.strictEqual(categoryChooserReplyArea.header().name(), "faq");
assert.equal( assert.strictEqual(
queryAll(".action-title").text().trim(), queryAll(".action-title").text().trim(),
I18n.t("topic.create_long") I18n.t("topic.create_long")
); );
@@ -190,11 +196,11 @@ acceptance("Composer Actions", function (needs) {
await composerActions.selectRowByValue("reply_as_private_message"); await composerActions.selectRowByValue("reply_as_private_message");
assert.ok(composerActions.el().hasClass("is-hidden")); assert.ok(composerActions.el().hasClass("is-hidden"));
assert.equal(composerActions.el().children().length, 0); assert.strictEqual(composerActions.el().children().length, 0);
await click("button#create-topic"); await click("button#create-topic");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rows().length, 2); assert.strictEqual(composerActions.rows().length, 2);
}); });
test("interactions", async function (assert) { test("interactions", async function (assert) {
@@ -207,64 +213,76 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("reply_to_topic"); await composerActions.selectRowByValue("reply_to_topic");
assert.equal( assert.strictEqual(
queryAll(".action-title").text().trim(), queryAll(".action-title").text().trim(),
"Internationalization / localization" "Internationalization / localization"
); );
assert.equal(queryAll(".d-editor-input").val(), quote); assert.strictEqual(queryAll(".d-editor-input").val(), quote);
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rowByIndex(0).value(), "reply_as_new_topic"); assert.strictEqual(
assert.equal(composerActions.rowByIndex(1).value(), "reply_to_post"); composerActions.rowByIndex(0).value(),
assert.equal( "reply_as_new_topic"
);
assert.strictEqual(composerActions.rowByIndex(1).value(), "reply_to_post");
assert.strictEqual(
composerActions.rowByIndex(2).value(), composerActions.rowByIndex(2).value(),
"reply_as_private_message" "reply_as_private_message"
); );
assert.equal(composerActions.rowByIndex(3).value(), "toggle_whisper"); assert.strictEqual(composerActions.rowByIndex(3).value(), "toggle_whisper");
assert.equal(composerActions.rowByIndex(4).value(), "toggle_topic_bump"); assert.strictEqual(
assert.equal(composerActions.rows().length, 5); composerActions.rowByIndex(4).value(),
"toggle_topic_bump"
);
assert.strictEqual(composerActions.rows().length, 5);
await composerActions.selectRowByValue("reply_to_post"); await composerActions.selectRowByValue("reply_to_post");
await composerActions.expand(); await composerActions.expand();
assert.ok(exists(".action-title img.avatar")); assert.ok(exists(".action-title img.avatar"));
assert.equal( assert.strictEqual(
queryAll(".action-title .user-link").text().trim(), queryAll(".action-title .user-link").text().trim(),
"codinghorror" "codinghorror"
); );
assert.equal(queryAll(".d-editor-input").val(), quote); assert.strictEqual(queryAll(".d-editor-input").val(), quote);
assert.equal(composerActions.rowByIndex(0).value(), "reply_as_new_topic"); assert.strictEqual(
assert.equal( composerActions.rowByIndex(0).value(),
"reply_as_new_topic"
);
assert.strictEqual(
composerActions.rowByIndex(1).value(), composerActions.rowByIndex(1).value(),
"reply_as_private_message" "reply_as_private_message"
); );
assert.equal(composerActions.rowByIndex(2).value(), "reply_to_topic"); assert.strictEqual(composerActions.rowByIndex(2).value(), "reply_to_topic");
assert.equal(composerActions.rowByIndex(3).value(), "toggle_whisper"); assert.strictEqual(composerActions.rowByIndex(3).value(), "toggle_whisper");
assert.equal(composerActions.rowByIndex(4).value(), "toggle_topic_bump"); assert.strictEqual(
assert.equal(composerActions.rows().length, 5); composerActions.rowByIndex(4).value(),
"toggle_topic_bump"
);
assert.strictEqual(composerActions.rows().length, 5);
await composerActions.selectRowByValue("reply_as_new_topic"); await composerActions.selectRowByValue("reply_as_new_topic");
await composerActions.expand(); await composerActions.expand();
assert.equal( assert.strictEqual(
queryAll(".action-title").text().trim(), queryAll(".action-title").text().trim(),
I18n.t("topic.create_long") I18n.t("topic.create_long")
); );
assert.ok(queryAll(".d-editor-input").val().includes(quote)); assert.ok(queryAll(".d-editor-input").val().includes(quote));
assert.equal(composerActions.rowByIndex(0).value(), "reply_to_post"); assert.strictEqual(composerActions.rowByIndex(0).value(), "reply_to_post");
assert.equal( assert.strictEqual(
composerActions.rowByIndex(1).value(), composerActions.rowByIndex(1).value(),
"reply_as_private_message" "reply_as_private_message"
); );
assert.equal(composerActions.rowByIndex(2).value(), "reply_to_topic"); assert.strictEqual(composerActions.rowByIndex(2).value(), "reply_to_topic");
assert.equal(composerActions.rowByIndex(3).value(), "shared_draft"); assert.strictEqual(composerActions.rowByIndex(3).value(), "shared_draft");
assert.equal(composerActions.rows().length, 4); assert.strictEqual(composerActions.rows().length, 4);
await composerActions.selectRowByValue("reply_as_private_message"); await composerActions.selectRowByValue("reply_as_private_message");
await composerActions.expand(); await composerActions.expand();
assert.equal( assert.strictEqual(
queryAll(".action-title").text().trim(), queryAll(".action-title").text().trim(),
I18n.t("topic.private_message") I18n.t("topic.private_message")
); );
@@ -272,10 +290,13 @@ acceptance("Composer Actions", function (needs) {
queryAll(".d-editor-input").val().indexOf("Continuing the discussion") === queryAll(".d-editor-input").val().indexOf("Continuing the discussion") ===
0 0
); );
assert.equal(composerActions.rowByIndex(0).value(), "reply_as_new_topic"); assert.strictEqual(
assert.equal(composerActions.rowByIndex(1).value(), "reply_to_post"); composerActions.rowByIndex(0).value(),
assert.equal(composerActions.rowByIndex(2).value(), "reply_to_topic"); "reply_as_new_topic"
assert.equal(composerActions.rows().length, 3); );
assert.strictEqual(composerActions.rowByIndex(1).value(), "reply_to_post");
assert.strictEqual(composerActions.rowByIndex(2).value(), "reply_to_topic");
assert.strictEqual(composerActions.rows().length, 3);
}); });
test("replying to post - toggle_topic_bump", async function (assert) { test("replying to post - toggle_topic_bump", async function (assert) {
@@ -288,7 +309,7 @@ acceptance("Composer Actions", function (needs) {
!exists(".composer-actions svg.d-icon-anchor"), !exists(".composer-actions svg.d-icon-anchor"),
"no-bump icon is not visible" "no-bump icon is not visible"
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-share"), count(".composer-actions svg.d-icon-share"),
1, 1,
"reply icon is visible" "reply icon is visible"
@@ -297,7 +318,7 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("toggle_topic_bump"); await composerActions.selectRowByValue("toggle_topic_bump");
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-anchor"), count(".composer-actions svg.d-icon-anchor"),
1, 1,
"no-bump icon is visible" "no-bump icon is visible"
@@ -314,7 +335,7 @@ acceptance("Composer Actions", function (needs) {
!exists(".composer-actions svg.d-icon-anchor"), !exists(".composer-actions svg.d-icon-anchor"),
"no-bump icon is not visible" "no-bump icon is not visible"
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-share"), count(".composer-actions svg.d-icon-share"),
1, 1,
"reply icon is visible" "reply icon is visible"
@@ -335,7 +356,7 @@ acceptance("Composer Actions", function (needs) {
!exists(".composer-fields .whisper .d-icon-anchor"), !exists(".composer-fields .whisper .d-icon-anchor"),
"no-bump icon is not visible" "no-bump icon is not visible"
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-share"), count(".composer-actions svg.d-icon-share"),
1, 1,
"reply icon is visible" "reply icon is visible"
@@ -346,12 +367,12 @@ acceptance("Composer Actions", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("toggle_whisper"); await composerActions.selectRowByValue("toggle_whisper");
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-far-eye-slash"), count(".composer-actions svg.d-icon-far-eye-slash"),
1, 1,
"whisper icon is visible" "whisper icon is visible"
); );
assert.equal( assert.strictEqual(
count(".composer-fields .no-bump .d-icon-anchor"), count(".composer-fields .no-bump .d-icon-anchor"),
1, 1,
"no-bump icon is visible" "no-bump icon is visible"
@@ -370,8 +391,11 @@ acceptance("Composer Actions", function (needs) {
await click("article#post_3 button.reply"); await click("article#post_3 button.reply");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rows().length, 5); assert.strictEqual(composerActions.rows().length, 5);
assert.equal(composerActions.rowByIndex(4).value(), "toggle_topic_bump"); assert.strictEqual(
composerActions.rowByIndex(4).value(),
"toggle_topic_bump"
);
}); });
test("replying to post as TL3 user", async function (assert) { test("replying to post as TL3 user", async function (assert) {
@@ -382,9 +406,9 @@ acceptance("Composer Actions", function (needs) {
await click("article#post_3 button.reply"); await click("article#post_3 button.reply");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rows().length, 3); assert.strictEqual(composerActions.rows().length, 3);
Array.from(composerActions.rows()).forEach((row) => { Array.from(composerActions.rows()).forEach((row) => {
assert.notEqual( assert.notStrictEqual(
row.value, row.value,
"toggle_topic_bump", "toggle_topic_bump",
"toggle button is not visible" "toggle button is not visible"
@@ -400,8 +424,11 @@ acceptance("Composer Actions", function (needs) {
await click("article#post_3 button.reply"); await click("article#post_3 button.reply");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rows().length, 4); assert.strictEqual(composerActions.rows().length, 4);
assert.equal(composerActions.rowByIndex(3).value(), "toggle_topic_bump"); assert.strictEqual(
composerActions.rowByIndex(3).value(),
"toggle_topic_bump"
);
}); });
test("replying to first post - reply_as_private_message", async function (assert) { test("replying to first post - reply_as_private_message", async function (assert) {
@@ -414,7 +441,7 @@ acceptance("Composer Actions", function (needs) {
await composerActions.selectRowByValue("reply_as_private_message"); await composerActions.selectRowByValue("reply_as_private_message");
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal(privateMessageUsers.header().value(), "uwe_keim"); assert.strictEqual(privateMessageUsers.header().value(), "uwe_keim");
assert.ok( assert.ok(
queryAll(".d-editor-input").val().indexOf("Continuing the discussion") >= queryAll(".d-editor-input").val().indexOf("Continuing the discussion") >=
0 0
@@ -429,8 +456,8 @@ acceptance("Composer Actions", function (needs) {
await click("article#post_1 button.edit"); await click("article#post_1 button.edit");
await composerActions.expand(); await composerActions.expand();
assert.equal(composerActions.rows().length, 1); assert.strictEqual(composerActions.rows().length, 1);
assert.equal(composerActions.rowByIndex(0).value(), "reply_to_post"); assert.strictEqual(composerActions.rowByIndex(0).value(), "reply_to_post");
}); });
}); });
@@ -477,24 +504,24 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {
await composerActions.expand(); await composerActions.expand();
await composerActions.selectRowByValue("shared_draft"); await composerActions.selectRowByValue("shared_draft");
assert.equal(tags.header().value(), "monkey", "tags are not reset"); assert.strictEqual(tags.header().value(), "monkey", "tags are not reset");
assert.equal( assert.strictEqual(
queryAll("#reply-title").val(), queryAll("#reply-title").val(),
"This is the new text for the title using 'quotes'" "This is the new text for the title using 'quotes'"
); );
assert.equal( assert.strictEqual(
queryAll("#reply-control .btn-primary.create .d-button-label").text(), queryAll("#reply-control .btn-primary.create .d-button-label").text(),
I18n.t("composer.create_shared_draft") I18n.t("composer.create_shared_draft")
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-far-clipboard"), count(".composer-actions svg.d-icon-far-clipboard"),
1, 1,
"shared draft icon is visible" "shared draft icon is visible"
); );
assert.equal(count("#reply-control.composing-shared-draft"), 1); assert.strictEqual(count("#reply-control.composing-shared-draft"), 1);
await click(".modal-footer .btn.btn-default"); await click(".modal-footer .btn.btn-default");
} finally { } finally {
toggleCheckDraftPopup(false); toggleCheckDraftPopup(false);
@@ -509,7 +536,7 @@ acceptance("Composer Actions With New Topic Draft", function (needs) {
await composerActions.expand(); await composerActions.expand();
stubDraftResponse(); stubDraftResponse();
await composerActions.selectRowByValue("reply_as_new_topic"); await composerActions.selectRowByValue("reply_as_new_topic");
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").text(), queryAll(".bootbox .modal-body").text(),
I18n.t("composer.composer_actions.reply_as_new_topic.confirm") I18n.t("composer.composer_actions.reply_as_new_topic.confirm")
); );

View File

@@ -27,7 +27,7 @@ async function writeInComposer(assert) {
await fillIn(".d-editor-input", "[test](upload://abcdefg.png)"); await fillIn(".d-editor-input", "[test](upload://abcdefg.png)");
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
'<p><a href="/404" tabindex="-1">test</a></p>' '<p><a href="/404" tabindex="-1">test</a></p>'
); );
@@ -41,7 +41,7 @@ acceptance("Composer Attachment - Cooking", function (needs) {
test("attachments are cooked properly", async function (assert) { test("attachments are cooked properly", async function (assert) {
await writeInComposer(assert); await writeInComposer(assert);
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
'<p><a class="attachment" href="/uploads/short-url/asdsad.png" tabindex="-1">test</a></p>' '<p><a class="attachment" href="/uploads/short-url/asdsad.png" tabindex="-1">test</a></p>'
); );
@@ -55,7 +55,7 @@ acceptance("Composer Attachment - Secure Media Enabled", function (needs) {
test("attachments are cooked properly when secure media is enabled", async function (assert) { test("attachments are cooked properly when secure media is enabled", async function (assert) {
await writeInComposer(assert); await writeInComposer(assert);
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
'<p><a class="attachment" href="/secure-media-uploads/default/3X/1/asjdiasjdiasida.png" tabindex="-1">test</a></p>' '<p><a class="attachment" href="/secure-media-uploads/default/3X/1/asjdiasjdiasida.png" tabindex="-1">test</a></p>'
); );
@@ -71,13 +71,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300); const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300);
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: avatar.png...]()\n" "[Uploading: avatar.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"![avatar|200x300](/images/avatar.png?1)\n" "![avatar|200x300](/images/avatar.png?1)\n"
); );
@@ -91,13 +91,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300); const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300);
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n[Uploading: avatar.png...]()\n" "The image:\n[Uploading: avatar.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n![avatar|200x300](/images/avatar.png?1)\n" "The image:\n![avatar|200x300](/images/avatar.png?1)\n"
); );
@@ -111,13 +111,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300); const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300);
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n[Uploading: avatar.png...]()\n" "The image:\n[Uploading: avatar.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n![avatar|200x300](/images/avatar.png?1)\n" "The image:\n![avatar|200x300](/images/avatar.png?1)\n"
); );
@@ -134,13 +134,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300); const image = createImage("avatar.png", "/images/avatar.png?1", 200, 300);
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image \n[Uploading: avatar.png...]()\nText after the image." "The image \n[Uploading: avatar.png...]()\nText after the image."
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image \n![avatar|200x300](/images/avatar.png?1)\nText after the image." "The image \n![avatar|200x300](/images/avatar.png?1)\nText after the image."
); );
@@ -159,13 +159,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
textArea.selectionEnd = 23; textArea.selectionEnd = 23;
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image \n[Uploading: avatar.png...]()\n Text after the image." "The image \n[Uploading: avatar.png...]()\n Text after the image."
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image \n![avatar|200x300](/images/avatar.png?1)\n Text after the image." "The image \n![avatar|200x300](/images/avatar.png?1)\n Text after the image."
); );
@@ -181,43 +181,43 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image4 = createImage("image.png", "/images/avatar.png?4", 300, 400); const image4 = createImage("image.png", "/images/avatar.png?4", 300, 400);
await queryAll(".wmd-controls").trigger("fileuploadsend", image1); await queryAll(".wmd-controls").trigger("fileuploadsend", image1);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n" "[Uploading: test.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploadsend", image2); await queryAll(".wmd-controls").trigger("fileuploadsend", image2);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n" "[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploadsend", image4); await queryAll(".wmd-controls").trigger("fileuploadsend", image4);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n[Uploading: image.png...]()\n" "[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n[Uploading: image.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploadsend", image3); await queryAll(".wmd-controls").trigger("fileuploadsend", image3);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n[Uploading: image.png...]()\n[Uploading: image.png(1)...]()\n" "[Uploading: test.png...]()\n[Uploading: test.png(1)...]()\n[Uploading: image.png...]()\n[Uploading: image.png(1)...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image2); await queryAll(".wmd-controls").trigger("fileuploaddone", image2);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n[Uploading: image.png(1)...]()\n" "[Uploading: test.png...]()\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n[Uploading: image.png(1)...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image3); await queryAll(".wmd-controls").trigger("fileuploaddone", image3);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: test.png...]()\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n![image|300x400](/images/avatar.png?3)\n" "[Uploading: test.png...]()\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n![image|300x400](/images/avatar.png?3)\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image1); await queryAll(".wmd-controls").trigger("fileuploaddone", image1);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"![test|200x300](/images/avatar.png?1)\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n![image|300x400](/images/avatar.png?3)\n" "![test|200x300](/images/avatar.png?1)\n![test|100x200](/images/avatar.png?2)\n[Uploading: image.png...]()\n![image|300x400](/images/avatar.png?3)\n"
); );
@@ -230,13 +230,13 @@ acceptance("Composer Attachment - Upload Placeholder", function (needs) {
const image = createImage("ima++ge.png", "/images/avatar.png?4", 300, 400); const image = createImage("ima++ge.png", "/images/avatar.png?4", 300, 400);
await queryAll(".wmd-controls").trigger("fileuploadsend", image); await queryAll(".wmd-controls").trigger("fileuploadsend", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Uploading: ima++ge.png...]()\n" "[Uploading: ima++ge.png...]()\n"
); );
await queryAll(".wmd-controls").trigger("fileuploaddone", image); await queryAll(".wmd-controls").trigger("fileuploaddone", image);
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"![ima++ge|300x400](/images/avatar.png?4)\n" "![ima++ge|300x400](/images/avatar.png?4)\n"
); );
@@ -279,7 +279,7 @@ acceptance("Composer Attachment - Upload Handler", function (needs) {
await fillIn(".d-editor-input", "This is a handler test."); await fillIn(".d-editor-input", "This is a handler test.");
await queryAll(".wmd-controls").trigger("fileuploadsubmit", image); await queryAll(".wmd-controls").trigger("fileuploadsubmit", image);
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
"This is an upload handler test for handlertest.png", "This is an upload handler test for handlertest.png",
"it should show the bootbox triggered by the upload handler" "it should show the bootbox triggered by the upload handler"
@@ -305,7 +305,7 @@ acceptance("Composer Attachment - File input", function (needs) {
await click("#create-topic"); await click("#create-topic");
assert.ok(exists("input#file-uploader"), "An input is rendered"); assert.ok(exists("input#file-uploader"), "An input is rendered");
assert.equal( assert.strictEqual(
query("input#file-uploader").accept, query("input#file-uploader").accept,
".jpg,.jpeg,.png", ".jpg,.jpeg,.png",
"Accepted values are correct" "Accepted values are correct"

View File

@@ -34,7 +34,7 @@ acceptance("Composer - Draft saving", function (needs) {
); );
await fillIn(".d-editor-input", "This won't be saved because of error"); await fillIn(".d-editor-input", "This won't be saved because of error");
assert.equal( assert.strictEqual(
query("div#draft-status span").innerText.trim(), query("div#draft-status span").innerText.trim(),
I18n.t("composer.drafts_offline"), I18n.t("composer.drafts_offline"),
"the draft wasn't saved, a warning is rendered" "the draft wasn't saved, a warning is rendered"

View File

@@ -22,7 +22,7 @@ acceptance("Composer - Edit conflict", function (needs) {
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
await fillIn(".d-editor-input", "this will 409"); await fillIn(".d-editor-input", "this will 409");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal( assert.strictEqual(
queryAll("#reply-control button.create").text().trim(), queryAll("#reply-control button.create").text().trim(),
I18n.t("composer.overwrite_edit"), I18n.t("composer.overwrite_edit"),
"it shows the overwrite button" "it shows the overwrite button"

View File

@@ -27,7 +27,7 @@ acceptance("Composer - Hyperlink", function (needs) {
await fillIn(".modal-body .link-text", "Google"); await fillIn(".modal-body .link-text", "Google");
await click(".modal-footer button.btn-primary"); await click(".modal-footer button.btn-primary");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"This is a link to [Google](https://google.com)", "This is a link to [Google](https://google.com)",
"adds link with url and text, prepends 'https://'" "adds link with url and text, prepends 'https://'"
@@ -45,7 +45,7 @@ acceptance("Composer - Hyperlink", function (needs) {
await fillIn(".modal-body .link-text", "Google"); await fillIn(".modal-body .link-text", "Google");
await click(".modal-footer button.btn-danger"); await click(".modal-footer button.btn-danger");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"Reset textarea contents.", "Reset textarea contents.",
"doesnt insert anything after cancelling" "doesnt insert anything after cancelling"
@@ -64,7 +64,7 @@ acceptance("Composer - Hyperlink", function (needs) {
await fillIn(".modal-body .link-url", "somelink.com"); await fillIn(".modal-body .link-url", "somelink.com");
await click(".modal-footer button.btn-primary"); await click(".modal-footer button.btn-primary");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"[Reset](https://somelink.com) textarea contents.", "[Reset](https://somelink.com) textarea contents.",
"adds link to a selected text" "adds link to a selected text"

View File

@@ -28,7 +28,7 @@ http://www.example.com/has-title.html
` `
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
` `
<p><aside class=\"onebox\"><article class=\"onebox-body\"><h3><a href=\"http://www.example.com/article.html\" tabindex=\"-1\">An interesting article</a></h3></article></aside><br> <p><aside class=\"onebox\"><article class=\"onebox-body\"><h3><a href=\"http://www.example.com/article.html\" tabindex=\"-1\">An interesting article</a></h3></article></aside><br>
@@ -66,15 +66,15 @@ acceptance("Composer - Inline Onebox", function (needs) {
await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
await fillIn(".d-editor-input", `Test www.example.com/page`); await fillIn(".d-editor-input", `Test www.example.com/page`);
assert.equal(requestsCount, 1); assert.strictEqual(requestsCount, 1);
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview").html().trim(), queryAll(".d-editor-preview").html().trim(),
'<p>Test <a href="http://www.example.com/page" class="inline-onebox-loading" tabindex="-1">www.example.com/page</a></p>' '<p>Test <a href="http://www.example.com/page" class="inline-onebox-loading" tabindex="-1">www.example.com/page</a></p>'
); );
await fillIn(".d-editor-input", `Test www.example.com/page Test`); await fillIn(".d-editor-input", `Test www.example.com/page Test`);
assert.equal(requestsCount, 1); assert.strictEqual(requestsCount, 1);
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview").html().trim(), queryAll(".d-editor-preview").html().trim(),
'<p>Test <a href="http://www.example.com/page" tabindex="-1">www.example.com/page</a> Test</p>' '<p>Test <a href="http://www.example.com/page" tabindex="-1">www.example.com/page</a> Test</p>'
); );

View File

@@ -32,7 +32,7 @@ acceptance("Composer - Tags", function (needs) {
await categoryChooser.selectRowByValue(2); await categoryChooser.selectRowByValue(2);
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.notEqual(currentURL(), "/"); assert.notStrictEqual(currentURL(), "/");
}); });
test("users do not bypass tag validation rule", async function (assert) { test("users do not bypass tag validation rule", async function (assert) {
@@ -51,8 +51,8 @@ acceptance("Composer - Tags", function (needs) {
updateCurrentUser({ moderator: false, admin: false, trust_level: 1 }); updateCurrentUser({ moderator: false, admin: false, trust_level: 1 });
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal(currentURL(), "/"); assert.strictEqual(currentURL(), "/");
assert.equal( assert.strictEqual(
queryAll(".popup-tip.bad").text().trim(), queryAll(".popup-tip.bad").text().trim(),
I18n.t("composer.error.tags_missing", { count: 1 }), I18n.t("composer.error.tags_missing", { count: 1 }),
"it should display the right alert" "it should display the right alert"
@@ -63,7 +63,7 @@ acceptance("Composer - Tags", function (needs) {
await tags.selectRowByValue("monkey"); await tags.selectRowByValue("monkey");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.notEqual(currentURL(), "/"); assert.notStrictEqual(currentURL(), "/");
}); });
test("users do not bypass min required tags in tag group validation rule", async function (assert) { test("users do not bypass min required tags in tag group validation rule", async function (assert) {
@@ -85,8 +85,8 @@ acceptance("Composer - Tags", function (needs) {
updateCurrentUser({ moderator: false, admin: false, trust_level: 1 }); updateCurrentUser({ moderator: false, admin: false, trust_level: 1 });
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal(currentURL(), "/"); assert.strictEqual(currentURL(), "/");
assert.equal( assert.strictEqual(
queryAll(".popup-tip.bad").text().trim(), queryAll(".popup-tip.bad").text().trim(),
I18n.t("composer.error.tags_missing", { count: 1 }), I18n.t("composer.error.tags_missing", { count: 1 }),
"it should display the right alert" "it should display the right alert"
@@ -97,6 +97,6 @@ acceptance("Composer - Tags", function (needs) {
await tags.selectRowByValue("monkey"); await tags.selectRowByValue("monkey");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.notEqual(currentURL(), "/"); assert.notStrictEqual(currentURL(), "/");
}); });
}); });

View File

@@ -84,7 +84,7 @@ acceptance("Composer", function (needs) {
assert.ok(exists(".title-input .popup-tip.good"), "the title is now good"); assert.ok(exists(".title-input .popup-tip.good"), "the title is now good");
await fillIn(".d-editor-input", "this is the *content* of a post"); await fillIn(".d-editor-input", "this is the *content* of a post");
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview").html().trim(), queryAll(".d-editor-preview").html().trim(),
"<p>this is the <em>content</em> of a post</p>", "<p>this is the <em>content</em> of a post</p>",
"it previews content" "it previews content"
@@ -109,7 +109,7 @@ acceptance("Composer", function (needs) {
run(() => textarea.dispatchEvent(event)); run(() => textarea.dispatchEvent(event));
const example = I18n.t(`composer.bold_text`); const example = I18n.t(`composer.bold_text`);
assert.equal( assert.strictEqual(
queryAll("#reply-control .d-editor-input").val().trim(), queryAll("#reply-control .d-editor-input").val().trim(),
`this is the *content* of a post**${example}**`, `this is the *content* of a post**${example}**`,
"it supports keyboard shortcuts" "it supports keyboard shortcuts"
@@ -143,7 +143,7 @@ acceptance("Composer", function (needs) {
"this is the *content* of a new topic post" "this is the *content* of a new topic post"
); );
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/t/internationalization-localization/280", "/t/internationalization-localization/280",
"it transitions to the newly created topic URL" "it transitions to the newly created topic URL"
@@ -157,7 +157,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", "enqueue this content please"); await fillIn(".d-editor-input", "enqueue this content please");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.ok(visible(".d-modal"), "it pops up a modal"); assert.ok(visible(".d-modal"), "it pops up a modal");
assert.equal(currentURL(), "/", "it doesn't change routes"); assert.strictEqual(currentURL(), "/", "it doesn't change routes");
await click(".modal-footer button"); await click(".modal-footer button");
assert.ok(invisible(".d-modal"), "the modal can be dismissed"); assert.ok(invisible(".d-modal"), "the modal can be dismissed");
@@ -169,14 +169,14 @@ acceptance("Composer", function (needs) {
await fillIn("#reply-title", "This title doesn't matter"); await fillIn("#reply-title", "This title doesn't matter");
await fillIn(".d-editor-input", "custom message"); await fillIn(".d-editor-input", "custom message");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").text(), queryAll(".bootbox .modal-body").text(),
"This is a custom response" "This is a custom response"
); );
assert.equal(currentURL(), "/", "it doesn't change routes"); assert.strictEqual(currentURL(), "/", "it doesn't change routes");
await click(".bootbox .btn-primary"); await click(".bootbox .btn-primary");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/faq", "/faq",
"can navigate to a `route_to` destination" "can navigate to a `route_to` destination"
@@ -200,7 +200,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", "this is the content of my reply"); await fillIn(".d-editor-input", "this is the content of my reply");
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.equal( assert.strictEqual(
queryAll(".cooked:last p").text(), queryAll(".cooked:last p").text(),
"If you use gettext format you could leverage Launchpad 13 translations and the community behind it." "If you use gettext format you could leverage Launchpad 13 translations and the community behind it."
); );
@@ -217,7 +217,7 @@ acceptance("Composer", function (needs) {
await click(".modal-footer button.keep-editing"); await click(".modal-footer button.keep-editing");
assert.ok(invisible(".discard-draft-modal.modal")); assert.ok(invisible(".discard-draft-modal.modal"));
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"this is the content of my reply", "this is the content of my reply",
"composer does not switch when using Keep Editing button" "composer does not switch when using Keep Editing button"
@@ -227,7 +227,7 @@ acceptance("Composer", function (needs) {
await click(".modal-footer button.save-draft"); await click(".modal-footer button.save-draft");
assert.ok(invisible(".discard-draft-modal.modal")); assert.ok(invisible(".discard-draft-modal.modal"));
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
queryAll(".topic-post:nth-of-type(1) .cooked > p").text(), queryAll(".topic-post:nth-of-type(1) .cooked > p").text(),
"composer has contents of post to be edited" "composer has contents of post to be edited"
@@ -243,12 +243,15 @@ acceptance("Composer", function (needs) {
); );
await visit("/t/1-3-0beta9-no-rate-limit-popups/28830"); await visit("/t/1-3-0beta9-no-rate-limit-popups/28830");
assert.equal(currentURL(), "/t/1-3-0beta9-no-rate-limit-popups/28830"); assert.strictEqual(
currentURL(),
"/t/1-3-0beta9-no-rate-limit-popups/28830"
);
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.ok(visible(".reply-where-modal"), "it pops up a modal"); assert.ok(visible(".reply-where-modal"), "it pops up a modal");
await click(".btn-reply-here"); await click(".btn-reply-here");
assert.equal( assert.strictEqual(
queryAll(".cooked:last p").text(), queryAll(".cooked:last p").text(),
"If you use gettext format you could leverage Launchpad 13 translations and the community behind it." "If you use gettext format you could leverage Launchpad 13 translations and the community behind it."
); );
@@ -260,7 +263,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", "this is the content of the first reply"); await fillIn(".d-editor-input", "this is the content of the first reply");
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
assert.equal(currentURL(), "/t/this-is-a-test-topic/9"); assert.strictEqual(currentURL(), "/t/this-is-a-test-topic/9");
await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
assert.ok( assert.ok(
exists(".discard-draft-modal.modal"), exists(".discard-draft-modal.modal"),
@@ -278,7 +281,7 @@ acceptance("Composer", function (needs) {
await click(".modal-footer button.discard-draft"); await click(".modal-footer button.discard-draft");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"", "",
"discards draft and reset composer textarea" "discards draft and reset composer textarea"
@@ -322,7 +325,7 @@ acceptance("Composer", function (needs) {
await click(".topic-post:nth-of-type(1) button.show-more-actions"); await click(".topic-post:nth-of-type(1) button.show-more-actions");
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("Any plans to support"), queryAll(".d-editor-input").val().indexOf("Any plans to support"),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -369,11 +372,11 @@ acceptance("Composer", function (needs) {
await promise; await promise;
// at this point, request is in flight, so post is staged // at this point, request is in flight, so post is staged
assert.equal(count(".topic-post.staged"), 1); assert.strictEqual(count(".topic-post.staged"), 1);
assert.ok( assert.ok(
find(".topic-post:nth-of-type(1)")[0].className.includes("staged") find(".topic-post:nth-of-type(1)")[0].className.includes("staged")
); );
assert.equal( assert.strictEqual(
find(".topic-post.staged .cooked").text().trim(), find(".topic-post.staged .cooked").text().trim(),
"will return empty json" "will return empty json"
); );
@@ -382,7 +385,7 @@ acceptance("Composer", function (needs) {
window.resolveLastPromise(); window.resolveLastPromise();
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
assert.equal(count(".topic-post.staged"), 0); assert.strictEqual(count(".topic-post.staged"), 0);
}); });
QUnit.skip( QUnit.skip(
@@ -397,7 +400,7 @@ acceptance("Composer", function (needs) {
await click("#reply-control button.create"); await click("#reply-control button.create");
assert.ok(!exists(".topic-post.staged")); assert.ok(!exists(".topic-post.staged"));
assert.equal( assert.strictEqual(
find(".topic-post .cooked")[0].innerText, find(".topic-post .cooked")[0].innerText,
"Any plans to support localization of UI elements, so that I (for example) could set up a completely German speaking forum?" "Any plans to support localization of UI elements, so that I (for example) could set up a completely German speaking forum?"
); );
@@ -410,13 +413,13 @@ acceptance("Composer", function (needs) {
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the first post."), queryAll(".d-editor-input").val().indexOf("This is the first post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
); );
await click(".topic-post:nth-of-type(2) button.edit"); await click(".topic-post:nth-of-type(2) button.edit");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the second post."), queryAll(".d-editor-input").val().indexOf("This is the second post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -435,7 +438,7 @@ acceptance("Composer", function (needs) {
); );
await click(".modal-footer button.discard-draft"); await click(".modal-footer button.discard-draft");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the second post."), queryAll(".d-editor-input").val().indexOf("This is the second post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -446,15 +449,19 @@ acceptance("Composer", function (needs) {
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the first post."), queryAll(".d-editor-input").val().indexOf("This is the first post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
); );
await click(".topic-post:nth-of-type(1) button.reply"); await click(".topic-post:nth-of-type(1) button.reply");
assert.equal(queryAll(".d-editor-input").val(), "", "it clears the input"); assert.strictEqual(
queryAll(".d-editor-input").val(),
"",
"it clears the input"
);
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the first post."), queryAll(".d-editor-input").val().indexOf("This is the first post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -470,7 +477,7 @@ acceptance("Composer", function (needs) {
await menu.expand(); await menu.expand();
await menu.selectRowByValue("toggleWhisper"); await menu.selectRowByValue("toggleWhisper");
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-far-eye-slash"), count(".composer-actions svg.d-icon-far-eye-slash"),
1, 1,
"it sets the post type to whisper" "it sets the post type to whisper"
@@ -501,7 +508,7 @@ acceptance("Composer", function (needs) {
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
await click(".topic-post:nth-of-type(1) button.reply"); await click(".topic-post:nth-of-type(1) button.reply");
assert.equal( assert.strictEqual(
count("#reply-control.open"), count("#reply-control.open"),
1, 1,
"it starts in open state by default" "it starts in open state by default"
@@ -509,7 +516,7 @@ acceptance("Composer", function (needs) {
await click(".toggle-fullscreen"); await click(".toggle-fullscreen");
assert.equal( assert.strictEqual(
count("#reply-control.fullscreen"), count("#reply-control.fullscreen"),
1, 1,
"it expands composer to full screen" "it expands composer to full screen"
@@ -517,7 +524,7 @@ acceptance("Composer", function (needs) {
await click(".toggle-fullscreen"); await click(".toggle-fullscreen");
assert.equal( assert.strictEqual(
count("#reply-control.open"), count("#reply-control.open"),
1, 1,
"it collapses composer to regular size" "it collapses composer to regular size"
@@ -526,7 +533,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", "This is a dirty reply"); await fillIn(".d-editor-input", "This is a dirty reply");
await click(".toggler"); await click(".toggler");
assert.equal( assert.strictEqual(
count("#reply-control.draft"), count("#reply-control.draft"),
1, 1,
"it collapses composer to draft bar" "it collapses composer to draft bar"
@@ -534,7 +541,7 @@ acceptance("Composer", function (needs) {
await click(".toggle-fullscreen"); await click(".toggle-fullscreen");
assert.equal( assert.strictEqual(
count("#reply-control.open"), count("#reply-control.open"),
1, 1,
"from draft, it expands composer back to open state" "from draft, it expands composer back to open state"
@@ -550,7 +557,7 @@ acceptance("Composer", function (needs) {
"toggleWhisper" "toggleWhisper"
); );
assert.equal( assert.strictEqual(
count(".composer-actions svg.d-icon-far-eye-slash"), count(".composer-actions svg.d-icon-far-eye-slash"),
1, 1,
"it sets the post type to whisper" "it sets the post type to whisper"
@@ -597,7 +604,7 @@ acceptance("Composer", function (needs) {
"it pops up a confirmation dialog" "it pops up a confirmation dialog"
); );
await click(".modal-footer button.discard-draft"); await click(".modal-footer button.discard-draft");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the first post."), queryAll(".d-editor-input").val().indexOf("This is the first post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -615,18 +622,18 @@ acceptance("Composer", function (needs) {
exists(".discard-draft-modal.modal"), exists(".discard-draft-modal.modal"),
"it pops up a confirmation dialog" "it pops up a confirmation dialog"
); );
assert.equal( assert.strictEqual(
queryAll(".modal-footer button.save-draft").text().trim(), queryAll(".modal-footer button.save-draft").text().trim(),
I18n.t("post.cancel_composer.save_draft"), I18n.t("post.cancel_composer.save_draft"),
"has save draft button" "has save draft button"
); );
assert.equal( assert.strictEqual(
queryAll(".modal-footer button.keep-editing").text().trim(), queryAll(".modal-footer button.keep-editing").text().trim(),
I18n.t("post.cancel_composer.keep_editing"), I18n.t("post.cancel_composer.keep_editing"),
"has keep editing button" "has keep editing button"
); );
await click(".modal-footer button.save-draft"); await click(".modal-footer button.save-draft");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().indexOf("This is the second post."), queryAll(".d-editor-input").val().indexOf("This is the second post."),
0, 0,
"it populates the input with the post text" "it populates the input with the post text"
@@ -646,18 +653,18 @@ acceptance("Composer", function (needs) {
exists(".discard-draft-modal.modal"), exists(".discard-draft-modal.modal"),
"it pops up a confirmation dialog" "it pops up a confirmation dialog"
); );
assert.equal( assert.strictEqual(
queryAll(".modal-footer button.save-draft").text().trim(), queryAll(".modal-footer button.save-draft").text().trim(),
I18n.t("post.cancel_composer.save_draft"), I18n.t("post.cancel_composer.save_draft"),
"has save draft button" "has save draft button"
); );
assert.equal( assert.strictEqual(
queryAll(".modal-footer button.keep-editing").text().trim(), queryAll(".modal-footer button.keep-editing").text().trim(),
I18n.t("post.cancel_composer.keep_editing"), I18n.t("post.cancel_composer.keep_editing"),
"has keep editing button" "has keep editing button"
); );
await click(".modal-footer button.save-draft"); await click(".modal-footer button.save-draft");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"", "",
"it clears the composer input" "it clears the composer input"
@@ -673,7 +680,7 @@ acceptance("Composer", function (needs) {
await click(".topic-post:nth-of-type(1) button.show-more-actions"); await click(".topic-post:nth-of-type(1) button.show-more-actions");
await click(".topic-post:nth-of-type(1) button.edit"); await click(".topic-post:nth-of-type(1) button.edit");
assert.equal( assert.strictEqual(
queryAll(".modal-body").text(), queryAll(".modal-body").text(),
I18n.t("drafts.abandon.confirm") I18n.t("drafts.abandon.confirm")
); );
@@ -752,7 +759,7 @@ acceptance("Composer", function (needs) {
await click(".modal .btn-default"); await click(".modal .btn-default");
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal(privateMessageUsers.header().value(), "codinghorror"); assert.strictEqual(privateMessageUsers.header().value(), "codinghorror");
} finally { } finally {
toggleCheckDraftPopup(false); toggleCheckDraftPopup(false);
} }
@@ -771,14 +778,17 @@ acceptance("Composer", function (needs) {
); );
await visit("/latest"); await visit("/latest");
assert.equal( assert.strictEqual(
queryAll("#create-topic").text().trim(), queryAll("#create-topic").text().trim(),
I18n.t("topic.open_draft") I18n.t("topic.open_draft")
); );
await click("#create-topic"); await click("#create-topic");
assert.equal(selectKit(".category-chooser").header().value(), "2"); assert.strictEqual(selectKit(".category-chooser").header().value(), "2");
assert.equal(selectKit(".mini-tag-chooser").header().value(), "fun,times"); assert.strictEqual(
selectKit(".mini-tag-chooser").header().value(),
"fun,times"
);
}); });
test("Deleting the text content of the first post in a private message", async function (assert) { test("Deleting the text content of the first post in a private message", async function (assert) {
@@ -790,7 +800,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", ""); await fillIn(".d-editor-input", "");
assert.equal( assert.strictEqual(
queryAll(".d-editor-container textarea").attr("placeholder"), queryAll(".d-editor-container textarea").attr("placeholder"),
I18n.t("composer.reply_placeholder"), I18n.t("composer.reply_placeholder"),
"it should not block because of missing category" "it should not block because of missing category"
@@ -798,7 +808,7 @@ acceptance("Composer", function (needs) {
}); });
const assertImageResized = (assert, uploads) => { const assertImageResized = (assert, uploads) => {
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
uploads.join("\n"), uploads.join("\n"),
"it resizes uploaded image" "it resizes uploaded image"
@@ -808,12 +818,12 @@ acceptance("Composer", function (needs) {
test("reply button has envelope icon when replying to private message", async function (assert) { test("reply button has envelope icon when replying to private message", async function (assert) {
await visit("/t/34"); await visit("/t/34");
await click("article#post_3 button.reply"); await click("article#post_3 button.reply");
assert.equal( assert.strictEqual(
queryAll(".save-or-cancel button.create").text().trim(), queryAll(".save-or-cancel button.create").text().trim(),
I18n.t("composer.create_pm"), I18n.t("composer.create_pm"),
"reply button says Message" "reply button says Message"
); );
assert.equal( assert.strictEqual(
count(".save-or-cancel button.create svg.d-icon-envelope"), count(".save-or-cancel button.create svg.d-icon-envelope"),
1, 1,
"reply button has envelope icon" "reply button has envelope icon"
@@ -825,12 +835,12 @@ acceptance("Composer", function (needs) {
await click("article#post_3 button.show-more-actions"); await click("article#post_3 button.show-more-actions");
await click("article#post_3 button.edit"); await click("article#post_3 button.edit");
assert.equal( assert.strictEqual(
queryAll(".save-or-cancel button.create").text().trim(), queryAll(".save-or-cancel button.create").text().trim(),
I18n.t("composer.save_edit"), I18n.t("composer.save_edit"),
"save button says Save Edit" "save button says Save Edit"
); );
assert.equal( assert.strictEqual(
count(".save-or-cancel button.create svg.d-icon-pencil-alt"), count(".save-or-cancel button.create svg.d-icon-pencil-alt"),
1, 1,
"save button has pencil icon" "save button has pencil icon"
@@ -871,7 +881,7 @@ acceptance("Composer", function (needs) {
await fillIn(".d-editor-input", uploads.join("\n")); await fillIn(".d-editor-input", uploads.join("\n"));
assert.equal( assert.strictEqual(
count(".button-wrapper"), count(".button-wrapper"),
10, 10,
"it adds correct amount of scaling button groups" "it adds correct amount of scaling button groups"
@@ -981,7 +991,7 @@ acceptance("Composer", function (needs) {
assert.ok(!exists(".composer-popup")); assert.ok(!exists(".composer-popup"));
await fillIn(".d-editor-input", "[](https://github.com)"); await fillIn(".d-editor-input", "[](https://github.com)");
assert.equal(count(".composer-popup"), 1); assert.strictEqual(count(".composer-popup"), 1);
}); });
test("Shows the 'group_mentioned' notice", async function (assert) { test("Shows the 'group_mentioned' notice", async function (assert) {
@@ -1042,16 +1052,19 @@ acceptance("Composer - Customizations", function (needs) {
test("Supports text customization", async function (assert) { test("Supports text customization", async function (assert) {
await visit("/"); await visit("/");
await click("#create-topic"); await click("#create-topic");
assert.equal(query(".action-title").innerText, I18n.t("topic.create_long")); assert.strictEqual(
assert.equal( query(".action-title").innerText,
I18n.t("topic.create_long")
);
assert.strictEqual(
query(".save-or-cancel button").innerText, query(".save-or-cancel button").innerText,
I18n.t("composer.create_topic") I18n.t("composer.create_topic")
); );
const tags = selectKit(".mini-tag-chooser"); const tags = selectKit(".mini-tag-chooser");
await tags.expand(); await tags.expand();
await tags.selectRowByValue("monkey"); await tags.selectRowByValue("monkey");
assert.equal(query(".action-title").innerText, "custom text"); assert.strictEqual(query(".action-title").innerText, "custom text");
assert.equal( assert.strictEqual(
query(".save-or-cancel button").innerText, query(".save-or-cancel button").innerText,
I18n.t("composer.emoji") I18n.t("composer.emoji")
); );

View File

@@ -26,7 +26,7 @@ acceptance("Composer topic featured links", function (needs) {
exists(".d-editor-textarea-wrapper .popup-tip.good"), exists(".d-editor-textarea-wrapper .popup-tip.good"),
"the body is now good" "the body is now good"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"An interesting article", "An interesting article",
"title is from the oneboxed article" "title is from the oneboxed article"
@@ -45,7 +45,7 @@ acceptance("Composer topic featured links", function (needs) {
exists(".d-editor-textarea-wrapper .popup-tip.good"), exists(".d-editor-textarea-wrapper .popup-tip.good"),
"the body is now good" "the body is now good"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"http://www.example.com/no-title.html", "http://www.example.com/no-title.html",
"title is unchanged" "title is unchanged"
@@ -56,7 +56,7 @@ acceptance("Composer topic featured links", function (needs) {
await visit("/"); await visit("/");
await click("#create-topic"); await click("#create-topic");
await fillIn("#reply-title", "https://www.youtube.com/watch?v=dQw4w9WgXcQ"); await fillIn("#reply-title", "https://www.youtube.com/watch?v=dQw4w9WgXcQ");
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"Rick Astley - Never Gonna Give You Up (Video)", "Rick Astley - Never Gonna Give You Up (Video)",
"title is from the oneboxed article" "title is from the oneboxed article"
@@ -75,7 +75,7 @@ acceptance("Composer topic featured links", function (needs) {
exists(".d-editor-textarea-wrapper .popup-tip.good"), exists(".d-editor-textarea-wrapper .popup-tip.good"),
"link is pasted into body" "link is pasted into body"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"http://www.example.com/nope-onebox.html", "http://www.example.com/nope-onebox.html",
"title is unchanged" "title is unchanged"
@@ -87,17 +87,17 @@ acceptance("Composer topic featured links", function (needs) {
await click("#create-topic"); await click("#create-topic");
const title = "http://" + window.location.hostname + "/internal-page.html"; const title = "http://" + window.location.hostname + "/internal-page.html";
await fillIn("#reply-title", title); await fillIn("#reply-title", title);
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview").html().trim().indexOf("onebox"), queryAll(".d-editor-preview").html().trim().indexOf("onebox"),
-1, -1,
"onebox preview doesn't show" "onebox preview doesn't show"
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().length, queryAll(".d-editor-input").val().length,
0, 0,
"link isn't put into the post" "link isn't put into the post"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
title, title,
"title is unchanged" "title is unchanged"
@@ -119,7 +119,7 @@ acceptance("Composer topic featured links", function (needs) {
exists(".d-editor-textarea-wrapper .popup-tip.good"), exists(".d-editor-textarea-wrapper .popup-tip.good"),
"the body is now good" "the body is now good"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"An interesting article", "An interesting article",
"title is from the oneboxed article" "title is from the oneboxed article"
@@ -130,17 +130,17 @@ acceptance("Composer topic featured links", function (needs) {
await visit("/"); await visit("/");
await click("#create-topic"); await click("#create-topic");
await fillIn("#reply-title", "http://www.example.com/has-title.html test"); await fillIn("#reply-title", "http://www.example.com/has-title.html test");
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview").html().trim().indexOf("onebox"), queryAll(".d-editor-preview").html().trim().indexOf("onebox"),
-1, -1,
"onebox preview doesn't show" "onebox preview doesn't show"
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().length, queryAll(".d-editor-input").val().length,
0, 0,
"link isn't put into the post" "link isn't put into the post"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"http://www.example.com/has-title.html test", "http://www.example.com/has-title.html test",
"title is unchanged" "title is unchanged"
@@ -193,7 +193,7 @@ acceptance(
exists(".d-editor-textarea-wrapper .popup-tip.good"), exists(".d-editor-textarea-wrapper .popup-tip.good"),
"the body is now good" "the body is now good"
); );
assert.equal( assert.strictEqual(
queryAll(".title-input input").val(), queryAll(".title-input input").val(),
"An interesting article", "An interesting article",
"title is from the oneboxed article" "title is from the oneboxed article"

View File

@@ -71,7 +71,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
const done = assert.async(); const done = assert.async();
appEvents.on("composer:all-uploads-complete", () => { appEvents.on("composer:all-uploads-complete", () => {
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n![avatar.PNG|690x320](upload://yoj8pf9DdIeHRRULyw7i57GAYdz.jpeg)\n" "The image:\n![avatar.PNG|690x320](upload://yoj8pf9DdIeHRRULyw7i57GAYdz.jpeg)\n"
); );
@@ -79,7 +79,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
}); });
appEvents.on("composer:upload-started", () => { appEvents.on("composer:upload-started", () => {
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"The image:\n[Uploading: avatar.png...]()\n" "The image:\n[Uploading: avatar.png...]()\n"
); );
@@ -98,7 +98,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
const image2 = createFile("avatar2.png"); const image2 = createFile("avatar2.png");
const done = assert.async(); const done = assert.async();
appEvents.on("composer:uploads-aborted", async () => { appEvents.on("composer:uploads-aborted", async () => {
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
I18n.t("post.errors.too_many_dragged_and_dropped_files", { I18n.t("post.errors.too_many_dragged_and_dropped_files", {
count: 2, count: 2,
@@ -122,7 +122,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
const done = assert.async(); const done = assert.async();
appEvents.on("composer:uploads-aborted", async () => { appEvents.on("composer:uploads-aborted", async () => {
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
I18n.t("post.errors.upload_not_authorized", { I18n.t("post.errors.upload_not_authorized", {
authorized_extensions: authorizedExtensions( authorized_extensions: authorizedExtensions(
@@ -153,7 +153,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
// const done = assert.async(); // const done = assert.async();
// appEvents.on("composer:uploads-cancelled", () => { // appEvents.on("composer:uploads-cancelled", () => {
// assert.equal( // assert.strictEqual(
// queryAll(".d-editor-input").val(), // queryAll(".d-editor-input").val(),
// "The image:\n", // "The image:\n",
// "it should clear the cancelled placeholders" // "it should clear the cancelled placeholders"
@@ -166,7 +166,7 @@ acceptance("Uppy Composer Attachment - Upload Placeholder", function (needs) {
// uploadStarted++; // uploadStarted++;
// if (uploadStarted === 2) { // if (uploadStarted === 2) {
// assert.equal( // assert.strictEqual(
// queryAll(".d-editor-input").val(), // queryAll(".d-editor-input").val(),
// "The image:\n[Uploading: avatar.png...]()\n[Uploading: avatar2.png...]()\n", // "The image:\n[Uploading: avatar.png...]()\n[Uploading: avatar2.png...]()\n",
// "it should show the upload placeholders when the upload starts" // "it should show the upload placeholders when the upload starts"
@@ -209,7 +209,7 @@ acceptance("Uppy Composer Attachment - Upload Error", function (needs) {
const done = assert.async(); const done = assert.async();
appEvents.on("composer:upload-error", async () => { appEvents.on("composer:upload-error", async () => {
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
"There was an error uploading the file, the gif was way too cool.", "There was an error uploading the file, the gif was way too cool.",
"it should show the error message from the server" "it should show the error message from the server"
@@ -248,7 +248,7 @@ acceptance("Uppy Composer Attachment - Upload Handler", function (needs) {
const done = assert.async(); const done = assert.async();
appEvents.on("composer:uploads-aborted", async () => { appEvents.on("composer:uploads-aborted", async () => {
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
"This is an upload handler test for handlertest.png", "This is an upload handler test for handlertest.png",
"it should show the bootbox triggered by the upload handler" "it should show the bootbox triggered by the upload handler"

View File

@@ -38,7 +38,7 @@ acceptance("Create Account - User Fields", function (needs) {
assert.ok(exists(".user-field"), "it has at least one user field"); assert.ok(exists(".user-field"), "it has at least one user field");
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.equal( assert.strictEqual(
query("#account-email-validation").innerText.trim(), query("#account-email-validation").innerText.trim(),
"Please enter an email address" "Please enter an email address"
); );

View File

@@ -52,7 +52,7 @@ acceptance("Invites - Create & Edit Invite Modal", function (needs) {
test("basic functionality", async function (assert) { test("basic functionality", async function (assert) {
await visit("/u/eviltrout/invited/pending"); await visit("/u/eviltrout/invited/pending");
await click(".user-invite-buttons .btn:first-child"); await click(".user-invite-buttons .btn:first-child");
assert.equal( assert.strictEqual(
find("input.invite-link")[0].value, find("input.invite-link")[0].value,
"http://example.com/invites/52641ae8878790bc7b79916247cfe6ba", "http://example.com/invites/52641ae8878790bc7b79916247cfe6ba",
"shows an invite link when modal is opened" "shows an invite link when modal is opened"
@@ -75,7 +75,11 @@ acceptance("Invites - Create & Edit Invite Modal", function (needs) {
await click(".btn-primary"); await click(".btn-primary");
assert.equal(count("tbody tr"), 1, "adds invite to list after saving"); assert.strictEqual(
count("tbody tr"),
1,
"adds invite to list after saving"
);
await click(".modal-close"); await click(".modal-close");
assert.notOk(deleted, "does not delete invite on close"); assert.notOk(deleted, "does not delete invite on close");
@@ -97,7 +101,7 @@ acceptance("Invites - Create & Edit Invite Modal", function (needs) {
await fillIn("#invite-email", "error"); await fillIn("#invite-email", "error");
await click(".invite-link .btn"); await click(".invite-link .btn");
assert.equal( assert.strictEqual(
find("#modal-alert").text(), find("#modal-alert").text(),
"error isn't a valid email address." "error isn't a valid email address."
); );

View File

@@ -18,7 +18,7 @@ acceptance("CustomHTML set", function () {
setCustomHTML("top", '<span class="custom-html-test">HTML</span>'); setCustomHTML("top", '<span class="custom-html-test">HTML</span>');
await visit("/static/faq"); await visit("/static/faq");
assert.equal( assert.strictEqual(
queryAll("span.custom-html-test").text(), queryAll("span.custom-html-test").text(),
"HTML", "HTML",
"it inserted the markup" "it inserted the markup"
@@ -31,7 +31,7 @@ acceptance("CustomHTML set", function () {
}); });
await visit("/static/faq"); await visit("/static/faq");
assert.equal( assert.strictEqual(
queryAll("span.cookie").text(), queryAll("span.cookie").text(),
"monster", "monster",
"it inserted the markup" "it inserted the markup"

View File

@@ -14,7 +14,7 @@ acceptance("CustomHTML template", function (needs) {
test("renders custom template", async function (assert) { test("renders custom template", async function (assert) {
await visit("/static/faq"); await visit("/static/faq");
assert.equal( assert.strictEqual(
queryAll("span.top-span").text(), queryAll("span.top-span").text(),
"TOP", "TOP",
"it inserted the template" "it inserted the template"

View File

@@ -58,7 +58,7 @@ acceptance("Dashboard", function (needs) {
"new-contributors report" "new-contributors report"
); );
assert.equal( assert.strictEqual(
$(".section.dashboard-problems .problem-messages ul li:first-child") $(".section.dashboard-problems .problem-messages ul li:first-child")
.html() .html()
.trim(), .trim(),
@@ -80,7 +80,7 @@ acceptance("Dashboard", function (needs) {
await visit("/admin"); await visit("/admin");
await click(".dashboard .navigation-item.reports .navigation-link"); await click(".dashboard .navigation-item.reports .navigation-link");
assert.equal( assert.strictEqual(
queryAll(".dashboard .reports-index.section .reports-list .report") queryAll(".dashboard .reports-index.section .reports-list .report")
.length, .length,
1 1
@@ -88,7 +88,7 @@ acceptance("Dashboard", function (needs) {
await fillIn(".dashboard .filter-reports-input", "flags"); await fillIn(".dashboard .filter-reports-input", "flags");
assert.equal( assert.strictEqual(
queryAll(".dashboard .reports-index.section .reports-list .report") queryAll(".dashboard .reports-index.section .reports-list .report")
.length, .length,
0 0
@@ -97,7 +97,7 @@ acceptance("Dashboard", function (needs) {
await click(".dashboard .navigation-item.security .navigation-link"); await click(".dashboard .navigation-item.security .navigation-link");
await click(".dashboard .navigation-item.reports .navigation-link"); await click(".dashboard .navigation-item.reports .navigation-link");
assert.equal( assert.strictEqual(
queryAll(".dashboard .reports-index.section .reports-list .report") queryAll(".dashboard .reports-index.section .reports-list .report")
.length, .length,
1, 1,
@@ -106,7 +106,7 @@ acceptance("Dashboard", function (needs) {
await fillIn(".dashboard .filter-reports-input", "activities"); await fillIn(".dashboard .filter-reports-input", "activities");
assert.equal( assert.strictEqual(
queryAll(".dashboard .reports-index.section .reports-list .report") queryAll(".dashboard .reports-index.section .reports-list .report")
.length, .length,
1, 1,
@@ -121,9 +121,9 @@ acceptance("Dashboard", function (needs) {
const groupFilter = selectKit(".group-filter .combo-box"); const groupFilter = selectKit(".group-filter .combo-box");
assert.equal( assert.strictEqual(
groupFilter.header().value(), groupFilter.header().value(),
88, "88",
"its set the value of the filter from the query params" "its set the value of the filter from the query params"
); );
}); });

View File

@@ -56,7 +56,10 @@ acceptance("Do not disturb", function (needs) {
await visit("/"); await visit("/");
await click(".header-dropdown-toggle.current-user"); await click(".header-dropdown-toggle.current-user");
await click(".menu-links-row .user-preferences-link"); await click(".menu-links-row .user-preferences-link");
assert.equal(query(".do-not-disturb .relative-date").textContent, "1h"); assert.strictEqual(
query(".do-not-disturb .relative-date").textContent,
"1h"
);
await click(".do-not-disturb"); await click(".do-not-disturb");

View File

@@ -43,12 +43,12 @@ acceptance("Edit Notification Click", function (needs) {
await click(".d-header-icons #current-user"); await click(".d-header-icons #current-user");
await click("#quick-access-notifications .edited"); await click("#quick-access-notifications .edited");
const [v1, v2] = queryAll(".history-modal .revision-content"); const [v1, v2] = queryAll(".history-modal .revision-content");
assert.equal( assert.strictEqual(
v1.textContent.trim(), v1.textContent.trim(),
"Hello world this is a test", "Hello world this is a test",
"history modal for the edited post is shown" "history modal for the edited post is shown"
); );
assert.equal( assert.strictEqual(
v2.textContent.trim(), v2.textContent.trim(),
"Hello world this is a testThis is an edit!", "Hello world this is a testThis is an edit!",
"history modal for the edited post is shown" "history modal for the edited post is shown"

View File

@@ -34,7 +34,7 @@ acceptance("EmojiPicker", function (needs) {
await click("button.emoji.btn"); await click("button.emoji.btn");
await click(".emoji-picker-emoji-area img.emoji[title='grinning']"); await click(".emoji-picker-emoji-area img.emoji[title='grinning']");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
":grinning:", ":grinning:",
"it adds the emoji code in the editor when selected" "it adds the emoji code in the editor when selected"
@@ -49,7 +49,7 @@ acceptance("EmojiPicker", function (needs) {
await fillIn(".d-editor-input", "This is a test input"); await fillIn(".d-editor-input", "This is a test input");
await click("button.emoji.btn"); await click("button.emoji.btn");
await click(".emoji-picker-emoji-area img.emoji[title='grinning']"); await click(".emoji-picker-emoji-area img.emoji[title='grinning']");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"This is a test input :grinning:", "This is a test input :grinning:",
"it adds the emoji code and a leading whitespace when there is text" "it adds the emoji code and a leading whitespace when there is text"
@@ -59,7 +59,7 @@ acceptance("EmojiPicker", function (needs) {
await fillIn(".d-editor-input", "This is a test input "); await fillIn(".d-editor-input", "This is a test input ");
await click(".emoji-picker-emoji-area img.emoji[title='grinning']"); await click(".emoji-picker-emoji-area img.emoji[title='grinning']");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val(), queryAll(".d-editor-input").val(),
"This is a test input :grinning:", "This is a test input :grinning:",
"it adds the emoji code and no leading whitespace when user already entered whitespace" "it adds the emoji code and no leading whitespace when user already entered whitespace"
@@ -111,14 +111,14 @@ acceptance("EmojiPicker", function (needs) {
await click(".emoji-picker-emoji-area img.emoji[title='sunglasses']"); await click(".emoji-picker-emoji-area img.emoji[title='sunglasses']");
await click(".emoji-picker-emoji-area img.emoji[title='grinning']"); await click(".emoji-picker-emoji-area img.emoji[title='grinning']");
assert.equal( assert.strictEqual(
queryAll('.section[data-section="recent"] .section-group img.emoji') queryAll('.section[data-section="recent"] .section-group img.emoji')
.length, .length,
2, 2,
"it has multiple recent emojis" "it has multiple recent emojis"
); );
assert.equal( assert.strictEqual(
/grinning/.test( /grinning/.test(
queryAll(".section.recent .section-group img.emoji").first().attr("src") queryAll(".section.recent .section-group img.emoji").first().attr("src")
), ),

View File

@@ -11,7 +11,7 @@ acceptance("Emoji", function (needs) {
await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
await fillIn(".d-editor-input", "this is an emoji :blonde_woman:"); await fillIn(".d-editor-input", "this is an emoji :blonde_woman:");
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
`<p>this is an emoji <img src="/images/emoji/google_classic/blonde_woman.png?v=${v}" title=":blonde_woman:" class="emoji" alt=":blonde_woman:"></p>` `<p>this is an emoji <img src="/images/emoji/google_classic/blonde_woman.png?v=${v}" title=":blonde_woman:" class="emoji" alt=":blonde_woman:"></p>`
); );
@@ -22,7 +22,7 @@ acceptance("Emoji", function (needs) {
await click("#topic-footer-buttons .btn.create"); await click("#topic-footer-buttons .btn.create");
await fillIn(".d-editor-input", "this is an emoji :blonde_woman:t5:"); await fillIn(".d-editor-input", "this is an emoji :blonde_woman:t5:");
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
`<p>this is an emoji <img src="/images/emoji/google_classic/blonde_woman/5.png?v=${v}" title=":blonde_woman:t5:" class="emoji" alt=":blonde_woman:t5:"></p>` `<p>this is an emoji <img src="/images/emoji/google_classic/blonde_woman/5.png?v=${v}" title=":blonde_woman:t5:" class="emoji" alt=":blonde_woman:t5:"></p>`
); );

View File

@@ -34,7 +34,7 @@ acceptance("Enforce Second Factor", function (needs) {
await catchAbortedTransition(); await catchAbortedTransition();
assert.equal( assert.strictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it will not transition from second-factor preferences" "it will not transition from second-factor preferences"
@@ -43,7 +43,7 @@ acceptance("Enforce Second Factor", function (needs) {
await click("#toggle-hamburger-menu"); await click("#toggle-hamburger-menu");
await click("a.admin-link"); await click("a.admin-link");
assert.equal( assert.strictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it stays at second-factor preferences" "it stays at second-factor preferences"
@@ -58,7 +58,7 @@ acceptance("Enforce Second Factor", function (needs) {
await catchAbortedTransition(); await catchAbortedTransition();
assert.equal( assert.strictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it will not transition from second-factor preferences" "it will not transition from second-factor preferences"
@@ -67,7 +67,7 @@ acceptance("Enforce Second Factor", function (needs) {
await click("#toggle-hamburger-menu"); await click("#toggle-hamburger-menu");
await click("a.about-link"); await click("a.about-link");
assert.equal( assert.strictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it stays at second-factor preferences" "it stays at second-factor preferences"
@@ -83,7 +83,7 @@ acceptance("Enforce Second Factor", function (needs) {
await catchAbortedTransition(); await catchAbortedTransition();
assert.notEqual( assert.notStrictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it will transition from second-factor preferences" "it will transition from second-factor preferences"
@@ -92,7 +92,7 @@ acceptance("Enforce Second Factor", function (needs) {
await click("#toggle-hamburger-menu"); await click("#toggle-hamburger-menu");
await click("a.about-link"); await click("a.about-link");
assert.notEqual( assert.notStrictEqual(
queryAll(".control-label").text(), queryAll(".control-label").text(),
"Password", "Password",
"it is possible to navigate to other pages" "it is possible to navigate to other pages"

View File

@@ -22,7 +22,7 @@ acceptance("Fast Edit", function (needs) {
await click(".quote-button .quote-edit-label"); await click(".quote-button .quote-edit-label");
assert.ok(exists("#fast-edit-input"), "fast editor is open"); assert.ok(exists("#fast-edit-input"), "fast editor is open");
assert.equal( assert.strictEqual(
queryAll("#fast-edit-input").val(), queryAll("#fast-edit-input").val(),
"Any plans", "Any plans",
"contains selected text" "contains selected text"
@@ -43,7 +43,7 @@ acceptance("Fast Edit", function (needs) {
await triggerKeyEvent(document, "keypress", "e".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "e".charCodeAt(0));
assert.ok(exists("#fast-edit-input"), "fast editor is open"); assert.ok(exists("#fast-edit-input"), "fast editor is open");
assert.equal( assert.strictEqual(
queryAll("#fast-edit-input").val(), queryAll("#fast-edit-input").val(),
"Any plans", "Any plans",
"contains selected text" "contains selected text"

View File

@@ -141,14 +141,14 @@ acceptance("flagging", function (needs) {
await silenceUntilCombobox.selectRowByValue("tomorrow"); await silenceUntilCombobox.selectRowByValue("tomorrow");
await fillIn(".silence-reason", "for breaking the rules"); await fillIn(".silence-reason", "for breaking the rules");
await click(".d-modal-cancel"); await click(".d-modal-cancel");
assert.equal(count(".bootbox.modal:visible"), 1); assert.strictEqual(count(".bootbox.modal:visible"), 1);
await click(".modal-footer .btn-default"); await click(".modal-footer .btn-default");
assert.ok(!exists(".bootbox.modal:visible")); assert.ok(!exists(".bootbox.modal:visible"));
assert.ok(exists(".silence-user-modal"), "it shows the silence modal"); assert.ok(exists(".silence-user-modal"), "it shows the silence modal");
await click(".d-modal-cancel"); await click(".d-modal-cancel");
assert.equal(count(".bootbox.modal:visible"), 1); assert.strictEqual(count(".bootbox.modal:visible"), 1);
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.ok(!exists(".bootbox.modal:visible")); assert.ok(!exists(".bootbox.modal:visible"));

View File

@@ -23,7 +23,7 @@ acceptance("Forgot password", function (needs) {
await click("header .login-button"); await click("header .login-button");
await click("#forgot-password-link"); await click("#forgot-password-link");
assert.equal( assert.strictEqual(
queryAll(".forgot-password-reset").attr("disabled"), queryAll(".forgot-password-reset").attr("disabled"),
"disabled", "disabled",
"it should disable the button until the field is filled" "it should disable the button until the field is filled"
@@ -32,7 +32,7 @@ acceptance("Forgot password", function (needs) {
await fillIn("#username-or-email", "someuser"); await fillIn("#username-or-email", "someuser");
await click(".forgot-password-reset"); await click(".forgot-password-reset");
assert.equal( assert.strictEqual(
queryAll(".alert-error").html().trim(), queryAll(".alert-error").html().trim(),
I18n.t("forgot_password.complete_username_not_found", { I18n.t("forgot_password.complete_username_not_found", {
username: "someuser", username: "someuser",
@@ -43,7 +43,7 @@ acceptance("Forgot password", function (needs) {
await fillIn("#username-or-email", "someuser@gmail.com"); await fillIn("#username-or-email", "someuser@gmail.com");
await click(".forgot-password-reset"); await click(".forgot-password-reset");
assert.equal( assert.strictEqual(
queryAll(".alert-error").html().trim(), queryAll(".alert-error").html().trim(),
I18n.t("forgot_password.complete_email_not_found", { I18n.t("forgot_password.complete_email_not_found", {
email: "someuser@gmail.com", email: "someuser@gmail.com",
@@ -62,7 +62,7 @@ acceptance("Forgot password", function (needs) {
"it should remove the flash error when succeeding" "it should remove the flash error when succeeding"
); );
assert.equal( assert.strictEqual(
queryAll(".modal-body").html().trim(), queryAll(".modal-body").html().trim(),
I18n.t("forgot_password.complete_username_found", { I18n.t("forgot_password.complete_username_found", {
username: "someuser", username: "someuser",
@@ -76,7 +76,7 @@ acceptance("Forgot password", function (needs) {
await fillIn("#username-or-email", "someuser@gmail.com"); await fillIn("#username-or-email", "someuser@gmail.com");
await click(".forgot-password-reset"); await click(".forgot-password-reset");
assert.equal( assert.strictEqual(
queryAll(".modal-body").html().trim(), queryAll(".modal-body").html().trim(),
I18n.t("forgot_password.complete_email_found", { I18n.t("forgot_password.complete_email_found", {
email: "someuser@gmail.com", email: "someuser@gmail.com",
@@ -100,7 +100,7 @@ acceptance(
await click("header .login-button"); await click("header .login-button");
await click("#forgot-password-link"); await click("#forgot-password-link");
assert.equal( assert.strictEqual(
queryAll(".forgot-password-reset").attr("disabled"), queryAll(".forgot-password-reset").attr("disabled"),
"disabled", "disabled",
"it should disable the button until the field is filled" "it should disable the button until the field is filled"
@@ -109,7 +109,7 @@ acceptance(
await fillIn("#username-or-email", "someuser"); await fillIn("#username-or-email", "someuser");
await click(".forgot-password-reset"); await click(".forgot-password-reset");
assert.equal( assert.strictEqual(
queryAll(".modal-body").html().trim(), queryAll(".modal-body").html().trim(),
I18n.t("forgot_password.complete_username", { I18n.t("forgot_password.complete_username", {
username: "someuser", username: "someuser",

View File

@@ -25,7 +25,7 @@ acceptance("Group Members - Anonymous", function () {
"it does not allow anon user to manage group members" "it does not allow anon user to manage group members"
); );
assert.equal( assert.strictEqual(
queryAll(".group-username-filter").attr("placeholder"), queryAll(".group-username-filter").attr("placeholder"),
I18n.t("groups.members.filter_placeholder"), I18n.t("groups.members.filter_placeholder"),
"it should display the right filter placeholder" "it should display the right filter placeholder"
@@ -48,7 +48,7 @@ acceptance("Group Members", function (needs) {
await visit("/g/discourse"); await visit("/g/discourse");
await click(".group-members-add"); await click(".group-members-add");
assert.equal( assert.strictEqual(
count(".user-chooser"), count(".user-chooser"),
1, 1,
"it should display the add members modal" "it should display the add members modal"
@@ -63,7 +63,7 @@ acceptance("Group Members", function (needs) {
"it allows admin user to manage group members" "it allows admin user to manage group members"
); );
assert.equal( assert.strictEqual(
queryAll(".group-username-filter").attr("placeholder"), queryAll(".group-username-filter").attr("placeholder"),
I18n.t("groups.members.filter_placeholder_admin"), I18n.t("groups.members.filter_placeholder_admin"),
"it should display the right filter placeholder" "it should display the right filter placeholder"

View File

@@ -23,7 +23,7 @@ acceptance("Managing Group Category Notification Defaults", function (needs) {
test("As an admin", async function (assert) { test("As an admin", async function (assert) {
await visit("/g/discourse/manage/categories"); await visit("/g/discourse/manage/categories");
assert.equal( assert.strictEqual(
count(".groups-notifications-form .category-selector"), count(".groups-notifications-form .category-selector"),
5, 5,
"it should display category inputs" "it should display category inputs"
@@ -35,7 +35,7 @@ acceptance("Managing Group Category Notification Defaults", function (needs) {
await visit("/g/discourse/manage/categories"); await visit("/g/discourse/manage/categories");
assert.equal( assert.strictEqual(
count(".groups-notifications-form .category-selector"), count(".groups-notifications-form .category-selector"),
5, 5,
"it should display category inputs" "it should display category inputs"

View File

@@ -17,7 +17,7 @@ acceptance("Managing Group Email Settings - SMTP Disabled", function (needs) {
query(".user-secondary-navigation").innerText.includes("Email"), query(".user-secondary-navigation").innerText.includes("Email"),
"email link is not shown in the sidebar" "email link is not shown in the sidebar"
); );
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"group.manage.profile", "group.manage.profile",
"it redirects to the group profile page" "it redirects to the group profile page"
@@ -37,7 +37,7 @@ acceptance(
query(".user-secondary-navigation").innerText.includes("Email"), query(".user-secondary-navigation").innerText.includes("Email"),
"email link is shown in the sidebar" "email link is shown in the sidebar"
); );
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"group.manage.email", "group.manage.email",
"it redirects to the group email page" "it redirects to the group email page"
@@ -84,12 +84,12 @@ acceptance(
assert.ok(exists(".group-smtp-email-settings")); assert.ok(exists(".group-smtp-email-settings"));
await click("#prefill_smtp_gmail"); await click("#prefill_smtp_gmail");
assert.equal( assert.strictEqual(
query("input[name='smtp_server']").value, query("input[name='smtp_server']").value,
"smtp.gmail.com", "smtp.gmail.com",
"prefills SMTP server settings for gmail" "prefills SMTP server settings for gmail"
); );
assert.equal( assert.strictEqual(
query("input[name='smtp_port']").value, query("input[name='smtp_port']").value,
"587", "587",
"prefills SMTP port settings for gmail" "prefills SMTP port settings for gmail"
@@ -112,7 +112,7 @@ acceptance(
await click(".group-manage-save"); await click(".group-manage-save");
assert.equal( assert.strictEqual(
query(".group-manage-save-button > span").innerText, query(".group-manage-save-button > span").innerText,
"Saved!" "Saved!"
); );
@@ -123,7 +123,7 @@ acceptance(
); );
await click("#enable_smtp"); await click("#enable_smtp");
assert.equal( assert.strictEqual(
query(".modal-body").innerText, query(".modal-body").innerText,
I18n.t("groups.manage.email.smtp_disable_confirm"), I18n.t("groups.manage.email.smtp_disable_confirm"),
"shows a confirm dialogue warning SMTP settings will be wiped" "shows a confirm dialogue warning SMTP settings will be wiped"
@@ -155,12 +155,12 @@ acceptance(
); );
await click("#prefill_imap_gmail"); await click("#prefill_imap_gmail");
assert.equal( assert.strictEqual(
query("input[name='imap_server']").value, query("input[name='imap_server']").value,
"imap.gmail.com", "imap.gmail.com",
"prefills IMAP server settings for gmail" "prefills IMAP server settings for gmail"
); );
assert.equal( assert.strictEqual(
query("input[name='imap_port']").value, query("input[name='imap_port']").value,
"993", "993",
"prefills IMAP port settings for gmail" "prefills IMAP port settings for gmail"
@@ -175,7 +175,7 @@ acceptance(
await click(".group-manage-save"); await click(".group-manage-save");
assert.equal( assert.strictEqual(
query(".group-manage-save-button > span").innerText, query(".group-manage-save-button > span").innerText,
"Saved!" "Saved!"
); );
@@ -199,7 +199,7 @@ acceptance(
); );
await click("#enable_imap"); await click("#enable_imap");
assert.equal( assert.strictEqual(
query(".modal-body").innerText, query(".modal-body").innerText,
I18n.t("groups.manage.email.imap_disable_confirm"), I18n.t("groups.manage.email.imap_disable_confirm"),
"shows a confirm dialogue warning IMAP settings will be wiped" "shows a confirm dialogue warning IMAP settings will be wiped"
@@ -277,38 +277,38 @@ acceptance(
assert.notOk(exists("#enable_smtp:disabled"), "SMTP is not disabled"); assert.notOk(exists("#enable_smtp:disabled"), "SMTP is not disabled");
assert.notOk(exists("#enable_imap:disabled"), "IMAP is not disabled"); assert.notOk(exists("#enable_imap:disabled"), "IMAP is not disabled");
assert.equal( assert.strictEqual(
query("[name='username']").value, query("[name='username']").value,
"test@test.com", "test@test.com",
"email username is prefilled" "email username is prefilled"
); );
assert.equal( assert.strictEqual(
query("[name='password']").value, query("[name='password']").value,
"password", "password",
"email password is prefilled" "email password is prefilled"
); );
assert.equal( assert.strictEqual(
query("[name='smtp_server']").value, query("[name='smtp_server']").value,
"smtp.gmail.com", "smtp.gmail.com",
"smtp server is prefilled" "smtp server is prefilled"
); );
assert.equal( assert.strictEqual(
query("[name='smtp_port']").value, query("[name='smtp_port']").value,
"587", "587",
"smtp port is prefilled" "smtp port is prefilled"
); );
assert.equal( assert.strictEqual(
query("[name='imap_server']").value, query("[name='imap_server']").value,
"imap.gmail.com", "imap.gmail.com",
"imap server is prefilled" "imap server is prefilled"
); );
assert.equal( assert.strictEqual(
query("[name='imap_port']").value, query("[name='imap_port']").value,
"993", "993",
"imap port is prefilled" "imap port is prefilled"
); );
assert.equal( assert.strictEqual(
selectKit("#imap_mailbox").header().value(), selectKit("#imap_mailbox").header().value(),
"INBOX", "INBOX",
"imap mailbox is prefilled" "imap mailbox is prefilled"
@@ -359,7 +359,7 @@ acceptance(
await fillIn('input[name="password"]', "password@gmail.com"); await fillIn('input[name="password"]', "password@gmail.com");
await click(".test-smtp-settings"); await click(".test-smtp-settings");
assert.equal( assert.strictEqual(
query(".modal-body").innerText, query(".modal-body").innerText,
"There was an issue with the SMTP credentials provided, check the username and password and try again.", "There was an issue with the SMTP credentials provided, check the username and password and try again.",
"shows a dialogue with the error message from the server" "shows a dialogue with the error message from the server"

View File

@@ -20,31 +20,31 @@ acceptance("Managing Group Interaction Settings", function (needs) {
await visit("/g/alternative-group/manage/interaction"); await visit("/g/alternative-group/manage/interaction");
assert.equal( assert.strictEqual(
count(".groups-form-visibility-level"), count(".groups-form-visibility-level"),
1, 1,
"it should display visibility level selector" "it should display visibility level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-mentionable-level"), count(".groups-form-mentionable-level"),
1, 1,
"it should display mentionable level selector" "it should display mentionable level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-messageable-level"), count(".groups-form-messageable-level"),
1, 1,
"it should display messageable level selector" "it should display messageable level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-incoming-email"), count(".groups-form-incoming-email"),
1, 1,
"it should display incoming email input" "it should display incoming email input"
); );
assert.equal( assert.strictEqual(
count(".groups-form-default-notification-level"), count(".groups-form-default-notification-level"),
1, 1,
"it should display default notification level input" "it should display default notification level input"
@@ -60,31 +60,31 @@ acceptance("Managing Group Interaction Settings", function (needs) {
await visit("/g/discourse/manage/interaction"); await visit("/g/discourse/manage/interaction");
assert.equal( assert.strictEqual(
count(".groups-form-visibility-level"), count(".groups-form-visibility-level"),
0, 0,
"it should not display visibility level selector" "it should not display visibility level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-mentionable-level"), count(".groups-form-mentionable-level"),
1, 1,
"it should display mentionable level selector" "it should display mentionable level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-messageable-level"), count(".groups-form-messageable-level"),
1, 1,
"it should display messageable level selector" "it should display messageable level selector"
); );
assert.equal( assert.strictEqual(
count(".groups-form-incoming-email"), count(".groups-form-incoming-email"),
0, 0,
"it should not display incoming email input" "it should not display incoming email input"
); );
assert.equal( assert.strictEqual(
count(".groups-form-default-notification-level"), count(".groups-form-default-notification-level"),
1, 1,
"it should display default notification level input" "it should display default notification level input"
@@ -101,7 +101,7 @@ acceptance(
await visit("/g/alternative-group/manage/interaction"); await visit("/g/alternative-group/manage/interaction");
await assert.ok(exists(".groups-form"), "should have the form"); await assert.ok(exists(".groups-form"), "should have the form");
await assert.equal( await assert.strictEqual(
selectKit(".groups-form-default-notification-level").header().value(), selectKit(".groups-form-default-notification-level").header().value(),
"0", "0",
"it should select Muted as the notification level" "it should select Muted as the notification level"
@@ -112,7 +112,7 @@ acceptance(
await visit("/g/discourse/manage/interaction"); await visit("/g/discourse/manage/interaction");
await assert.ok(exists(".groups-form"), "should have the form"); await assert.ok(exists(".groups-form"), "should have the form");
await assert.equal( await assert.strictEqual(
selectKit(".groups-form-default-notification-level").header().value(), selectKit(".groups-form-default-notification-level").header().value(),
"3", "3",
"it should select Watching as the notification level" "it should select Watching as the notification level"
@@ -123,7 +123,7 @@ acceptance(
await visit("/g/support/manage/interaction"); await visit("/g/support/manage/interaction");
await assert.ok(exists(".groups-form"), "should have the form"); await assert.ok(exists(".groups-form"), "should have the form");
await assert.equal( await assert.strictEqual(
selectKit(".groups-form-default-notification-level").header().value(), selectKit(".groups-form-default-notification-level").header().value(),
"2", "2",
"it should select Tracking as the notification level" "it should select Tracking as the notification level"

View File

@@ -99,14 +99,14 @@ acceptance("Group logs", function (needs) {
test("Browsing group logs", async function (assert) { test("Browsing group logs", async function (assert) {
await visit("/g/snorlax/manage/logs"); await visit("/g/snorlax/manage/logs");
assert.equal( assert.strictEqual(
count("tr.group-manage-logs-row"), count("tr.group-manage-logs-row"),
2, 2,
"it should display the right number of logs" "it should display the right number of logs"
); );
await click(query(".group-manage-logs-row button")); await click(query(".group-manage-logs-row button"));
assert.equal( assert.strictEqual(
count("tr.group-manage-logs-row"), count("tr.group-manage-logs-row"),
1, 1,
"it should display the right number of logs" "it should display the right number of logs"

View File

@@ -16,49 +16,49 @@ acceptance("Managing Group Membership", function (needs) {
await visit("/g/alternative-group/manage/membership"); await visit("/g/alternative-group/manage/membership");
assert.equal( assert.strictEqual(
count('label[for="automatic_membership"]'), count('label[for="automatic_membership"]'),
1, 1,
"it should display automatic membership label" "it should display automatic membership label"
); );
assert.equal( assert.strictEqual(
count(".groups-form-primary-group"), count(".groups-form-primary-group"),
1, 1,
"it should display set as primary group checkbox" "it should display set as primary group checkbox"
); );
assert.equal( assert.strictEqual(
count(".groups-form-grant-trust-level"), count(".groups-form-grant-trust-level"),
1, 1,
"it should display grant trust level selector" "it should display grant trust level selector"
); );
assert.equal( assert.strictEqual(
count(".group-form-public-admission"), count(".group-form-public-admission"),
1, 1,
"it should display group public admission input" "it should display group public admission input"
); );
assert.equal( assert.strictEqual(
count(".group-form-public-exit"), count(".group-form-public-exit"),
1, 1,
"it should display group public exit input" "it should display group public exit input"
); );
assert.equal( assert.strictEqual(
count(".group-form-allow-membership-requests"), count(".group-form-allow-membership-requests"),
1, 1,
"it should display group allow_membership_request input" "it should display group allow_membership_request input"
); );
assert.equal( assert.strictEqual(
count(".group-form-allow-membership-requests[disabled]"), count(".group-form-allow-membership-requests[disabled]"),
1, 1,
"it should disable group allow_membership_request input" "it should disable group allow_membership_request input"
); );
assert.equal( assert.strictEqual(
count(".group-flair-inputs"), count(".group-flair-inputs"),
1, 1,
"it should display avatar flair inputs" "it should display avatar flair inputs"
@@ -67,7 +67,7 @@ acceptance("Managing Group Membership", function (needs) {
await click(".group-form-public-admission"); await click(".group-form-public-admission");
await click(".group-form-allow-membership-requests"); await click(".group-form-allow-membership-requests");
assert.equal( assert.strictEqual(
count(".group-form-public-admission[disabled]"), count(".group-form-public-admission[disabled]"),
1, 1,
"it should disable group public admission input" "it should disable group public admission input"
@@ -78,7 +78,7 @@ acceptance("Managing Group Membership", function (needs) {
"it should not disable group public exit input" "it should not disable group public exit input"
); );
assert.equal( assert.strictEqual(
count(".group-form-membership-request-template"), count(".group-form-membership-request-template"),
1, 1,
"it should display the membership request template field" "it should display the membership request template field"
@@ -91,7 +91,7 @@ acceptance("Managing Group Membership", function (needs) {
await emailDomains.fillInFilter("foo.com"); await emailDomains.fillInFilter("foo.com");
await emailDomains.selectRowByValue("foo.com"); await emailDomains.selectRowByValue("foo.com");
assert.equal(emailDomains.header().value(), "foo.com"); assert.strictEqual(emailDomains.header().value(), "foo.com");
}); });
test("As a group owner", async function (assert) { test("As a group owner", async function (assert) {
@@ -119,25 +119,25 @@ acceptance("Managing Group Membership", function (needs) {
"it should not display grant trust level selector" "it should not display grant trust level selector"
); );
assert.equal( assert.strictEqual(
count(".group-form-public-admission"), count(".group-form-public-admission"),
1, 1,
"it should display group public admission input" "it should display group public admission input"
); );
assert.equal( assert.strictEqual(
count(".group-form-public-exit"), count(".group-form-public-exit"),
1, 1,
"it should display group public exit input" "it should display group public exit input"
); );
assert.equal( assert.strictEqual(
count(".group-form-allow-membership-requests"), count(".group-form-allow-membership-requests"),
1, 1,
"it should display group allow_membership_request input" "it should display group allow_membership_request input"
); );
assert.equal( assert.strictEqual(
count(".group-form-allow-membership-requests[disabled]"), count(".group-form-allow-membership-requests[disabled]"),
1, 1,
"it should disable group allow_membership_request input" "it should disable group allow_membership_request input"

View File

@@ -24,17 +24,17 @@ acceptance("Managing Group Profile", function (needs) {
test("As an admin", async function (assert) { test("As an admin", async function (assert) {
await visit("/g/discourse/manage/profile"); await visit("/g/discourse/manage/profile");
assert.equal( assert.strictEqual(
count(".group-form-bio"), count(".group-form-bio"),
1, 1,
"it should display group bio input" "it should display group bio input"
); );
assert.equal( assert.strictEqual(
count(".group-form-name"), count(".group-form-name"),
1, 1,
"it should display group name input" "it should display group name input"
); );
assert.equal( assert.strictEqual(
count(".group-form-full-name"), count(".group-form-full-name"),
1, 1,
"it should display group full name input" "it should display group full name input"

View File

@@ -24,7 +24,7 @@ acceptance("Managing Group Tag Notification Defaults", function (needs) {
test("As an admin", async function (assert) { test("As an admin", async function (assert) {
await visit("/g/discourse/manage/tags"); await visit("/g/discourse/manage/tags");
assert.equal( assert.strictEqual(
count(".groups-notifications-form .tag-chooser"), count(".groups-notifications-form .tag-chooser"),
5, 5,
"it should display tag inputs" "it should display tag inputs"
@@ -36,7 +36,7 @@ acceptance("Managing Group Tag Notification Defaults", function (needs) {
await visit("/g/discourse/manage/tags"); await visit("/g/discourse/manage/tags");
assert.equal( assert.strictEqual(
count(".groups-notifications-form .tag-chooser"), count(".groups-notifications-form .tag-chooser"),
5, 5,
"it should display tag inputs" "it should display tag inputs"

View File

@@ -89,23 +89,23 @@ acceptance("Group Requests", function (needs) {
test("Group Requests", async function (assert) { test("Group Requests", async function (assert) {
await visit("/g/Macdonald/requests"); await visit("/g/Macdonald/requests");
assert.equal(count(".group-members tr"), 2); assert.strictEqual(count(".group-members tr"), 2);
assert.equal( assert.strictEqual(
queryAll(".group-members tr:first-child td:nth-child(1)") queryAll(".group-members tr:first-child td:nth-child(1)")
.text() .text()
.trim() .trim()
.replace(/\s+/g, " "), .replace(/\s+/g, " "),
"Robin Ward eviltrout" "Robin Ward eviltrout"
); );
assert.equal( assert.strictEqual(
queryAll(".group-members tr:first-child td:nth-child(3)").text().trim(), queryAll(".group-members tr:first-child td:nth-child(3)").text().trim(),
"Please accept my membership request." "Please accept my membership request."
); );
assert.equal( assert.strictEqual(
queryAll(".group-members tr:first-child .btn-primary").text().trim(), queryAll(".group-members tr:first-child .btn-primary").text().trim(),
"Accept" "Accept"
); );
assert.equal( assert.strictEqual(
queryAll(".group-members tr:first-child .btn-danger").text().trim(), queryAll(".group-members tr:first-child .btn-danger").text().trim(),
"Deny" "Deny"
); );
@@ -120,7 +120,7 @@ acceptance("Group Requests", function (needs) {
assert.deepEqual(requests, [["19", "true"]]); assert.deepEqual(requests, [["19", "true"]]);
await click(".group-members tr:last-child .btn-danger"); await click(".group-members tr:last-child .btn-danger");
assert.equal( assert.strictEqual(
queryAll(".group-members tr:last-child td:nth-child(4)").text().trim(), queryAll(".group-members tr:last-child td:nth-child(4)").text().trim(),
"denied" "denied"
); );

View File

@@ -41,7 +41,7 @@ acceptance("Group - Anonymous", function (needs) {
await click(".activity-nav li a[href='/g/discourse/activity/topics']"); await click(".activity-nav li a[href='/g/discourse/activity/topics']");
assert.ok(queryAll(".topic-list"), "it shows the topic list"); assert.ok(queryAll(".topic-list"), "it shows the topic list");
assert.equal(count(".topic-list-item"), 2, "it lists stream items"); assert.strictEqual(count(".topic-list-item"), 2, "it lists stream items");
await click(".activity-nav li a[href='/g/discourse/activity/mentions']"); await click(".activity-nav li a[href='/g/discourse/activity/mentions']");
@@ -59,9 +59,9 @@ acceptance("Group - Anonymous", function (needs) {
const groupDropdown = selectKit(".group-dropdown"); const groupDropdown = selectKit(".group-dropdown");
await groupDropdown.expand(); await groupDropdown.expand();
assert.equal(groupDropdown.rowByIndex(1).name(), "discourse"); assert.strictEqual(groupDropdown.rowByIndex(1).name(), "discourse");
assert.equal( assert.strictEqual(
groupDropdown.rowByIndex(0).name(), groupDropdown.rowByIndex(0).name(),
I18n.t("groups.index.all") I18n.t("groups.index.all")
); );
@@ -191,19 +191,19 @@ acceptance("Group - Authenticated", function (needs) {
await visit("/g"); await visit("/g");
await click(".group-index-request"); await click(".group-index-request");
assert.equal( assert.strictEqual(
queryAll(".modal-header .title").text().trim(), queryAll(".modal-header .title").text().trim(),
I18n.t("groups.membership_request.title", { group_name: "Macdonald" }) I18n.t("groups.membership_request.title", { group_name: "Macdonald" })
); );
assert.equal( assert.strictEqual(
queryAll(".request-group-membership-form textarea").val(), queryAll(".request-group-membership-form textarea").val(),
"Please add me" "Please add me"
); );
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.equal( assert.strictEqual(
queryAll(".fancy-title").text().trim(), queryAll(".fancy-title").text().trim(),
"Internationalization / localization" "Internationalization / localization"
); );
@@ -212,9 +212,9 @@ acceptance("Group - Authenticated", function (needs) {
await click(".group-message-button"); await click(".group-message-button");
assert.equal(count("#reply-control"), 1, "it opens the composer"); assert.strictEqual(count("#reply-control"), 1, "it opens the composer");
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal( assert.strictEqual(
privateMessageUsers.header().value(), privateMessageUsers.header().value(),
"discourse", "discourse",
"it prefills the group name" "it prefills the group name"
@@ -227,7 +227,7 @@ acceptance("Group - Authenticated", function (needs) {
await visit("/g/alternative-group"); await visit("/g/alternative-group");
await click(".nav-pills li a[title='Messages']"); await click(".nav-pills li a[title='Messages']");
assert.equal( assert.strictEqual(
query("span.empty-state-title").innerText.trim(), query("span.empty-state-title").innerText.trim(),
I18n.t("no_group_messages_title"), I18n.t("no_group_messages_title"),
"it should display the right text" "it should display the right text"
@@ -238,7 +238,7 @@ acceptance("Group - Authenticated", function (needs) {
await visit("/g/discourse"); await visit("/g/discourse");
await click(".nav-pills li a[title='Messages']"); await click(".nav-pills li a[title='Messages']");
assert.equal( assert.strictEqual(
queryAll(".topic-list-item .link-top-line").text().trim(), queryAll(".topic-list-item .link-top-line").text().trim(),
"This is a private message 1", "This is a private message 1",
"it should display the list of group topics" "it should display the list of group topics"
@@ -247,7 +247,7 @@ acceptance("Group - Authenticated", function (needs) {
await click("#search-button"); await click("#search-button");
await fillIn("#search-term", "smth"); await fillIn("#search-term", "smth");
assert.equal( assert.strictEqual(
query( query(
".search-menu .results .search-menu-assistant-item:first-child" ".search-menu .results .search-menu-assistant-item:first-child"
).innerText.trim(), ).innerText.trim(),
@@ -259,18 +259,18 @@ acceptance("Group - Authenticated", function (needs) {
test("Admin Viewing Group", async function (assert) { test("Admin Viewing Group", async function (assert) {
await visit("/g/discourse"); await visit("/g/discourse");
assert.equal( assert.strictEqual(
count(".nav-pills li a[title='Manage']"), count(".nav-pills li a[title='Manage']"),
1, 1,
"it should show manage group tab if user is admin" "it should show manage group tab if user is admin"
); );
assert.equal( assert.strictEqual(
count(".group-message-button"), count(".group-message-button"),
1, 1,
"it displays show group message button" "it displays show group message button"
); );
assert.equal( assert.strictEqual(
queryAll(".group-info-name").text(), queryAll(".group-info-name").text(),
"Awesome Team", "Awesome Team",
"it should display the group name" "it should display the group name"
@@ -278,7 +278,7 @@ acceptance("Group - Authenticated", function (needs) {
await click(".group-details-button button.btn-danger"); await click(".group-details-button button.btn-danger");
assert.equal( assert.strictEqual(
queryAll(".bootbox .modal-body").html(), queryAll(".bootbox .modal-body").html(),
I18n.t("admin.groups.delete_with_messages_confirm", { I18n.t("admin.groups.delete_with_messages_confirm", {
count: 2, count: 2,
@@ -292,7 +292,7 @@ acceptance("Group - Authenticated", function (needs) {
test("Moderator Viewing Group", async function (assert) { test("Moderator Viewing Group", async function (assert) {
await visit("/g/alternative-group"); await visit("/g/alternative-group");
assert.equal( assert.strictEqual(
count(".nav-pills li a[title='Manage']"), count(".nav-pills li a[title='Manage']"),
1, 1,
"it should show manage group tab if user can_admin_group" "it should show manage group tab if user can_admin_group"
@@ -310,11 +310,11 @@ acceptance("Group - Authenticated", function (needs) {
const memberDropdown = selectKit(".group-member-dropdown:nth-of-type(1)"); const memberDropdown = selectKit(".group-member-dropdown:nth-of-type(1)");
await memberDropdown.expand(); await memberDropdown.expand();
assert.equal( assert.strictEqual(
memberDropdown.rowByIndex(0).name(), memberDropdown.rowByIndex(0).name(),
I18n.t("groups.members.remove_member") I18n.t("groups.members.remove_member")
); );
assert.equal( assert.strictEqual(
memberDropdown.rowByIndex(1).name(), memberDropdown.rowByIndex(1).name(),
I18n.t("groups.members.make_owner") I18n.t("groups.members.make_owner")
); );

View File

@@ -12,17 +12,17 @@ acceptance("Groups", function () {
test("Browsing Groups", async function (assert) { test("Browsing Groups", async function (assert) {
await visit("/g?username=eviltrout"); await visit("/g?username=eviltrout");
assert.equal(count(".group-box"), 1, "it displays user's groups"); assert.strictEqual(count(".group-box"), 1, "it displays user's groups");
await visit("/g"); await visit("/g");
assert.equal(count(".group-box"), 2, "it displays visible groups"); assert.strictEqual(count(".group-box"), 2, "it displays visible groups");
assert.equal( assert.strictEqual(
count(".group-index-join"), count(".group-index-join"),
1, 1,
"it shows button to join group" "it shows button to join group"
); );
assert.equal( assert.strictEqual(
count(".group-index-request"), count(".group-index-request"),
1, 1,
"it shows button to request for group membership" "it shows button to request for group membership"
@@ -42,7 +42,7 @@ acceptance("Groups", function () {
await click("a[href='/g/discourse/members']"); await click("a[href='/g/discourse/members']");
assert.equal( assert.strictEqual(
queryAll(".group-info-name").text().trim(), queryAll(".group-info-name").text().trim(),
"Awesome Team", "Awesome Team",
"it displays the group page" "it displays the group page"

View File

@@ -25,7 +25,7 @@ acceptance("New Group - Authenticated", function (needs) {
await visit("/g"); await visit("/g");
await click(".groups-header-new"); await click(".groups-header-new");
assert.equal( assert.strictEqual(
count(".group-form-save[disabled]"), count(".group-form-save[disabled]"),
1, 1,
"save button should be disabled" "save button should be disabled"
@@ -33,13 +33,13 @@ acceptance("New Group - Authenticated", function (needs) {
await fillIn("input[name='name']", "1"); await fillIn("input[name='name']", "1");
assert.equal( assert.strictEqual(
queryAll(".tip.bad").text().trim(), queryAll(".tip.bad").text().trim(),
I18n.t("admin.groups.new.name.too_short"), I18n.t("admin.groups.new.name.too_short"),
"it should show the right validation tooltip" "it should show the right validation tooltip"
); );
assert.equal( assert.strictEqual(
count(".group-form-save:disabled"), count(".group-form-save:disabled"),
1, 1,
"it should disable the save button" "it should disable the save button"
@@ -50,7 +50,7 @@ acceptance("New Group - Authenticated", function (needs) {
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
); );
assert.equal( assert.strictEqual(
queryAll(".tip.bad").text().trim(), queryAll(".tip.bad").text().trim(),
I18n.t("admin.groups.new.name.too_long"), I18n.t("admin.groups.new.name.too_long"),
"it should show the right validation tooltip" "it should show the right validation tooltip"
@@ -58,7 +58,7 @@ acceptance("New Group - Authenticated", function (needs) {
await fillIn("input[name='name']", ""); await fillIn("input[name='name']", "");
assert.equal( assert.strictEqual(
queryAll(".tip.bad").text().trim(), queryAll(".tip.bad").text().trim(),
I18n.t("admin.groups.new.name.blank"), I18n.t("admin.groups.new.name.blank"),
"it should show the right validation tooltip" "it should show the right validation tooltip"
@@ -66,7 +66,7 @@ acceptance("New Group - Authenticated", function (needs) {
await fillIn("input[name='name']", "goodusername"); await fillIn("input[name='name']", "goodusername");
assert.equal( assert.strictEqual(
queryAll(".tip.good").text().trim(), queryAll(".tip.good").text().trim(),
I18n.t("admin.groups.new.name.available"), I18n.t("admin.groups.new.name.available"),
"it should show the right validation tooltip" "it should show the right validation tooltip"

View File

@@ -19,7 +19,7 @@ acceptance(
await visit("/"); await visit("/");
await click(".hamburger-dropdown"); await click(".hamburger-dropdown");
assert.equal( assert.strictEqual(
queryAll(".review .badge-notification.reviewables").text(), queryAll(".review .badge-notification.reviewables").text(),
"3" "3"
); );

View File

@@ -32,7 +32,7 @@ category vs tag: #bug vs #bug::tag
uppercase hashtag works too #BUG, #BUG::tag` uppercase hashtag works too #BUG, #BUG::tag`
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-preview:visible").html().trim(), queryAll(".d-editor-preview:visible").html().trim(),
`<p>this is a category hashtag <a href="/c/bugs" class="hashtag" tabindex=\"-1\">#<span>bug</span></a></p> `<p>this is a category hashtag <a href="/c/bugs" class="hashtag" tabindex=\"-1\">#<span>bug</span></a></p>
<p>this is a tag hashtag <a href="/tag/monkey" class="hashtag" tabindex=\"-1\">#<span>monkey</span></a></p> <p>this is a tag hashtag <a href="/tag/monkey" class="hashtag" tabindex=\"-1\">#<span>monkey</span></a></p>

View File

@@ -100,7 +100,7 @@ acceptance("Invite accept", function (needs) {
await visit("/invites/myvalidinvitetoken"); await visit("/invites/myvalidinvitetoken");
assert.ok(exists("#new-account-email"), "shows the email input"); assert.ok(exists("#new-account-email"), "shows the email input");
assert.ok(exists("#new-account-username"), "shows the username input"); assert.ok(exists("#new-account-username"), "shows the username input");
assert.equal( assert.strictEqual(
queryAll("#new-account-username").val(), queryAll("#new-account-username").val(),
"invited", "invited",
"username is prefilled" "username is prefilled"
@@ -277,18 +277,18 @@ acceptance("Invite link with authentication data", function (needs) {
"email field is disabled" "email field is disabled"
); );
assert.equal( assert.strictEqual(
queryAll("#account-email-validation").text().trim(), queryAll("#account-email-validation").text().trim(),
I18n.t("user.email.authenticated", { provider: "Facebook" }) I18n.t("user.email.authenticated", { provider: "Facebook" })
); );
assert.equal( assert.strictEqual(
queryAll("#new-account-username").val(), queryAll("#new-account-username").val(),
"foobar", "foobar",
"username is prefilled" "username is prefilled"
); );
assert.equal( assert.strictEqual(
queryAll("#new-account-name").val(), queryAll("#new-account-name").val(),
"barfoo", "barfoo",
"name is prefilled" "name is prefilled"
@@ -312,7 +312,7 @@ acceptance("Email Invite link with authentication data", function (needs) {
await visit("/invites/myvalidinvitetoken"); await visit("/invites/myvalidinvitetoken");
assert.equal( assert.strictEqual(
queryAll("#account-email-validation").text().trim(), queryAll("#account-email-validation").text().trim(),
I18n.t("user.email.invite_auth_email_invalid", { provider: "Facebook" }) I18n.t("user.email.invite_auth_email_invalid", { provider: "Facebook" })
); );
@@ -350,18 +350,18 @@ acceptance(
); );
assert.ok(!exists("#new-account-email"), "does not show email field"); assert.ok(!exists("#new-account-email"), "does not show email field");
assert.equal( assert.strictEqual(
queryAll("#account-email-validation").text().trim(), queryAll("#account-email-validation").text().trim(),
I18n.t("user.email.authenticated", { provider: "Facebook" }) I18n.t("user.email.authenticated", { provider: "Facebook" })
); );
assert.equal( assert.strictEqual(
queryAll("#new-account-username").val(), queryAll("#new-account-username").val(),
"foobar", "foobar",
"username is prefilled" "username is prefilled"
); );
assert.equal( assert.strictEqual(
queryAll("#new-account-name").val(), queryAll("#new-account-name").val(),
"barfoo", "barfoo",
"name is prefilled" "name is prefilled"
@@ -388,7 +388,7 @@ acceptance(
await visit("/invites/myvalidinvitetoken"); await visit("/invites/myvalidinvitetoken");
assert.equal( assert.strictEqual(
query(".bad").textContent.trim(), query(".bad").textContent.trim(),
"Your invitation email does not match the email authenticated by Facebook" "Your invitation email does not match the email authenticated by Facebook"
); );
@@ -416,7 +416,7 @@ acceptance(
assert.ok(!exists("#new-account-email"), "does not show email field"); assert.ok(!exists("#new-account-email"), "does not show email field");
assert.equal( assert.strictEqual(
queryAll("#account-email-validation").text().trim(), queryAll("#account-email-validation").text().trim(),
I18n.t("user.email.authenticated_by_invite") I18n.t("user.email.authenticated_by_invite")
); );
@@ -444,7 +444,7 @@ acceptance(
assert.ok(!exists("#new-account-email"), "does not show email field"); assert.ok(!exists("#new-account-email"), "does not show email field");
assert.equal( assert.strictEqual(
queryAll("#account-email-validation").text().trim(), queryAll("#account-email-validation").text().trim(),
I18n.t("user.email.ok") I18n.t("user.email.ok")
); );

View File

@@ -30,7 +30,7 @@ acceptance("Jump to", function (needs) {
await fillIn("input.date-picker", "2014-02-24"); await fillIn("input.date-picker", "2014-02-24");
await click(".jump-to-post-modal .btn-primary"); await click(".jump-to-post-modal .btn-primary");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/t/internationalization-localization/280/3", "/t/internationalization-localization/280/3",
"it jumps to the correct post" "it jumps to the correct post"
@@ -44,7 +44,7 @@ acceptance("Jump to", function (needs) {
await fillIn("input.date-picker", "2094-02-24"); await fillIn("input.date-picker", "2094-02-24");
await click(".jump-to-post-modal .btn-primary"); await click(".jump-to-post-modal .btn-primary");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/t/internationalization-localization/280/20", "/t/internationalization-localization/280/20",
"it jumps to the last post if no post found" "it jumps to the last post if no post found"

View File

@@ -34,18 +34,18 @@ acceptance("Keyboard Shortcuts - Anonymous Users", function (needs) {
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
await triggerKeyEvent(document, "keypress", "g".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "g".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "s".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "s".charCodeAt(0));
assert.equal(currentURL(), "/t/this-is-a-test-topic/9"); assert.strictEqual(currentURL(), "/t/this-is-a-test-topic/9");
// Suggested topics elements exist. // Suggested topics elements exist.
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
await triggerKeyEvent(document, "keypress", "g".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "g".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "s".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "s".charCodeAt(0));
assert.equal(currentURL(), "/t/polls-are-still-very-buggy/27331/4"); assert.strictEqual(currentURL(), "/t/polls-are-still-very-buggy/27331/4");
await visit("/t/1-3-0beta9-no-rate-limit-popups/28830"); await visit("/t/1-3-0beta9-no-rate-limit-popups/28830");
await triggerKeyEvent(document, "keypress", "g".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "g".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "s".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "s".charCodeAt(0));
assert.equal(currentURL(), "/t/keyboard-shortcuts-are-awesome/27331"); assert.strictEqual(currentURL(), "/t/keyboard-shortcuts-are-awesome/27331");
}); });
}); });
@@ -99,12 +99,12 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
exists("#dismiss-read-confirm"), exists("#dismiss-read-confirm"),
"confirmation modal to dismiss unread is present" "confirmation modal to dismiss unread is present"
); );
assert.equal( assert.strictEqual(
query(".modal-body").innerText, query(".modal-body").innerText,
I18n.t("topics.bulk.also_dismiss_topics") I18n.t("topics.bulk.also_dismiss_topics")
); );
await click("#dismiss-read-confirm"); await click("#dismiss-read-confirm");
assert.equal( assert.strictEqual(
markReadCalled, markReadCalled,
1, 1,
"mark read has been called on the backend once" "mark read has been called on the backend once"
@@ -129,13 +129,13 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
exists("#dismiss-read-confirm"), exists("#dismiss-read-confirm"),
"confirmation modal to dismiss unread is present" "confirmation modal to dismiss unread is present"
); );
assert.equal( assert.strictEqual(
query(".modal-body").innerText, query(".modal-body").innerText,
"Stop tracking these topics so they never show up as unread for me again" "Stop tracking these topics so they never show up as unread for me again"
); );
await click("#dismiss-read-confirm"); await click("#dismiss-read-confirm");
assert.equal( assert.strictEqual(
markReadCalled, markReadCalled,
2, 2,
"mark read has been called on the backend twice" "mark read has been called on the backend twice"
@@ -154,7 +154,7 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
assert.ok(exists("#dismiss-new-top"), "dismiss new top button is present"); assert.ok(exists("#dismiss-new-top"), "dismiss new top button is present");
await triggerKeyEvent(document, "keypress", "x".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "x".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "r".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "r".charCodeAt(0));
assert.equal(resetNewCalled, 1); assert.strictEqual(resetNewCalled, 1);
// we get rid of all but one topic so the top dismiss button doesn't // we get rid of all but one topic so the top dismiss button doesn't
// show up, as it only appears if there are too many topics pushing // show up, as it only appears if there are too many topics pushing
@@ -171,7 +171,7 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
); );
await triggerKeyEvent(document, "keypress", "x".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "x".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "r".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "r".charCodeAt(0));
assert.equal(resetNewCalled, 2); assert.strictEqual(resetNewCalled, 2);
// restore the original topic list // restore the original topic list
topicList.topic_list.topics = originalTopics; topicList.topic_list.topics = originalTopics;
@@ -195,6 +195,6 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
await triggerKeyEvent(document, "keypress", "x".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "x".charCodeAt(0));
await triggerKeyEvent(document, "keypress", "r".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "r".charCodeAt(0));
assert.equal(resetNewCalled, 1); assert.strictEqual(resetNewCalled, 1);
}); });
}); });

View File

@@ -5,7 +5,7 @@ import { test } from "qunit";
acceptance("Login redirect - anonymous", function () { acceptance("Login redirect - anonymous", function () {
test("redirects login to default homepage", async function (assert) { test("redirects login to default homepage", async function (assert) {
await visit("/login"); await visit("/login");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"discovery.latest", "discovery.latest",
"it works when latest is the homepage" "it works when latest is the homepage"
@@ -20,7 +20,7 @@ acceptance("Login redirect - categories default", function (needs) {
test("when site setting is categories", async function (assert) { test("when site setting is categories", async function (assert) {
await visit("/login"); await visit("/login");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"discovery.categories", "discovery.categories",
"it works when categories is the homepage" "it works when categories is the homepage"

View File

@@ -11,10 +11,14 @@ acceptance("Login Required", function (needs) {
test("redirect", async function (assert) { test("redirect", async function (assert) {
await visit("/latest"); await visit("/latest");
assert.equal(currentRouteName(), "login", "it redirects them to login"); assert.strictEqual(
currentRouteName(),
"login",
"it redirects them to login"
);
await click("#site-logo"); await click("#site-logo");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"login", "login",
"clicking the logo keeps them on login" "clicking the logo keeps them on login"

View File

@@ -21,7 +21,7 @@ acceptance("Login with email - hide email address taken", function (needs) {
await fillIn("#login-account-name", "someuser@example.com"); await fillIn("#login-account-name", "someuser@example.com");
await click("#email-login-link"); await click("#email-login-link");
assert.equal( assert.strictEqual(
queryAll(".alert-success").html().trim(), queryAll(".alert-success").html().trim(),
I18n.t("email_login.complete_email_found", { I18n.t("email_login.complete_email_found", {
email: "someuser@example.com", email: "someuser@example.com",

View File

@@ -37,7 +37,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser"); await fillIn("#login-account-name", "someuser");
await click("#email-login-link"); await click("#email-login-link");
assert.equal( assert.strictEqual(
queryAll(".alert-error").html(), queryAll(".alert-error").html(),
I18n.t("email_login.complete_username_not_found", { I18n.t("email_login.complete_username_not_found", {
username: "someuser", username: "someuser",
@@ -48,7 +48,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser@gmail.com"); await fillIn("#login-account-name", "someuser@gmail.com");
await click("#email-login-link"); await click("#email-login-link");
assert.equal( assert.strictEqual(
queryAll(".alert-error").html(), queryAll(".alert-error").html(),
I18n.t("email_login.complete_email_not_found", { I18n.t("email_login.complete_email_not_found", {
email: "someuser@gmail.com", email: "someuser@gmail.com",
@@ -62,7 +62,7 @@ acceptance("Login with email", function (needs) {
await click("#email-login-link"); await click("#email-login-link");
assert.equal( assert.strictEqual(
queryAll(".alert-success").html().trim(), queryAll(".alert-success").html().trim(),
I18n.t("email_login.complete_username_found", { username: "someuser" }), I18n.t("email_login.complete_username_found", { username: "someuser" }),
"it should display a success message for a valid username" "it should display a success message for a valid username"
@@ -73,7 +73,7 @@ acceptance("Login with email", function (needs) {
await fillIn("#login-account-name", "someuser@gmail.com"); await fillIn("#login-account-name", "someuser@gmail.com");
await click("#email-login-link"); await click("#email-login-link");
assert.equal( assert.strictEqual(
queryAll(".alert-success").html().trim(), queryAll(".alert-success").html().trim(),
I18n.t("email_login.complete_email_found", { I18n.t("email_login.complete_email_found", {
email: "someuser@gmail.com", email: "someuser@gmail.com",

View File

@@ -13,7 +13,7 @@ acceptance("Topic Discovery - Mobile", function (needs) {
assert.ok(exists(".topic-list"), "The list of topics was rendered"); assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.ok(exists(".topic-list .topic-list-item"), "has topics"); assert.ok(exists(".topic-list .topic-list-item"), "has topics");
assert.equal( assert.strictEqual(
queryAll("a[data-user-card=codinghorror] img.avatar").attr("loading"), queryAll("a[data-user-card=codinghorror] img.avatar").attr("loading"),
"lazy", "lazy",
"it adds loading=`lazy` to topic list avatars" "it adds loading=`lazy` to topic list avatars"

View File

@@ -108,7 +108,7 @@ acceptance("Mobile - menu swipes", function (needs) {
await triggerSwipeMove(swipe); await triggerSwipeMove(swipe);
await triggerSwipeEnd(swipe); await triggerSwipeEnd(swipe);
assert.equal( assert.strictEqual(
count(".panel-body"), count(".panel-body"),
1, 1,
"it should re-open hamburger on a right swipe" "it should re-open hamburger on a right swipe"

View File

@@ -36,20 +36,20 @@ acceptance("Modal", function (needs) {
assert.ok(!exists(".d-modal:visible"), "there is no modal at first"); assert.ok(!exists(".d-modal:visible"), "there is no modal at first");
await click(".login-button"); await click(".login-button");
assert.equal(count(".d-modal:visible"), 1, "modal should appear"); assert.strictEqual(count(".d-modal:visible"), 1, "modal should appear");
let controller = controllerFor("modal"); let controller = controllerFor("modal");
assert.equal(controller.name, "login"); assert.strictEqual(controller.name, "login");
await click(".modal-outer-container"); await click(".modal-outer-container");
assert.ok( assert.ok(
!exists(".d-modal:visible"), !exists(".d-modal:visible"),
"modal should disappear when you click outside" "modal should disappear when you click outside"
); );
assert.equal(controller.name, null); assert.strictEqual(controller.name, null);
await click(".login-button"); await click(".login-button");
assert.equal(count(".d-modal:visible"), 1, "modal should reappear"); assert.strictEqual(count(".d-modal:visible"), 1, "modal should reappear");
await triggerKeyEvent("#main-outlet", "keyup", 27); await triggerKeyEvent("#main-outlet", "keyup", 27);
assert.ok(!exists(".d-modal:visible"), "ESC should close the modal"); assert.ok(!exists(".d-modal:visible"), "ESC should close the modal");
@@ -60,16 +60,16 @@ acceptance("Modal", function (needs) {
run(() => showModal("not-dismissable", {})); run(() => showModal("not-dismissable", {}));
assert.equal(count(".d-modal:visible"), 1, "modal should appear"); assert.strictEqual(count(".d-modal:visible"), 1, "modal should appear");
await click(".modal-outer-container"); await click(".modal-outer-container");
assert.equal( assert.strictEqual(
count(".d-modal:visible"), count(".d-modal:visible"),
1, 1,
"modal should not disappear when you click outside" "modal should not disappear when you click outside"
); );
await triggerKeyEvent("#main-outlet", "keyup", 27); await triggerKeyEvent("#main-outlet", "keyup", 27);
assert.equal( assert.strictEqual(
count(".d-modal:visible"), count(".d-modal:visible"),
1, 1,
"ESC should not close the modal" "ESC should not close the modal"
@@ -86,7 +86,7 @@ acceptance("Modal", function (needs) {
await visit("/"); await visit("/");
run(() => showModal("test-raw-title-panels", { panels })); run(() => showModal("test-raw-title-panels", { panels }));
assert.equal( assert.strictEqual(
queryAll(".d-modal .modal-tab:first-child").text().trim(), queryAll(".d-modal .modal-tab:first-child").text().trim(),
"Test 1", "Test 1",
"it should display the raw title" "it should display the raw title"
@@ -102,7 +102,7 @@ acceptance("Modal", function (needs) {
await visit("/"); await visit("/");
run(() => showModal("test-title", { title: "test_title" })); run(() => showModal("test-title", { title: "test_title" }));
assert.equal( assert.strictEqual(
queryAll(".d-modal .title").text().trim(), queryAll(".d-modal .title").text().trim(),
"Test title", "Test title",
"it should display the title" "it should display the title"
@@ -111,7 +111,7 @@ acceptance("Modal", function (needs) {
await click(".d-modal .close"); await click(".d-modal .close");
run(() => showModal("test-title-with-body", { title: "test_title" })); run(() => showModal("test-title-with-body", { title: "test_title" }));
assert.equal( assert.strictEqual(
queryAll(".d-modal .title").text().trim(), queryAll(".d-modal .title").text().trim(),
"Test title", "Test title",
"it should display the title when used with d-modal-body" "it should display the title when used with d-modal-body"
@@ -136,12 +136,12 @@ acceptance("Modal Keyboard Events", function (needs) {
await click(".admin-topic-timer-update button"); await click(".admin-topic-timer-update button");
await triggerKeyEvent(".d-modal", "keydown", 13); await triggerKeyEvent(".d-modal", "keydown", 13);
assert.equal( assert.strictEqual(
count("#modal-alert:visible"), count("#modal-alert:visible"),
1, 1,
"hitting Enter triggers modal action" "hitting Enter triggers modal action"
); );
assert.equal( assert.strictEqual(
count(".d-modal:visible"), count(".d-modal:visible"),
1, 1,
"hitting Enter does not dismiss modal due to alert error" "hitting Enter does not dismiss modal due to alert error"

View File

@@ -26,19 +26,19 @@ acceptance("New Message - Authenticated", function (needs) {
); );
assert.ok(exists(".composer-fields"), "it opens composer"); assert.ok(exists(".composer-fields"), "it opens composer");
assert.equal( assert.strictEqual(
queryAll("#reply-title").val().trim(), queryAll("#reply-title").val().trim(),
"message title", "message title",
"it pre-fills message title" "it pre-fills message title"
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().trim(), queryAll(".d-editor-input").val().trim(),
"message body", "message body",
"it pre-fills message body" "it pre-fills message body"
); );
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal( assert.strictEqual(
privateMessageUsers.header().value(), privateMessageUsers.header().value(),
"charlie", "charlie",
"it selects correct username" "it selects correct username"

View File

@@ -23,19 +23,19 @@ acceptance("New Topic - Authenticated", function (needs) {
); );
assert.ok(exists(".composer-fields"), "it opens composer"); assert.ok(exists(".composer-fields"), "it opens composer");
assert.equal( assert.strictEqual(
queryAll("#reply-title").val().trim(), queryAll("#reply-title").val().trim(),
"topic title", "topic title",
"it pre-fills topic title" "it pre-fills topic title"
); );
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().trim(), queryAll(".d-editor-input").val().trim(),
"topic body", "topic body",
"it pre-fills topic body" "it pre-fills topic body"
); );
assert.equal( assert.strictEqual(
selectKit(".category-chooser").header().value(), selectKit(".category-chooser").header().value(),
1, "1",
"it selects desired category" "it selects desired category"
); );
}); });

View File

@@ -36,7 +36,7 @@ acceptance("User Notifications", function (needs) {
await visit("/"); // wait for re-render await visit("/"); // wait for re-render
assert.equal(count("#quick-access-notifications li"), 6); assert.strictEqual(count("#quick-access-notifications li"), 6);
// high priority, unread notification - should be first // high priority, unread notification - should be first
@@ -80,8 +80,8 @@ acceptance("User Notifications", function (needs) {
await visit("/"); // wait for re-render await visit("/"); // wait for re-render
assert.equal(count("#quick-access-notifications li"), 6); assert.strictEqual(count("#quick-access-notifications li"), 6);
assert.equal( assert.strictEqual(
query("#quick-access-notifications li span[data-topic-id]").innerText, query("#quick-access-notifications li span[data-topic-id]").innerText,
"First notification" "First notification"
); );
@@ -129,8 +129,8 @@ acceptance("User Notifications", function (needs) {
await visit("/"); // wait for re-render await visit("/"); // wait for re-render
assert.equal(count("#quick-access-notifications li"), 7); assert.strictEqual(count("#quick-access-notifications li"), 7);
assert.equal( assert.strictEqual(
queryAll("#quick-access-notifications li span[data-topic-id]")[1] queryAll("#quick-access-notifications li span[data-topic-id]")[1]
.innerText, .innerText,
"Second notification" "Second notification"
@@ -179,7 +179,7 @@ acceptance("User Notifications", function (needs) {
}); });
await visit("/"); // wait for re-render await visit("/"); // wait for re-render
assert.equal(count("#quick-access-notifications li"), 8); assert.strictEqual(count("#quick-access-notifications li"), 8);
const texts = []; const texts = [];
queryAll("#quick-access-notifications li").each((_, el) => queryAll("#quick-access-notifications li").each((_, el) =>
texts.push(el.innerText.trim()) texts.push(el.innerText.trim())

View File

@@ -14,7 +14,7 @@ acceptance("Opengraph Tag Updater", function (needs) {
await click("#toggle-hamburger-menu"); await click("#toggle-hamburger-menu");
await click("a.about-link"); await click("a.about-link");
assert.equal( assert.strictEqual(
document document
.querySelector("meta[property='og:title']") .querySelector("meta[property='og:title']")
.getAttribute("content"), .getAttribute("content"),

View File

@@ -22,7 +22,7 @@ acceptance("Personal Message", function (needs) {
test("suggested messages", async function (assert) { test("suggested messages", async function (assert) {
await visit("/t/pm-for-testing/12"); await visit("/t/pm-for-testing/12");
assert.equal( assert.strictEqual(
queryAll("#suggested-topics .suggested-topics-title").text().trim(), queryAll("#suggested-topics .suggested-topics-title").text().trim(),
I18n.t("suggested_topics.pm_title") I18n.t("suggested_topics.pm_title")
); );

View File

@@ -22,7 +22,7 @@ acceptance("Plugin Keyboard Shortcuts - Logged In", function (needs) {
await visit("/t/this-is-a-test-topic/9"); await visit("/t/this-is-a-test-topic/9");
await triggerKeyEvent(document, "keypress", "]".charCodeAt(0)); await triggerKeyEvent(document, "keypress", "]".charCodeAt(0));
assert.equal( assert.strictEqual(
$("#added-element").length, $("#added-element").length,
1, 1,
"the keyboard shortcut callback fires successfully" "the keyboard shortcut callback fires successfully"

View File

@@ -70,7 +70,7 @@ acceptance("Plugin Outlet - Connector Class", function (needs) {
test("Renders a template into the outlet", async function (assert) { test("Renders a template into the outlet", async function (assert) {
await visit("/u/eviltrout"); await visit("/u/eviltrout");
assert.equal( assert.strictEqual(
count(".user-profile-primary-outlet.hello"), count(".user-profile-primary-outlet.hello"),
1, 1,
"it has class names" "it has class names"
@@ -81,14 +81,14 @@ acceptance("Plugin Outlet - Connector Class", function (needs) {
); );
await click(".say-hello"); await click(".say-hello");
assert.equal( assert.strictEqual(
queryAll(".hello-result").text(), queryAll(".hello-result").text(),
"hello!", "hello!",
"actions delegate properly" "actions delegate properly"
); );
await click(".say-hi"); await click(".say-hi");
assert.equal( assert.strictEqual(
queryAll(".hi-result").text(), queryAll(".hi-result").text(),
"hi!", "hi!",
"actions delegate properly" "actions delegate properly"

View File

@@ -52,8 +52,8 @@ acceptance("Plugin Outlet - Decorator", function (needs) {
)[0]; )[0];
assert.ok(exists(fooConnector)); assert.ok(exists(fooConnector));
assert.equal(fooConnector.style.backgroundColor, "yellow"); assert.strictEqual(fooConnector.style.backgroundColor, "yellow");
assert.equal(barConnector.style.backgroundColor, ""); assert.strictEqual(barConnector.style.backgroundColor, "");
await visit("/c/bug"); await visit("/c/bug");

View File

@@ -27,22 +27,22 @@ acceptance("Plugin Outlet - Multi Template", function (needs) {
test("Renders a template into the outlet", async function (assert) { test("Renders a template into the outlet", async function (assert) {
await visit("/u/eviltrout"); await visit("/u/eviltrout");
assert.equal( assert.strictEqual(
count(".user-profile-primary-outlet.hello"), count(".user-profile-primary-outlet.hello"),
1, 1,
"it has class names" "it has class names"
); );
assert.equal( assert.strictEqual(
count(".user-profile-primary-outlet.goodbye"), count(".user-profile-primary-outlet.goodbye"),
1, 1,
"it has class names" "it has class names"
); );
assert.equal( assert.strictEqual(
queryAll(".hello-span").text(), queryAll(".hello-span").text(),
"Hello", "Hello",
"it renders into the outlet" "it renders into the outlet"
); );
assert.equal( assert.strictEqual(
queryAll(".bye-span").text(), queryAll(".bye-span").text(),
"Goodbye", "Goodbye",
"it renders into the outlet" "it renders into the outlet"

View File

@@ -23,12 +23,12 @@ acceptance("Plugin Outlet - Single Template", function (needs) {
test("Renders a template into the outlet", async function (assert) { test("Renders a template into the outlet", async function (assert) {
await visit("/u/eviltrout"); await visit("/u/eviltrout");
assert.equal( assert.strictEqual(
count(".user-profile-primary-outlet.hello"), count(".user-profile-primary-outlet.hello"),
1, 1,
"it has class names" "it has class names"
); );
assert.equal( assert.strictEqual(
queryAll(".hello-username").text(), queryAll(".hello-username").text(),
"eviltrout", "eviltrout",
"it renders into the outlet" "it renders into the outlet"

View File

@@ -82,7 +82,7 @@ acceptance("User Preferences", function (needs) {
await visit("/u/eviltrout/preferences"); await visit("/u/eviltrout/preferences");
assert.ok($("body.user-preferences-page").length, "has the body class"); assert.ok($("body.user-preferences-page").length, "has the body class");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/u/eviltrout/preferences/account", "/u/eviltrout/preferences/account",
"defaults to account tab" "defaults to account tab"
@@ -151,7 +151,7 @@ acceptance("User Preferences", function (needs) {
await fillIn("#change-email", "invalidemail"); await fillIn("#change-email", "invalidemail");
assert.equal( assert.strictEqual(
queryAll(".tip.bad").text().trim(), queryAll(".tip.bad").text().trim(),
I18n.t("user.email.invalid"), I18n.t("user.email.invalid"),
"it should display invalid email tip" "it should display invalid email tip"
@@ -252,7 +252,7 @@ acceptance("User Preferences", function (needs) {
await click(".avatar-selector-refresh-gravatar"); await click(".avatar-selector-refresh-gravatar");
assert.equal( assert.strictEqual(
User.currentProp("gravatar_avatar_upload_id"), User.currentProp("gravatar_avatar_upload_id"),
6543, 6543,
"it should set the gravatar_avatar_upload_id property" "it should set the gravatar_avatar_upload_id property"
@@ -327,7 +327,7 @@ acceptance("User Preferences when badges are disabled", function (needs) {
test("visit my preferences", async function (assert) { test("visit my preferences", async function (assert) {
await visit("/u/eviltrout/preferences"); await visit("/u/eviltrout/preferences");
assert.ok($("body.user-preferences-page").length, "has the body class"); assert.ok($("body.user-preferences-page").length, "has the body class");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/u/eviltrout/preferences/account", "/u/eviltrout/preferences/account",
"defaults to account tab" "defaults to account tab"
@@ -418,7 +418,7 @@ acceptance("Custom User Fields", function (needs) {
); );
await field.expand(); await field.expand();
await field.selectRowByValue("Cat"); await field.selectRowByValue("Cat");
assert.equal( assert.strictEqual(
field.header().value(), field.header().value(),
"Cat", "Cat",
"it sets the value of the field" "it sets the value of the field"
@@ -444,7 +444,7 @@ acceptance(
await click(".save-changes"); await click(".save-changes");
await visit("/"); await visit("/");
assert.ok(exists(".topic-list"), "The list of topics was rendered"); assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"discovery.bookmarks", "discovery.bookmarks",
"it navigates to bookmarks" "it navigates to bookmarks"
@@ -487,7 +487,7 @@ acceptance("Security", function (needs) {
test("recently connected devices", async function (assert) { test("recently connected devices", async function (assert) {
await visit("/u/eviltrout/preferences/security"); await visit("/u/eviltrout/preferences/security");
assert.equal( assert.strictEqual(
queryAll(".auth-tokens > .auth-token:nth-of-type(1) .auth-token-device") queryAll(".auth-tokens > .auth-token:nth-of-type(1) .auth-token-device")
.text() .text()
.trim(), .trim(),
@@ -495,12 +495,12 @@ acceptance("Security", function (needs) {
"it should display active token first" "it should display active token first"
); );
assert.equal( assert.strictEqual(
queryAll(".pref-auth-tokens > a:nth-of-type(1)").text().trim(), queryAll(".pref-auth-tokens > a:nth-of-type(1)").text().trim(),
I18n.t("user.auth_tokens.show_all", { count: 3 }), I18n.t("user.auth_tokens.show_all", { count: 3 }),
"it should display two tokens" "it should display two tokens"
); );
assert.equal( assert.strictEqual(
count(".pref-auth-tokens .auth-token"), count(".pref-auth-tokens .auth-token"),
2, 2,
"it should display two tokens" "it should display two tokens"
@@ -508,7 +508,7 @@ acceptance("Security", function (needs) {
await click(".pref-auth-tokens > a:nth-of-type(1)"); await click(".pref-auth-tokens > a:nth-of-type(1)");
assert.equal( assert.strictEqual(
count(".pref-auth-tokens .auth-token"), count(".pref-auth-tokens .auth-token"),
3, 3,
"it should display three tokens" "it should display three tokens"
@@ -518,11 +518,11 @@ acceptance("Security", function (needs) {
await authTokenDropdown.expand(); await authTokenDropdown.expand();
await authTokenDropdown.selectRowByValue("notYou"); await authTokenDropdown.selectRowByValue("notYou");
assert.equal(count(".d-modal:visible"), 1, "modal should appear"); assert.strictEqual(count(".d-modal:visible"), 1, "modal should appear");
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.equal( assert.strictEqual(
count(".pref-password.highlighted"), count(".pref-password.highlighted"),
1, 1,
"it should highlight password preferences" "it should highlight password preferences"
@@ -543,7 +543,7 @@ acceptance(
await visit("/u/staged/preferences"); await visit("/u/staged/preferences");
assert.ok($("body.user-preferences-page").length, "has the body class"); assert.ok($("body.user-preferences-page").length, "has the body class");
assert.equal( assert.strictEqual(
currentURL(), currentURL(),
"/u/staged/preferences/account", "/u/staged/preferences/account",
"defaults to account tab" "defaults to account tab"

View File

@@ -28,7 +28,7 @@ acceptance("Raw Plugin Outlet", function (needs) {
test("Renders the raw plugin outlet", async function (assert) { test("Renders the raw plugin outlet", async function (assert) {
await visit("/"); await visit("/");
assert.ok(exists(".topic-lala"), "it renders the outlet"); assert.ok(exists(".topic-lala"), "it renders the outlet");
assert.equal( assert.strictEqual(
query(".topic-lala:nth-of-type(1)").innerText, query(".topic-lala:nth-of-type(1)").innerText,
"11557", "11557",
"it has the topic id" "it has the topic id"

View File

@@ -30,7 +30,11 @@ acceptance("Redirect to Top", function (needs) {
}); });
await visit("/categories"); await visit("/categories");
assert.equal(currentURL(), "/top?period=weekly", "it works for categories"); assert.strictEqual(
currentURL(),
"/top?period=weekly",
"it works for categories"
);
}); });
test("redirects latest to monthly top", async function (assert) { test("redirects latest to monthly top", async function (assert) {
@@ -43,7 +47,11 @@ acceptance("Redirect to Top", function (needs) {
}); });
await visit("/latest"); await visit("/latest");
assert.equal(currentURL(), "/top?period=monthly", "it works for latest"); assert.strictEqual(
currentURL(),
"/top?period=monthly",
"it works for latest"
);
}); });
test("redirects root to All top", async function (assert) { test("redirects root to All top", async function (assert) {
@@ -56,6 +64,6 @@ acceptance("Redirect to Top", function (needs) {
}); });
await visit("/"); await visit("/");
assert.equal(currentURL(), "/top?period=all", "it works for root"); assert.strictEqual(currentURL(), "/top?period=all", "it works for root");
}); });
}); });

View File

@@ -8,13 +8,16 @@ acceptance("Reports", function (needs) {
test("Visit reports page", async function (assert) { test("Visit reports page", async function (assert) {
await visit("/admin/reports"); await visit("/admin/reports");
assert.equal($(".reports-list .report").length, 1); assert.strictEqual($(".reports-list .report").length, 1);
const $report = $(".reports-list .report:first-child"); const $report = $(".reports-list .report:first-child");
assert.equal($report.find(".report-title").html().trim(), "My report"); assert.strictEqual(
$report.find(".report-title").html().trim(),
"My report"
);
assert.equal( assert.strictEqual(
$report.find(".report-description").html().trim(), $report.find(".report-description").html().trim(),
"List of my activities" "List of my activities"
); );

View File

@@ -94,12 +94,12 @@ acceptance("Review", function (needs) {
"it has a link to the user" "it has a link to the user"
); );
assert.equal( assert.strictEqual(
queryAll(".reviewable-flagged-post .post-body").html().trim(), queryAll(".reviewable-flagged-post .post-body").html().trim(),
"<b>cooked content</b>" "<b>cooked content</b>"
); );
assert.equal(count(".reviewable-flagged-post .reviewable-score"), 2); assert.strictEqual(count(".reviewable-flagged-post .reviewable-score"), 2);
}); });
test("Flag related", async function (assert) { test("Flag related", async function (assert) {
@@ -119,16 +119,16 @@ acceptance("Review", function (needs) {
await visit("/review"); await visit("/review");
assert.ok(exists(`${topic} .reviewable-action.approve`)); assert.ok(exists(`${topic} .reviewable-action.approve`));
assert.ok(!exists(`${topic} .category-name`)); assert.ok(!exists(`${topic} .category-name`));
assert.equal( assert.strictEqual(
queryAll(`${topic} .discourse-tag:nth-of-type(1)`).text(), queryAll(`${topic} .discourse-tag:nth-of-type(1)`).text(),
"hello" "hello"
); );
assert.equal( assert.strictEqual(
queryAll(`${topic} .discourse-tag:nth-of-type(2)`).text(), queryAll(`${topic} .discourse-tag:nth-of-type(2)`).text(),
"world" "world"
); );
assert.equal( assert.strictEqual(
queryAll(`${topic} .post-body`).text().trim(), queryAll(`${topic} .post-body`).text().trim(),
"existing body" "existing body"
); );
@@ -148,7 +148,7 @@ acceptance("Review", function (needs) {
await fillIn(".editable-field.payload-raw textarea", "new raw contents"); await fillIn(".editable-field.payload-raw textarea", "new raw contents");
await click(`${topic} .reviewable-action.cancel-edit`); await click(`${topic} .reviewable-action.cancel-edit`);
assert.equal( assert.strictEqual(
queryAll(`${topic} .post-body`).text().trim(), queryAll(`${topic} .post-body`).text().trim(),
"existing body", "existing body",
"cancelling does not update the value" "cancelling does not update the value"
@@ -167,24 +167,27 @@ acceptance("Review", function (needs) {
await fillIn(".editable-field.payload-raw textarea", "new raw contents"); await fillIn(".editable-field.payload-raw textarea", "new raw contents");
await click(`${topic} .reviewable-action.save-edit`); await click(`${topic} .reviewable-action.save-edit`);
assert.equal( assert.strictEqual(
queryAll(`${topic} .discourse-tag:nth-of-type(1)`).text(), queryAll(`${topic} .discourse-tag:nth-of-type(1)`).text(),
"hello" "hello"
); );
assert.equal( assert.strictEqual(
queryAll(`${topic} .discourse-tag:nth-of-type(2)`).text(), queryAll(`${topic} .discourse-tag:nth-of-type(2)`).text(),
"world" "world"
); );
assert.equal( assert.strictEqual(
queryAll(`${topic} .discourse-tag:nth-of-type(3)`).text(), queryAll(`${topic} .discourse-tag:nth-of-type(3)`).text(),
"monkey" "monkey"
); );
assert.equal( assert.strictEqual(
queryAll(`${topic} .post-body`).text().trim(), queryAll(`${topic} .post-body`).text().trim(),
"new raw contents" "new raw contents"
); );
assert.equal(queryAll(`${topic} .category-name`).text().trim(), "support"); assert.strictEqual(
queryAll(`${topic} .category-name`).text().trim(),
"support"
);
}); });
test("Reviewables can become stale", async function (assert) { test("Reviewables can become stale", async function (assert) {
@@ -192,7 +195,10 @@ acceptance("Review", function (needs) {
const reviewable = query(`[data-reviewable-id="1234"]`); const reviewable = query(`[data-reviewable-id="1234"]`);
assert.notOk(reviewable.className.includes("reviewable-stale")); assert.notOk(reviewable.className.includes("reviewable-stale"));
assert.equal(count(`[data-reviewable-id="1234"] .status .pending`), 1); assert.strictEqual(
count(`[data-reviewable-id="1234"] .status .pending`),
1
);
assert.ok(!exists(".stale-help")); assert.ok(!exists(".stale-help"));
publishToMessageBus("/reviewable_counts", { publishToMessageBus("/reviewable_counts", {
@@ -205,13 +211,13 @@ acceptance("Review", function (needs) {
await visit("/review"); // wait for re-render await visit("/review"); // wait for re-render
assert.ok(reviewable.className.includes("reviewable-stale")); assert.ok(reviewable.className.includes("reviewable-stale"));
assert.equal(count("[data-reviewable-id=1234] .status .approved"), 1); assert.strictEqual(count("[data-reviewable-id=1234] .status .approved"), 1);
assert.equal(count(".stale-help"), 1); assert.strictEqual(count(".stale-help"), 1);
assert.ok(query(".stale-help").innerText.includes("foo")); assert.ok(query(".stale-help").innerText.includes("foo"));
await visit("/"); await visit("/");
await visit("/review"); // reload review await visit("/review"); // reload review
assert.equal(count(".stale-help"), 0); assert.strictEqual(count(".stale-help"), 0);
}); });
}); });

View File

@@ -111,7 +111,7 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "discourse"); await fillIn(".search-query", "discourse");
await click(".search-cta"); await click(".search-cta");
assert.equal(count(".fps-topic"), 1, "has one post"); assert.strictEqual(count(".fps-topic"), 1, "has one post");
}); });
test("search for personal messages", async function (assert) { test("search for personal messages", async function (assert) {
@@ -120,15 +120,15 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "discourse in:personal"); await fillIn(".search-query", "discourse in:personal");
await click(".search-cta"); await click(".search-cta");
assert.equal(count(".fps-topic"), 1, "has one post"); assert.strictEqual(count(".fps-topic"), 1, "has one post");
assert.equal( assert.strictEqual(
count(".topic-status .personal_message"), count(".topic-status .personal_message"),
1, 1,
"shows the right icon" "shows the right icon"
); );
assert.equal(count(".search-highlight"), 1, "search highlights work"); assert.strictEqual(count(".search-highlight"), 1, "search highlights work");
}); });
test("escape search term", async function (assert) { test("escape search term", async function (assert) {
@@ -174,7 +174,7 @@ acceptance("Search - Full Page", function (needs) {
exists('.search-advanced-options span:contains("admin")'), exists('.search-advanced-options span:contains("admin")'),
'has "admin" pre-populated' 'has "admin" pre-populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none @admin", "none @admin",
'has updated search term to "none user:admin"' 'has updated search term to "none user:admin"'
@@ -199,7 +199,7 @@ acceptance("Search - Full Page", function (needs) {
exists('.search-advanced-options .badge-category:contains("faq")'), exists('.search-advanced-options .badge-category:contains("faq")'),
'has "faq" populated' 'has "faq" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none #faq", "none #faq",
'has updated search term to "none #faq"' 'has updated search term to "none #faq"'
@@ -223,7 +223,7 @@ acceptance("Search - Full Page", function (needs) {
exists('.search-advanced-options .badge-category:contains("快乐的")'), exists('.search-advanced-options .badge-category:contains("快乐的")'),
'has "快乐的" populated' 'has "快乐的" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none category:240", "none category:240",
'has updated search term to "none category:240"' 'has updated search term to "none category:240"'
@@ -239,7 +239,7 @@ acceptance("Search - Full Page", function (needs) {
exists(".search-advanced-options .in-title:checked"), exists(".search-advanced-options .in-title:checked"),
'has "in title" populated' 'has "in title" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none in:title", "none in:title",
'has updated search term to "none in:title"' 'has updated search term to "none in:title"'
@@ -262,7 +262,7 @@ acceptance("Search - Full Page", function (needs) {
exists(".search-advanced-options .in-likes:checked"), exists(".search-advanced-options .in-likes:checked"),
'has "I liked" populated' 'has "I liked" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none in:likes", "none in:likes",
'has updated search term to "none in:likes"' 'has updated search term to "none in:likes"'
@@ -279,7 +279,7 @@ acceptance("Search - Full Page", function (needs) {
'has "are in my messages" populated' 'has "are in my messages" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none in:personal", "none in:personal",
'has updated search term to "none in:personal"' 'has updated search term to "none in:personal"'
@@ -303,7 +303,7 @@ acceptance("Search - Full Page", function (needs) {
"it should check the right checkbox" "it should check the right checkbox"
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none in:seen", "none in:seen",
"it should update the search term" "it should update the search term"
@@ -326,12 +326,12 @@ acceptance("Search - Full Page", function (needs) {
await inSelector.expand(); await inSelector.expand();
await inSelector.selectRowByValue("bookmarks"); await inSelector.selectRowByValue("bookmarks");
assert.equal( assert.strictEqual(
inSelector.header().label(), inSelector.header().label(),
"I bookmarked", "I bookmarked",
'has "I bookmarked" populated' 'has "I bookmarked" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none in:bookmarks", "none in:bookmarks",
'has updated search term to "none in:bookmarks"' 'has updated search term to "none in:bookmarks"'
@@ -349,12 +349,12 @@ acceptance("Search - Full Page", function (needs) {
await statusSelector.expand(); await statusSelector.expand();
await statusSelector.selectRowByValue("closed"); await statusSelector.selectRowByValue("closed");
assert.equal( assert.strictEqual(
statusSelector.header().label(), statusSelector.header().label(),
"are closed", "are closed",
'has "are closed" populated' 'has "are closed" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none status:closed", "none status:closed",
'has updated search term to "none status:closed"' 'has updated search term to "none status:closed"'
@@ -370,7 +370,11 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "status:none"); await fillIn(".search-query", "status:none");
assert.equal(statusSelector.header().label(), "any", 'has "any" populated'); assert.strictEqual(
statusSelector.header().label(),
"any",
'has "any" populated'
);
}); });
test("doesn't update in filter header if wrong value entered through searchbox", async function (assert) { test("doesn't update in filter header if wrong value entered through searchbox", async function (assert) {
@@ -380,13 +384,17 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "in:none"); await fillIn(".search-query", "in:none");
assert.equal(inSelector.header().label(), "any", 'has "any" populated'); assert.strictEqual(
inSelector.header().label(),
"any",
'has "any" populated'
);
}); });
test("update post time through advanced search ui", async function (assert) { test("update post time through advanced search ui", async function (assert) {
await visit("/search?expanded=true&q=after:2018-08-22"); await visit("/search?expanded=true&q=after:2018-08-22");
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"after:2018-08-22", "after:2018-08-22",
"it should update the search term correctly" "it should update the search term correctly"
@@ -403,13 +411,13 @@ acceptance("Search - Full Page", function (needs) {
await postTimeSelector.expand(); await postTimeSelector.expand();
await postTimeSelector.selectRowByValue("after"); await postTimeSelector.selectRowByValue("after");
assert.equal( assert.strictEqual(
postTimeSelector.header().label(), postTimeSelector.header().label(),
"after", "after",
'has "after" populated' 'has "after" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none after:2016-10-05", "none after:2016-10-05",
'has updated search term to "none after:2016-10-05"' 'has updated search term to "none after:2016-10-05"'
@@ -421,14 +429,14 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "none"); await fillIn(".search-query", "none");
await fillIn("#search-min-post-count", "5"); await fillIn("#search-min-post-count", "5");
assert.equal( assert.strictEqual(
queryAll( queryAll(
".search-advanced-additional-options #search-min-post-count" ".search-advanced-additional-options #search-min-post-count"
).val(), ).val(),
"5", "5",
'has "5" populated' 'has "5" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none min_posts:5", "none min_posts:5",
'has updated search term to "none min_posts:5"' 'has updated search term to "none min_posts:5"'
@@ -440,14 +448,14 @@ acceptance("Search - Full Page", function (needs) {
await fillIn(".search-query", "none"); await fillIn(".search-query", "none");
await fillIn("#search-max-post-count", "5"); await fillIn("#search-max-post-count", "5");
assert.equal( assert.strictEqual(
queryAll( queryAll(
".search-advanced-additional-options #search-max-post-count" ".search-advanced-additional-options #search-max-post-count"
).val(), ).val(),
"5", "5",
'has "5" populated' 'has "5" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"none max_posts:5", "none max_posts:5",
'has updated search term to "none max_posts:5"' 'has updated search term to "none max_posts:5"'
@@ -463,7 +471,7 @@ acceptance("Search - Full Page", function (needs) {
'has "I liked" populated' 'has "I liked" populated'
); );
assert.equal( assert.strictEqual(
queryAll(".search-query").val(), queryAll(".search-query").val(),
"in:likes", "in:likes",
'has updated search term to "in:likes"' 'has updated search term to "in:likes"'
@@ -506,7 +514,7 @@ acceptance("Search - Full Page", function (needs) {
await click(".search-cta"); await click(".search-cta");
assert.equal(count(".fps-user-item"), 1, "has one user result"); assert.strictEqual(count(".fps-user-item"), 1, "has one user result");
await typeSelector.expand(); await typeSelector.expand();
await typeSelector.selectRowByValue(SEARCH_TYPE_DEFAULT); await typeSelector.selectRowByValue(SEARCH_TYPE_DEFAULT);
@@ -531,7 +539,7 @@ acceptance("Search - Full Page", function (needs) {
await click(".search-cta"); await click(".search-cta");
assert.ok(!exists(".search-filters"), "has no filters"); assert.ok(!exists(".search-filters"), "has no filters");
assert.equal(count(".fps-tag-item"), 2, "has two tag results"); assert.strictEqual(count(".fps-tag-item"), 2, "has two tag results");
await typeSelector.expand(); await typeSelector.expand();
await typeSelector.selectRowByValue(SEARCH_TYPE_DEFAULT); await typeSelector.selectRowByValue(SEARCH_TYPE_DEFAULT);

View File

@@ -33,7 +33,7 @@ acceptance("Search - Mobile", function (needs) {
await fillIn(".search-query", "discourse"); await fillIn(".search-query", "discourse");
await click(".search-cta"); await click(".search-cta");
assert.equal(count(".fps-topic"), 1, "has one post"); assert.strictEqual(count(".fps-topic"), 1, "has one post");
assert.ok( assert.ok(
!visible(".search-advanced-filters"), !visible(".search-advanced-filters"),
@@ -42,7 +42,7 @@ acceptance("Search - Mobile", function (needs) {
await click("#search-button"); await click("#search-button");
assert.equal( assert.strictEqual(
queryAll("input.full-page-search").val(), queryAll("input.full-page-search").val(),
"discourse", "discourse",
"it does not reset input when hitting search icon again" "it does not reset input when hitting search icon again"

View File

@@ -63,7 +63,7 @@ acceptance("Search - Anonymous", function (needs) {
"quick tip no longer shown" "quick tip no longer shown"
); );
assert.equal( assert.strictEqual(
query( query(
".search-menu .results ul.search-menu-initial-options li:first-child .search-item-slug" ".search-menu .results ul.search-menu-initial-options li:first-child .search-item-slug"
).innerText.trim(), ).innerText.trim(),
@@ -95,7 +95,7 @@ acceptance("Search - Anonymous", function (needs) {
await click(".show-advanced-search"); await click(".show-advanced-search");
assert.equal( assert.strictEqual(
query(".full-page-search").value, query(".full-page-search").value,
"dev", "dev",
"it goes to full search page and preserves the search term" "it goes to full search page and preserves the search term"
@@ -130,7 +130,7 @@ acceptance("Search - Anonymous", function (needs) {
await visit("/tag/important"); await visit("/tag/important");
await click("#search-button"); await click("#search-button");
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
`${I18n.t("search.in")} test`, `${I18n.t("search.in")} test`,
"contenxtual tag search is first available option with no term" "contenxtual tag search is first available option with no term"
@@ -138,7 +138,7 @@ acceptance("Search - Anonymous", function (needs) {
await fillIn("#search-term", "smth"); await fillIn("#search-term", "smth");
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
`smth ${I18n.t("search.in")} test`, `smth ${I18n.t("search.in")} test`,
"tag-scoped search is first available option" "tag-scoped search is first available option"
@@ -147,7 +147,7 @@ acceptance("Search - Anonymous", function (needs) {
await visit("/c/bug"); await visit("/c/bug");
await click("#search-button"); await click("#search-button");
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
`smth ${I18n.t("search.in")} bug`, `smth ${I18n.t("search.in")} bug`,
"category-scoped search is first available option" "category-scoped search is first available option"
@@ -161,7 +161,7 @@ acceptance("Search - Anonymous", function (needs) {
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
await click("#search-button"); await click("#search-button");
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
`smth ${I18n.t("search.in_this_topic")}`, `smth ${I18n.t("search.in_this_topic")}`,
"topic-scoped search is first available option" "topic-scoped search is first available option"
@@ -170,7 +170,7 @@ acceptance("Search - Anonymous", function (needs) {
await visit("/u/eviltrout"); await visit("/u/eviltrout");
await click("#search-button"); await click("#search-button");
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
`smth ${I18n.t("search.in_posts_by", { `smth ${I18n.t("search.in_posts_by", {
username: "eviltrout", username: "eviltrout",
@@ -187,7 +187,7 @@ acceptance("Search - Anonymous", function (needs) {
const firstResult = const firstResult =
".search-menu .results .search-menu-assistant-item:first-child"; ".search-menu .results .search-menu-assistant-item:first-child";
assert.equal( assert.strictEqual(
query(firstResult).textContent.trim(), query(firstResult).textContent.trim(),
I18n.t("search.in_this_topic"), I18n.t("search.in_this_topic"),
"contenxtual topic search is first available option" "contenxtual topic search is first available option"
@@ -203,7 +203,7 @@ acceptance("Search - Anonymous", function (needs) {
"clicking first option formats results as posts" "clicking first option formats results as posts"
); );
assert.equal( assert.strictEqual(
query("#post_7 span.highlighted").textContent.trim(), query("#post_7 span.highlighted").textContent.trim(),
"a proper", "a proper",
"highlights the post correctly" "highlights the post correctly"
@@ -214,7 +214,7 @@ acceptance("Search - Anonymous", function (needs) {
"search context indicator is visible" "search context indicator is visible"
); );
await click(".clear-search"); await click(".clear-search");
assert.equal(query("#search-term").value, "", "clear button works"); assert.strictEqual(query("#search-term").value, "", "clear button works");
await click(".search-context"); await click(".search-context");
@@ -249,9 +249,9 @@ acceptance("Search - Anonymous", function (needs) {
await click("#search-button"); await click("#search-button");
await fillIn("#search-term", "@admin"); await fillIn("#search-term", "@admin");
assert.equal(count(".search-menu-assistant-item"), 2); assert.strictEqual(count(".search-menu-assistant-item"), 2);
assert.equal( assert.strictEqual(
query( query(
".search-menu-assistant-item:first-child .search-item-user .label-suffix" ".search-menu-assistant-item:first-child .search-item-user .label-suffix"
).textContent.trim(), ).textContent.trim(),
@@ -259,7 +259,7 @@ acceptance("Search - Anonymous", function (needs) {
"first result hints in this topic search" "first result hints in this topic search"
); );
assert.equal( assert.strictEqual(
query( query(
".search-menu-assistant-item:nth-child(2) .search-item-user .label-suffix" ".search-menu-assistant-item:nth-child(2) .search-item-user .label-suffix"
).textContent.trim(), ).textContent.trim(),
@@ -358,13 +358,13 @@ acceptance("Search - Authenticated", function (needs) {
await triggerKeyEvent(".search-menu", "keydown", 40); await triggerKeyEvent(".search-menu", "keydown", 40);
await click(document.activeElement); await click(document.activeElement);
assert.notEqual(count(".search-menu .results .item"), 0); assert.notStrictEqual(count(".search-menu .results .item"), 0);
await fillIn("#search-term", "plans empty"); await fillIn("#search-term", "plans empty");
await triggerKeyEvent("#search-term", "keydown", 13); await triggerKeyEvent("#search-term", "keydown", 13);
assert.equal(count(".search-menu .results .item"), 0); assert.strictEqual(count(".search-menu .results .item"), 0);
assert.equal(count(".search-menu .results .no-results"), 1); assert.strictEqual(count(".search-menu .results .no-results"), 1);
}); });
test("search dropdown keyboard navigation", async function (assert) { test("search dropdown keyboard navigation", async function (assert) {
@@ -389,7 +389,7 @@ acceptance("Search - Authenticated", function (needs) {
await triggerKeyEvent("#search-term", "keydown", keyArrowDown); await triggerKeyEvent("#search-term", "keydown", keyArrowDown);
assert.equal( assert.strictEqual(
document.activeElement.getAttribute("href"), document.activeElement.getAttribute("href"),
query(`${container} li:first-child a`).getAttribute("href"), query(`${container} li:first-child a`).getAttribute("href"),
"arrow down selects first element" "arrow down selects first element"
@@ -397,7 +397,7 @@ acceptance("Search - Authenticated", function (needs) {
await triggerKeyEvent("#search-term", "keydown", keyArrowDown); await triggerKeyEvent("#search-term", "keydown", keyArrowDown);
assert.equal( assert.strictEqual(
document.activeElement.getAttribute("href"), document.activeElement.getAttribute("href"),
query(`${container} li:nth-child(2) a`).getAttribute("href"), query(`${container} li:nth-child(2) a`).getAttribute("href"),
"arrow down selects next element" "arrow down selects next element"
@@ -408,7 +408,7 @@ acceptance("Search - Authenticated", function (needs) {
await triggerKeyEvent("#search-term", "keydown", keyArrowDown); await triggerKeyEvent("#search-term", "keydown", keyArrowDown);
await triggerKeyEvent("#search-term", "keydown", keyArrowDown); await triggerKeyEvent("#search-term", "keydown", keyArrowDown);
assert.equal( assert.strictEqual(
document.activeElement.getAttribute("href"), document.activeElement.getAttribute("href"),
"/search?q=dev", "/search?q=dev",
"arrow down sets focus to more results link" "arrow down sets focus to more results link"
@@ -421,7 +421,7 @@ acceptance("Search - Authenticated", function (needs) {
await triggerKeyEvent(".search-menu", "keydown", keyArrowDown); await triggerKeyEvent(".search-menu", "keydown", keyArrowDown);
await triggerKeyEvent(".search-menu", "keydown", keyArrowUp); await triggerKeyEvent(".search-menu", "keydown", keyArrowUp);
assert.equal( assert.strictEqual(
document.activeElement.tagName.toLowerCase(), document.activeElement.tagName.toLowerCase(),
"input", "input",
"arrow up sets focus to search term input" "arrow up sets focus to search term input"
@@ -437,7 +437,7 @@ acceptance("Search - Authenticated", function (needs) {
); );
await triggerKeyEvent(".search-menu", "keydown", keyA); await triggerKeyEvent(".search-menu", "keydown", keyA);
assert.equal( assert.strictEqual(
query("#reply-control textarea").value, query("#reply-control textarea").value,
`${window.location.origin}${firstLink}`, `${window.location.origin}${firstLink}`,
"hitting A when focused on a search result copies link to composer" "hitting A when focused on a search result copies link to composer"
@@ -455,7 +455,7 @@ acceptance("Search - with tagging enabled", function (needs) {
await fillIn("#search-term", "dev"); await fillIn("#search-term", "dev");
await triggerKeyEvent("#search-term", "keydown", 13); await triggerKeyEvent("#search-term", "keydown", 13);
assert.equal( assert.strictEqual(
query( query(
".search-menu .results ul li:nth-of-type(1) .discourse-tags" ".search-menu .results ul li:nth-of-type(1) .discourse-tags"
).textContent.trim(), ).textContent.trim(),
@@ -477,7 +477,7 @@ acceptance("Search - with tagging enabled", function (needs) {
assert.ok(exists(query(firstItem))); assert.ok(exists(query(firstItem)));
const firstTag = query(`${firstItem} .search-item-tag`).textContent.trim(); const firstTag = query(`${firstItem} .search-item-tag`).textContent.trim();
assert.equal(firstTag, "monkey"); assert.strictEqual(firstTag, "monkey");
}); });
}); });
@@ -528,13 +528,13 @@ acceptance("Search - assistant", function (needs) {
).textContent.trim(); ).textContent.trim();
await click(firstCategory); await click(firstCategory);
assert.equal(query("#search-term").value, `#${firstResultSlug}`); assert.strictEqual(query("#search-term").value, `#${firstResultSlug}`);
await fillIn("#search-term", "sam #"); await fillIn("#search-term", "sam #");
await triggerKeyEvent("#search-term", "keyup", 51); await triggerKeyEvent("#search-term", "keyup", 51);
assert.ok(exists(query(firstCategory))); assert.ok(exists(query(firstCategory)));
assert.equal( assert.strictEqual(
query( query(
".search-menu .results ul.search-menu-assistant .search-item-prefix" ".search-menu .results ul.search-menu-assistant .search-item-prefix"
).innerText, ).innerText,
@@ -542,7 +542,7 @@ acceptance("Search - assistant", function (needs) {
); );
await click(firstCategory); await click(firstCategory);
assert.equal(query("#search-term").value, `sam #${firstResultSlug}`); assert.strictEqual(query("#search-term").value, `sam #${firstResultSlug}`);
}); });
test("shows in: shortcuts", async function (assert) { test("shows in: shortcuts", async function (assert) {
@@ -554,15 +554,15 @@ acceptance("Search - assistant", function (needs) {
await fillIn("#search-term", "in:"); await fillIn("#search-term", "in:");
await triggerKeyEvent("#search-term", "keyup", 51); await triggerKeyEvent("#search-term", "keyup", 51);
assert.equal(query(firstTarget).innerText, "in:title"); assert.strictEqual(query(firstTarget).innerText, "in:title");
await fillIn("#search-term", "sam in:"); await fillIn("#search-term", "sam in:");
await triggerKeyEvent("#search-term", "keyup", 51); await triggerKeyEvent("#search-term", "keyup", 51);
assert.equal(query(firstTarget).innerText, "sam in:title"); assert.strictEqual(query(firstTarget).innerText, "sam in:title");
await fillIn("#search-term", "in:pers"); await fillIn("#search-term", "in:pers");
await triggerKeyEvent("#search-term", "keyup", 51); await triggerKeyEvent("#search-term", "keyup", 51);
assert.equal(query(firstTarget).innerText, "in:personal"); assert.strictEqual(query(firstTarget).innerText, "in:personal");
}); });
test("shows users when typing @", async function (assert) { test("shows users when typing @", async function (assert) {
@@ -576,9 +576,9 @@ acceptance("Search - assistant", function (needs) {
const firstUser = const firstUser =
".search-menu .results ul.search-menu-assistant .search-item-user"; ".search-menu .results ul.search-menu-assistant .search-item-user";
const firstUsername = query(firstUser).innerText.trim(); const firstUsername = query(firstUser).innerText.trim();
assert.equal(firstUsername, "TeaMoe"); assert.strictEqual(firstUsername, "TeaMoe");
await click(query(firstUser)); await click(query(firstUser));
assert.equal(query("#search-term").value, `@${firstUsername}`); assert.strictEqual(query("#search-term").value, `@${firstUsername}`);
}); });
}); });

View File

@@ -10,9 +10,9 @@ import { test } from "qunit";
acceptance("Shared Drafts", function () { acceptance("Shared Drafts", function () {
test("Viewing and publishing", async function (assert) { test("Viewing and publishing", async function (assert) {
await visit("/t/some-topic/9"); await visit("/t/some-topic/9");
assert.equal(count(".shared-draft-controls"), 1); assert.strictEqual(count(".shared-draft-controls"), 1);
let categoryChooser = selectKit(".shared-draft-controls .category-chooser"); let categoryChooser = selectKit(".shared-draft-controls .category-chooser");
assert.equal(categoryChooser.header().value(), "3"); assert.strictEqual(categoryChooser.header().value(), "3");
await click(".publish-shared-draft"); await click(".publish-shared-draft");
await click(".bootbox .btn-primary"); await click(".bootbox .btn-primary");
@@ -22,7 +22,7 @@ acceptance("Shared Drafts", function () {
test("Updating category", async function (assert) { test("Updating category", async function (assert) {
await visit("/t/some-topic/9"); await visit("/t/some-topic/9");
assert.equal(count(".shared-draft-controls"), 1); assert.strictEqual(count(".shared-draft-controls"), 1);
await click(".edit-topic"); await click(".edit-topic");
@@ -33,6 +33,6 @@ acceptance("Shared Drafts", function () {
await click(".edit-controls .btn-primary"); await click(".edit-controls .btn-primary");
categoryChooser = selectKit(".shared-draft-controls .category-chooser"); categoryChooser = selectKit(".shared-draft-controls .category-chooser");
assert.equal(categoryChooser.header().value(), "7"); assert.strictEqual(categoryChooser.header().value(), "7");
}); });
}); });

View File

@@ -40,14 +40,14 @@ acceptance("Signing In", function () {
await fillIn("#login-account-name", "eviltrout"); await fillIn("#login-account-name", "eviltrout");
await fillIn("#login-account-password", "not-activated"); await fillIn("#login-account-password", "not-activated");
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.equal( assert.strictEqual(
queryAll(".modal-body b").text(), queryAll(".modal-body b").text(),
"<small>eviltrout@example.com</small>" "<small>eviltrout@example.com</small>"
); );
assert.ok(!exists(".modal-body small"), "it escapes the email address"); assert.ok(!exists(".modal-body small"), "it escapes the email address");
await click(".modal-footer button.resend"); await click(".modal-footer button.resend");
assert.equal( assert.strictEqual(
queryAll(".modal-body b").text(), queryAll(".modal-body b").text(),
"<small>current@example.com</small>" "<small>current@example.com</small>"
); );
@@ -63,8 +63,11 @@ acceptance("Signing In", function () {
await fillIn("#login-account-password", "not-activated-edit"); await fillIn("#login-account-password", "not-activated-edit");
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
await click(".modal-footer button.edit-email"); await click(".modal-footer button.edit-email");
assert.equal(queryAll(".activate-new-email").val(), "current@example.com"); assert.strictEqual(
assert.equal( queryAll(".activate-new-email").val(),
"current@example.com"
);
assert.strictEqual(
count(".modal-footer .btn-primary:disabled"), count(".modal-footer .btn-primary:disabled"),
1, 1,
"must change email" "must change email"
@@ -72,7 +75,10 @@ acceptance("Signing In", function () {
await fillIn(".activate-new-email", "different@example.com"); await fillIn(".activate-new-email", "different@example.com");
assert.ok(!exists(".modal-footer .btn-primary:disabled")); assert.ok(!exists(".modal-footer .btn-primary:disabled"));
await click(".modal-footer .btn-primary"); await click(".modal-footer .btn-primary");
assert.equal(queryAll(".modal-body b").text(), "different@example.com"); assert.strictEqual(
queryAll(".modal-body b").text(),
"different@example.com"
);
}); });
skip("second factor", async function (assert) { skip("second factor", async function (assert) {

View File

@@ -21,7 +21,7 @@ acceptance("Static", function () {
assert.ok(exists(".body-page"), "The content is present"); assert.ok(exists(".body-page"), "The content is present");
await visit("/login"); await visit("/login");
assert.equal( assert.strictEqual(
currentRouteName(), currentRouteName(),
"discovery.latest", "discovery.latest",
"it redirects them to latest unless `login_required`" "it redirects them to latest unless `login_required`"

View File

@@ -35,7 +35,7 @@ acceptance("Tags intersection", function (needs) {
await click("#create-topic"); await click("#create-topic");
assert.ok(exists(".mini-tag-chooser"), "The tag selector appears"); assert.ok(exists(".mini-tag-chooser"), "The tag selector appears");
assert.equal( assert.strictEqual(
$(".composer-fields .mini-tag-chooser").text().trim(), $(".composer-fields .mini-tag-chooser").text().trim(),
"first, second", "first, second",
"populates the tags when clicking 'New topic'" "populates the tags when clicking 'New topic'"

View File

@@ -191,7 +191,7 @@ acceptance("Tags listed by group", function (needs) {
test("list the tags in groups", async function (assert) { test("list the tags in groups", async function (assert) {
await visit("/tags"); await visit("/tags");
assert.equal( assert.strictEqual(
$(".tag-list").length, $(".tag-list").length,
4, 4,
"shows separate lists for the 3 groups and the ungrouped tags" "shows separate lists for the 3 groups and the ungrouped tags"
@@ -223,7 +223,7 @@ acceptance("Tags listed by group", function (needs) {
["/tag/focus", "/tag/escort"], ["/tag/focus", "/tag/escort"],
"always uses lowercase URLs for mixed case tags" "always uses lowercase URLs for mixed case tags"
); );
assert.equal( assert.strictEqual(
$("a[data-tag-name='private']").attr("href"), $("a[data-tag-name='private']").attr("href"),
"/u/eviltrout/messages/tags/private", "/u/eviltrout/messages/tags/private",
"links to private messages" "links to private messages"
@@ -237,7 +237,7 @@ acceptance("Tags listed by group", function (needs) {
assert.ok(!exists("#create-topic:disabled")); assert.ok(!exists("#create-topic:disabled"));
await visit("/tag/staff-only-tag"); await visit("/tag/staff-only-tag");
assert.equal(count("#create-topic:disabled"), 1); assert.strictEqual(count("#create-topic:disabled"), 1);
updateCurrentUser({ moderator: true }); updateCurrentUser({ moderator: true });
@@ -384,7 +384,7 @@ acceptance("Tag info", function (needs) {
updateCurrentUser({ moderator: false, admin: false }); updateCurrentUser({ moderator: false, admin: false });
await visit("/tag/planters"); await visit("/tag/planters");
assert.equal(count("#show-tag-info"), 1); assert.strictEqual(count("#show-tag-info"), 1);
await click("#show-tag-info"); await click("#show-tag-info");
assert.ok(exists(".tag-info .tag-name"), "show tag"); assert.ok(exists(".tag-info .tag-name"), "show tag");
@@ -392,12 +392,16 @@ acceptance("Tag info", function (needs) {
queryAll(".tag-info .tag-associations").text().indexOf("Gardening") >= 0, queryAll(".tag-info .tag-associations").text().indexOf("Gardening") >= 0,
"show tag group names" "show tag group names"
); );
assert.equal( assert.strictEqual(
count(".tag-info .synonyms-list .tag-box"), count(".tag-info .synonyms-list .tag-box"),
2, 2,
"shows the synonyms" "shows the synonyms"
); );
assert.equal(count(".tag-info .badge-category"), 1, "show the category"); assert.strictEqual(
count(".tag-info .badge-category"),
1,
"show the category"
);
assert.ok(!exists("#rename-tag"), "can't rename tag"); assert.ok(!exists("#rename-tag"), "can't rename tag");
assert.ok(!exists("#edit-synonyms"), "can't edit synonyms"); assert.ok(!exists("#edit-synonyms"), "can't edit synonyms");
assert.ok(!exists("#delete-tag"), "can't delete tag"); assert.ok(!exists("#delete-tag"), "can't delete tag");
@@ -407,7 +411,7 @@ acceptance("Tag info", function (needs) {
updateCurrentUser({ moderator: false, admin: true }); updateCurrentUser({ moderator: false, admin: true });
await visit("/tag/happy-monkey"); await visit("/tag/happy-monkey");
assert.equal(count("#show-tag-info"), 1); assert.strictEqual(count("#show-tag-info"), 1);
await click("#show-tag-info"); await click("#show-tag-info");
assert.ok(exists(".tag-info .tag-name"), "show tag"); assert.ok(exists(".tag-info .tag-name"), "show tag");
@@ -431,14 +435,14 @@ acceptance("Tag info", function (needs) {
await click(".category-breadcrumb .category-drop-header"); await click(".category-breadcrumb .category-drop-header");
await click('.category-breadcrumb .category-row[data-name="faq"]'); await click('.category-breadcrumb .category-row[data-name="faq"]');
assert.equal(currentURL(), "/tags/c/faq/4/planters"); assert.strictEqual(currentURL(), "/tags/c/faq/4/planters");
}); });
test("admin can manage tags", async function (assert) { test("admin can manage tags", async function (assert) {
updateCurrentUser({ moderator: false, admin: true }); updateCurrentUser({ moderator: false, admin: true });
await visit("/tag/planters"); await visit("/tag/planters");
assert.equal(count("#show-tag-info"), 1); assert.strictEqual(count("#show-tag-info"), 1);
await click("#show-tag-info"); await click("#show-tag-info");
assert.ok(exists("#rename-tag"), "can rename tag"); assert.ok(exists("#rename-tag"), "can rename tag");
@@ -447,10 +451,14 @@ acceptance("Tag info", function (needs) {
await click("#edit-synonyms"); await click("#edit-synonyms");
assert.ok(count(".unlink-synonym:visible"), 2, "unlink UI is visible"); assert.ok(count(".unlink-synonym:visible"), 2, "unlink UI is visible");
assert.equal(count(".delete-synonym:visible"), 2, "delete UI is visible"); assert.strictEqual(
count(".delete-synonym:visible"),
2,
"delete UI is visible"
);
await click(".unlink-synonym:nth-of-type(1)"); await click(".unlink-synonym:nth-of-type(1)");
assert.equal( assert.strictEqual(
count(".tag-info .synonyms-list .tag-box"), count(".tag-info .synonyms-list .tag-box"),
1, 1,
"removed a synonym" "removed a synonym"
@@ -461,6 +469,6 @@ acceptance("Tag info", function (needs) {
await visit("/tag/planters"); await visit("/tag/planters");
await click("#create-topic"); await click("#create-topic");
let composer = this.owner.lookup("controller:composer"); let composer = this.owner.lookup("controller:composer");
assert.equal(composer.get("model").tags, null); assert.strictEqual(composer.get("model").tags, undefined);
}); });
}); });

View File

@@ -51,7 +51,7 @@ acceptance("Topic - Admin Menu", function (needs) {
assert.ok(exists("#topic"), "The topic was rendered"); assert.ok(exists("#topic"), "The topic was rendered");
await click(".toggle-admin-menu"); await click(".toggle-admin-menu");
assert.equal( assert.strictEqual(
document.activeElement, document.activeElement,
document.querySelector(".topic-admin-multi-select > button") document.querySelector(".topic-admin-multi-select > button")
); );

View File

@@ -21,13 +21,13 @@ acceptance("Topic Discovery", function (needs) {
assert.ok(exists(".topic-list"), "The list of topics was rendered"); assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.ok(exists(".topic-list .topic-list-item"), "has topics"); assert.ok(exists(".topic-list .topic-list-item"), "has topics");
assert.equal( assert.strictEqual(
queryAll("a[data-user-card=eviltrout] img.avatar").attr("title"), queryAll("a[data-user-card=eviltrout] img.avatar").attr("title"),
"Evil Trout - Most Posts", "Evil Trout - Most Posts",
"it shows user's full name in avatar title" "it shows user's full name in avatar title"
); );
assert.equal( assert.strictEqual(
queryAll("a[data-user-card=eviltrout] img.avatar").attr("loading"), queryAll("a[data-user-card=eviltrout] img.avatar").attr("loading"),
"lazy", "lazy",
"it adds loading=`lazy` to topic list avatars" "it adds loading=`lazy` to topic list avatars"

View File

@@ -133,8 +133,8 @@ acceptance("Topic - Edit timer", function (needs) {
await timerType.expand(); await timerType.expand();
await timerType.selectRowByValue("publish_to_category"); await timerType.selectRowByValue("publish_to_category");
assert.equal(categoryChooser.header().label(), "uncategorized"); assert.strictEqual(categoryChooser.header().label(), "uncategorized");
assert.equal(categoryChooser.header().value(), null); assert.strictEqual(categoryChooser.header().value(), null);
await categoryChooser.expand(); await categoryChooser.expand();
await categoryChooser.selectRowByValue("7"); await categoryChooser.selectRowByValue("7");
@@ -157,7 +157,7 @@ acceptance("Topic - Edit timer", function (needs) {
} }
); );
assert.equal(text, el.innerText); assert.strictEqual(text, el.innerText);
}); });
test("schedule publish to category - visible for a private category", async function (assert) { test("schedule publish to category - visible for a private category", async function (assert) {
@@ -173,8 +173,8 @@ acceptance("Topic - Edit timer", function (needs) {
await timerType.expand(); await timerType.expand();
await timerType.selectRowByValue("publish_to_category"); await timerType.selectRowByValue("publish_to_category");
assert.equal(categoryChooser.header().label(), "uncategorized"); assert.strictEqual(categoryChooser.header().label(), "uncategorized");
assert.equal(categoryChooser.header().value(), null); assert.strictEqual(categoryChooser.header().value(), null);
await categoryChooser.expand(); await categoryChooser.expand();
await categoryChooser.selectRowByValue("7"); await categoryChooser.selectRowByValue("7");
@@ -197,7 +197,7 @@ acceptance("Topic - Edit timer", function (needs) {
} }
); );
assert.equal(text, el.innerText); assert.strictEqual(text, el.innerText);
}); });
test("schedule publish to category - visible for an unlisted public topic", async function (assert) { test("schedule publish to category - visible for an unlisted public topic", async function (assert) {
@@ -217,8 +217,8 @@ acceptance("Topic - Edit timer", function (needs) {
await timerType.expand(); await timerType.expand();
await timerType.selectRowByValue("publish_to_category"); await timerType.selectRowByValue("publish_to_category");
assert.equal(categoryChooser.header().label(), "uncategorized"); assert.strictEqual(categoryChooser.header().label(), "uncategorized");
assert.equal(categoryChooser.header().value(), null); assert.strictEqual(categoryChooser.header().value(), null);
await categoryChooser.expand(); await categoryChooser.expand();
await categoryChooser.selectRowByValue("7"); await categoryChooser.selectRowByValue("7");
@@ -241,7 +241,7 @@ acceptance("Topic - Edit timer", function (needs) {
} }
); );
assert.equal(text, el.innerText); assert.strictEqual(text, el.innerText);
}); });
test("schedule publish to category - last custom date and time", async function (assert) { test("schedule publish to category - last custom date and time", async function (assert) {
@@ -338,11 +338,11 @@ acceptance("Topic - Edit timer", function (needs) {
await click(".edit-topic-timer-buttons button.btn-primary"); await click(".edit-topic-timer-buttons button.btn-primary");
const removeTimerButton = queryAll(".topic-timer-info .topic-timer-remove"); const removeTimerButton = queryAll(".topic-timer-info .topic-timer-remove");
assert.equal(removeTimerButton.attr("title"), "remove timer"); assert.strictEqual(removeTimerButton.attr("title"), "remove timer");
await click(".topic-timer-info .topic-timer-remove"); await click(".topic-timer-info .topic-timer-remove");
const topicTimerInfo = queryAll(".topic-timer-info .topic-timer-remove"); const topicTimerInfo = queryAll(".topic-timer-info .topic-timer-remove");
assert.equal(topicTimerInfo.length, 0); assert.strictEqual(topicTimerInfo.length, 0);
}); });
test("Shows correct time frame options", async function (assert) { test("Shows correct time frame options", async function (assert) {

View File

@@ -40,12 +40,12 @@ acceptance("Topic footer buttons mobile", function (needs) {
test("default", async function (assert) { test("default", async function (assert) {
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
assert.equal(_test, null); assert.strictEqual(_test, undefined);
const subject = selectKit(".topic-footer-mobile-dropdown"); const subject = selectKit(".topic-footer-mobile-dropdown");
await subject.expand(); await subject.expand();
await subject.selectRowByValue("my-button"); await subject.selectRowByValue("my-button");
assert.equal(_test, 2); assert.strictEqual(_test, 2);
}); });
}); });

View File

@@ -11,14 +11,14 @@ acceptance("Topic list tracking", function () {
test("Navigation", async function (assert) { test("Navigation", async function (assert) {
await visit("/"); await visit("/");
let url = await nextTopicUrl(); let url = await nextTopicUrl();
assert.equal(url, "/t/error-after-upgrade-to-0-9-7-9/11557"); assert.strictEqual(url, "/t/error-after-upgrade-to-0-9-7-9/11557");
setTopicId(11557); setTopicId(11557);
url = await nextTopicUrl(); url = await nextTopicUrl();
assert.equal(url, "/t/welcome-to-meta-discourse-org/1"); assert.strictEqual(url, "/t/welcome-to-meta-discourse-org/1");
url = await previousTopicUrl(); url = await previousTopicUrl();
assert.equal(url, "/t/error-after-upgrade-to-0-9-7-9/11557"); assert.strictEqual(url, "/t/error-after-upgrade-to-0-9-7-9/11557");
}); });
}); });

View File

@@ -12,7 +12,7 @@ acceptance("Topic move posts", function (needs) {
await click(".topic-admin-multi-select .btn"); await click(".topic-admin-multi-select .btn");
await click("#post_11 .select-below"); await click("#post_11 .select-below");
assert.equal( assert.strictEqual(
queryAll(".selected-posts .move-to-topic").text().trim(), queryAll(".selected-posts .move-to-topic").text().trim(),
I18n.t("topic.move_to.action"), I18n.t("topic.move_to.action"),
"it should show the move to button" "it should show the move to button"
@@ -91,7 +91,7 @@ acceptance("Topic move posts", function (needs) {
await click(".topic-admin-multi-select .btn"); await click(".topic-admin-multi-select .btn");
await click("#post_1 .select-post"); await click("#post_1 .select-post");
assert.equal( assert.strictEqual(
queryAll(".selected-posts .move-to-topic").text().trim(), queryAll(".selected-posts .move-to-topic").text().trim(),
I18n.t("topic.move_to.action"), I18n.t("topic.move_to.action"),
"it should show the move to button" "it should show the move to button"
@@ -127,7 +127,7 @@ acceptance("Topic move posts", function (needs) {
await click(".topic-admin-multi-select .btn"); await click(".topic-admin-multi-select .btn");
await click("#post_2 .select-below"); await click("#post_2 .select-below");
assert.equal( assert.strictEqual(
queryAll(".selected-posts .move-to-topic").text().trim(), queryAll(".selected-posts .move-to-topic").text().trim(),
I18n.t("topic.move_to.action"), I18n.t("topic.move_to.action"),
"it should show the move to button" "it should show the move to button"

View File

@@ -27,7 +27,7 @@ acceptance("Topic Notifications button", function (needs) {
await notificationOptions.expand(); await notificationOptions.expand();
await notificationOptions.selectRowByValue("3"); await notificationOptions.selectRowByValue("3");
assert.equal( assert.strictEqual(
notificationOptions.header().label(), notificationOptions.header().label(),
"Watching", "Watching",
"it should display the right notification level" "it should display the right notification level"
@@ -37,7 +37,7 @@ acceptance("Topic Notifications button", function (needs) {
".topic-timeline .widget-component-connector .topic-notifications-options" ".topic-timeline .widget-component-connector .topic-notifications-options"
); );
assert.equal( assert.strictEqual(
timelineNotificationOptions.header().value(), timelineNotificationOptions.header().value(),
"3", "3",
"it should display the right notification level" "it should display the right notification level"
@@ -46,13 +46,13 @@ acceptance("Topic Notifications button", function (needs) {
await timelineNotificationOptions.expand(); await timelineNotificationOptions.expand();
await timelineNotificationOptions.selectRowByValue("0"); await timelineNotificationOptions.selectRowByValue("0");
assert.equal( assert.strictEqual(
timelineNotificationOptions.header().value(), timelineNotificationOptions.header().value(),
"0", "0",
"it should display the right notification level" "it should display the right notification level"
); );
assert.equal( assert.strictEqual(
notificationOptions.header().label(), notificationOptions.header().label(),
"Muted", "Muted",
"it should display the right notification level" "it should display the right notification level"

View File

@@ -54,7 +54,7 @@ acceptance("Topic - Quote button - logged in", function (needs) {
await selectText("#post_3 aside.onebox p"); await selectText("#post_3 aside.onebox p");
await click(".insert-quote"); await click(".insert-quote");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().trim(), queryAll(".d-editor-input").val().trim(),
'[quote="group_moderator, post:3, topic:2480"]\nhttps://example.com/57350945\n[/quote]', '[quote="group_moderator, post:3, topic:2480"]\nhttps://example.com/57350945\n[/quote]',
"quote only contains a link" "quote only contains a link"

View File

@@ -40,7 +40,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {
await click(".topic-admin-slow-mode button"); await click(".topic-admin-slow-mode button");
const slowModeType = selectKit(".slow-mode-type"); const slowModeType = selectKit(".slow-mode-type");
assert.equal( assert.strictEqual(
slowModeType.header().name(), slowModeType.header().name(),
I18n.t("topic.slow_mode_update.durations.10_minutes"), I18n.t("topic.slow_mode_update.durations.10_minutes"),
"slow mode interval is rendered" "slow mode interval is rendered"
@@ -50,7 +50,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {
// but at least we can make sure that components for choosing date and time are rendered // but at least we can make sure that components for choosing date and time are rendered
// (in case of inactive slow mode it would be only a combo box with text "Select a timeframe", // (in case of inactive slow mode it would be only a combo box with text "Select a timeframe",
// and date picker and time picker wouldn't be rendered) // and date picker and time picker wouldn't be rendered)
assert.equal( assert.strictEqual(
query("div.enabled-until span.name").innerText, query("div.enabled-until span.name").innerText,
I18n.t("topic.auto_update_input.pick_date_and_time"), I18n.t("topic.auto_update_input.pick_date_and_time"),
"enabled until combobox is switched to the option Pick Date and Time" "enabled until combobox is switched to the option Pick Date and Time"
@@ -66,7 +66,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {
await click(".topic-admin-slow-mode button"); await click(".topic-admin-slow-mode button");
await click(".future-date-input-selector-header"); await click(".future-date-input-selector-header");
assert.equal( assert.strictEqual(
query("div.modal-footer button.btn-primary span").innerText, query("div.modal-footer button.btn-primary span").innerText,
I18n.t("topic.slow_mode_update.enable"), I18n.t("topic.slow_mode_update.enable"),
"shows 'Enable' button when slow mode is disabled" "shows 'Enable' button when slow mode is disabled"
@@ -77,7 +77,7 @@ acceptance("Topic - Slow Mode - enabled", function (needs) {
await click(".topic-admin-slow-mode button"); await click(".topic-admin-slow-mode button");
await click(".future-date-input-selector-header"); await click(".future-date-input-selector-header");
assert.equal( assert.strictEqual(
query("div.modal-footer button.btn-primary span").innerText, query("div.modal-footer button.btn-primary span").innerText,
I18n.t("topic.slow_mode_update.update"), I18n.t("topic.slow_mode_update.update"),
"shows 'Update' button when slow mode is enabled" "shows 'Update' button when slow mode is enabled"

View File

@@ -29,12 +29,12 @@ acceptance("Topic", function (needs) {
assert.ok(exists(".d-editor-input"), "the composer input is visible"); assert.ok(exists(".d-editor-input"), "the composer input is visible");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().trim(), queryAll(".d-editor-input").val().trim(),
`Continuing the discussion from [Internationalization / localization](${window.location.origin}/t/internationalization-localization/280):`, `Continuing the discussion from [Internationalization / localization](${window.location.origin}/t/internationalization-localization/280):`,
"it fills composer with the ring string" "it fills composer with the ring string"
); );
assert.equal( assert.strictEqual(
selectKit(".category-chooser").header().value(), selectKit(".category-chooser").header().value(),
"2", "2",
"it fills category selector with the right category" "it fills category selector with the right category"
@@ -48,14 +48,14 @@ acceptance("Topic", function (needs) {
assert.ok(exists(".d-editor-input"), "the composer input is visible"); assert.ok(exists(".d-editor-input"), "the composer input is visible");
assert.equal( assert.strictEqual(
queryAll(".d-editor-input").val().trim(), queryAll(".d-editor-input").val().trim(),
`Continuing the discussion from [PM for testing](${window.location.origin}/t/pm-for-testing/12):`, `Continuing the discussion from [PM for testing](${window.location.origin}/t/pm-for-testing/12):`,
"it fills composer with the ring string" "it fills composer with the ring string"
); );
const privateMessageUsers = selectKit("#private-message-users"); const privateMessageUsers = selectKit("#private-message-users");
assert.equal( assert.strictEqual(
privateMessageUsers.header().value(), privateMessageUsers.header().value(),
"someguy,test,Group", "someguy,test,Group",
"it fills up the composer correctly" "it fills up the composer correctly"
@@ -96,12 +96,12 @@ acceptance("Topic", function (needs) {
await categoryChooser.selectRowByValue(4); await categoryChooser.selectRowByValue(4);
await click("#topic-title .submit-edit"); await click("#topic-title .submit-edit");
assert.equal( assert.strictEqual(
queryAll("#topic-title .badge-category").text(), queryAll("#topic-title .badge-category").text(),
"faq", "faq",
"it displays the new category" "it displays the new category"
); );
assert.equal( assert.strictEqual(
queryAll(".fancy-title").text().trim(), queryAll(".fancy-title").text().trim(),
"this is the new title", "this is the new title",
"it displays the new title" "it displays the new title"
@@ -117,13 +117,13 @@ acceptance("Topic", function (needs) {
await click(".topic-post:nth-of-type(1) button.show-post-admin-menu"); await click(".topic-post:nth-of-type(1) button.show-post-admin-menu");
await click(".btn.wiki"); await click(".btn.wiki");
assert.equal(count("button.wiki"), 1, "it shows the wiki icon"); assert.strictEqual(count("button.wiki"), 1, "it shows the wiki icon");
}); });
test("Visit topic routes", async function (assert) { test("Visit topic routes", async function (assert) {
await visit("/t/12"); await visit("/t/12");
assert.equal( assert.strictEqual(
queryAll(".fancy-title").text().trim(), queryAll(".fancy-title").text().trim(),
"PM for testing", "PM for testing",
"it routes to the right topic" "it routes to the right topic"
@@ -131,7 +131,7 @@ acceptance("Topic", function (needs) {
await visit("/t/280/20"); await visit("/t/280/20");
assert.equal( assert.strictEqual(
queryAll(".fancy-title").text().trim(), queryAll(".fancy-title").text().trim(),
"Internationalization / localization", "Internationalization / localization",
"it routes to the right topic" "it routes to the right topic"
@@ -187,7 +187,7 @@ acceptance("Topic", function (needs) {
test("Suggested topics", async function (assert) { test("Suggested topics", async function (assert) {
await visit("/t/internationalization-localization/280"); await visit("/t/internationalization-localization/280");
assert.equal( assert.strictEqual(
queryAll("#suggested-topics .suggested-topics-title").text().trim(), queryAll("#suggested-topics .suggested-topics-title").text().trim(),
I18n.t("suggested_topics.title") I18n.t("suggested_topics.title")
); );
@@ -242,8 +242,8 @@ acceptance("Topic featured links", function (needs) {
await visit("/t/-/299/1"); await visit("/t/-/299/1");
const link = queryAll(".title-wrapper .topic-featured-link"); const link = queryAll(".title-wrapper .topic-featured-link");
assert.equal(link.text(), " example.com"); assert.strictEqual(link.text(), " example.com");
assert.equal(link.attr("rel"), "ugc"); assert.strictEqual(link.attr("rel"), "ugc");
}); });
test("remove featured link", async function (assert) { test("remove featured link", async function (assert) {

Some files were not shown because too many files have changed in this diff Show More