Skip to content
This repository has been archived by the owner on May 27, 2022. It is now read-only.

Commit

Permalink
DEV: Add missing import, de-jQuerify (discourse#13461)
Browse files Browse the repository at this point in the history
  • Loading branch information
CvX authored Jun 21, 2021
1 parent 83a6ad3 commit c3e4389
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
acceptance,
exists,
query,
queryAll,
} from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { click, currentRouteName, fillIn, visit } from "@ember/test-helpers";
Expand All @@ -14,7 +14,7 @@ acceptance("Managing Group Email Settings - SMTP Disabled", function (needs) {
test("When SiteSetting.enable_smtp is false", async function (assert) {
await visit("/g/discourse/manage/email");
assert.notOk(
queryAll(".user-secondary-navigation").text().includes("Email"),
query(".user-secondary-navigation").innerText.includes("Email"),
"email link is not shown in the sidebar"
);
assert.equal(
Expand All @@ -34,7 +34,7 @@ acceptance(
test("When SiteSetting.enable_smtp is true but SiteSetting.enable_imap is false", async function (assert) {
await visit("/g/discourse/manage/email");
assert.ok(
queryAll(".user-secondary-navigation").text().includes("Email"),
query(".user-secondary-navigation").innerText.includes("Email"),
"email link is shown in the sidebar"
);
assert.equal(
Expand Down Expand Up @@ -72,7 +72,7 @@ acceptance(
test("enabling SMTP, testing, and saving", async function (assert) {
await visit("/g/discourse/manage/email");
assert.ok(
queryAll(".user-secondary-navigation").text().includes("Email"),
query(".user-secondary-navigation").innerText.includes("Email"),
"email link is shown in the sidebar"
);
assert.ok(
Expand All @@ -85,12 +85,12 @@ acceptance(

await click("#prefill_smtp_gmail");
assert.equal(
queryAll("input[name='smtp_server']").val(),
query("input[name='smtp_server']").value,
"smtp.gmail.com",
"prefills SMTP server settings for gmail"
);
assert.equal(
queryAll("input[name='smtp_port']").val(),
query("input[name='smtp_port']").value,
"587",
"prefills SMTP port settings for gmail"
);
Expand All @@ -113,7 +113,7 @@ acceptance(
await click(".group-manage-save");

assert.equal(
queryAll(".group-manage-save-button > span").text(),
query(".group-manage-save-button > span").innerText,
"Saved!"
);

Expand All @@ -124,7 +124,7 @@ acceptance(

await click("#enable_smtp");
assert.equal(
queryAll(".modal-body").text(),
query(".modal-body").innerText,
I18n.t("groups.manage.email.smtp_disable_confirm"),
"shows a confirm dialogue warning SMTP settings will be wiped"
);
Expand Down Expand Up @@ -156,12 +156,12 @@ acceptance(

await click("#prefill_imap_gmail");
assert.equal(
queryAll("input[name='imap_server']").val(),
query("input[name='imap_server']").value,
"imap.gmail.com",
"prefills IMAP server settings for gmail"
);
assert.equal(
queryAll("input[name='imap_port']").val(),
query("input[name='imap_port']").value,
"993",
"prefills IMAP port settings for gmail"
);
Expand All @@ -176,7 +176,7 @@ acceptance(
await click(".group-manage-save");

assert.equal(
queryAll(".group-manage-save-button > span").text(),
query(".group-manage-save-button > span").innerText,
"Saved!"
);

Expand All @@ -200,7 +200,7 @@ acceptance(

await click("#enable_imap");
assert.equal(
queryAll(".modal-body").text(),
query(".modal-body").innerText,
I18n.t("groups.manage.email.imap_disable_confirm"),
"shows a confirm dialogue warning IMAP settings will be wiped"
);
Expand Down Expand Up @@ -360,7 +360,7 @@ acceptance(
// await click(".test-smtp-settings");

// assert.equal(
// queryAll(".modal-body").text(),
// query(".modal-body").innerText,
// "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"
// );
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { currentURL, triggerKeyEvent, visit } from "@ember/test-helpers";
import { cloneJSON } from "discourse-common/lib/object";
import I18n from "I18n";
import { acceptance, queryAll } from "discourse/tests/helpers/qunit-helpers";
import {
acceptance,
exists,
query,
} from "discourse/tests/helpers/qunit-helpers";
import DiscoveryFixtures from "discourse/tests/fixtures/discovery-fixtures";
import { test } from "qunit";

Expand Down Expand Up @@ -87,7 +91,7 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
await triggerKeyEvent(document, "keypress", "t".charCodeAt(0));
assert.ok(exists("#dismiss-read-confirm"));
assert.equal(
queryAll(".modal-body").text().trim(),
query(".modal-body").innerText,
I18n.t("topics.bulk.also_dismiss_topics")
);
await click("#dismiss-read-confirm");
Expand All @@ -107,7 +111,7 @@ acceptance("Keyboard Shortcuts - Authenticated Users", function (needs) {
await triggerKeyEvent(document, "keypress", "t".charCodeAt(0));
assert.ok(exists("#dismiss-read-confirm"));
assert.equal(
queryAll(".modal-body").text().trim(),
query(".modal-body").innerText,
"Stop tracking these topics so they never show up as unread for me again"
);
await click("#dismiss-read-confirm");
Expand Down

0 comments on commit c3e4389

Please sign in to comment.