Merge master

This commit is contained in:
Neil Lalonde
2020-06-24 13:47:36 -04:00
4650 changed files with 229833 additions and 157327 deletions
@@ -1,5 +1,5 @@
import { acceptance } from "helpers/qunit-helpers";
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
acceptance("Account Created");
@@ -1,4 +1,5 @@
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Admin - Emails", { loggedIn: true });
@@ -16,15 +17,14 @@ Hello, this is a test!
This part should be elided.`.trim();
QUnit.test("shows selected and elided text", async assert => {
// prettier-ignore
server.post("/admin/email/advanced-test", () => { // eslint-disable-line no-undef
pretender.post("/admin/email/advanced-test", () => {
return [
200,
{ "Content-Type": "application/json" },
{
format: 1,
text: "Hello, this is a test!",
elided: "---\n\nThis part should be elided.",
elided: "---\n\nThis part should be elided."
}
];
});
@@ -10,7 +10,7 @@ acceptance("Admin - Site Settings", {
},
pretend(server, helper) {
server.put("/admin/site_settings/title", body => {
server.put("/admin/site_settings/title", (body) => {
titleOverride = body.requestBody.split("=")[1];
return helper.response({ success: "OK" });
});
@@ -22,14 +22,14 @@ acceptance("Admin - Site Settings", {
titleSetting.value = titleOverride;
}
const response = {
site_settings: [titleSetting, ...fixtures.slice(1)]
site_settings: [titleSetting, ...fixtures.slice(1)],
};
return helper.response(response);
});
}
},
});
QUnit.test("upload site setting", async assert => {
QUnit.test("upload site setting", async (assert) => {
await visit("/admin/site_settings");
assert.ok(
@@ -40,7 +40,7 @@ QUnit.test("upload site setting", async assert => {
assert.ok(exists(".row.setting.upload .undo"), "undo button is present");
});
QUnit.test("changing value updates dirty state", async assert => {
QUnit.test("changing value updates dirty state", async (assert) => {
await visit("/admin/site_settings");
await fillIn("#setting-filter", " title ");
assert.equal(count(".row.setting"), 1, "filter returns 1 site setting");
@@ -89,7 +89,7 @@ QUnit.test("changing value updates dirty state", async assert => {
QUnit.test(
"always shows filtered site settings if a filter is set",
async assert => {
async (assert) => {
await visit("/admin/site_settings");
await fillIn("#setting-filter", "title");
assert.equal(count(".row.setting"), 1);
@@ -103,3 +103,14 @@ QUnit.test(
assert.equal(count(".row.setting"), 1);
}
);
QUnit.test("filter settings by plugin name", async (assert) => {
await visit("/admin/site_settings");
await fillIn("#setting-filter", "plugin:discourse-logo");
assert.equal(count(".row.setting"), 1);
// inexistent plugin
await fillIn("#setting-filter", "plugin:discourse-plugin");
assert.equal(count(".row.setting"), 0);
});
@@ -27,15 +27,14 @@ QUnit.test("edit and revert a site text by key", async assert => {
await visit("/admin/customize/site_texts/site.test");
assert.equal(find(".title h3").text(), "site.test");
assert.ok(!exists(".save-messages .saved"));
assert.ok(!exists(".save-messages .saved"));
assert.ok(!exists(".saved"));
assert.ok(!exists(".revert-site-text"));
// Change the value
await fillIn(".site-text-value", "New Test Value");
await click(".save-changes");
assert.ok(exists(".save-messages .saved"));
assert.ok(exists(".saved"));
assert.ok(exists(".revert-site-text"));
// Revert the changes
@@ -45,6 +44,6 @@ QUnit.test("edit and revert a site text by key", async assert => {
await click(".bootbox.modal .btn-primary");
assert.ok(!exists(".save-messages .saved"));
assert.ok(!exists(".saved"));
assert.ok(!exists(".revert-site-text"));
});
@@ -1,20 +1,8 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Admin - User Emails", { loggedIn: true });
const responseWithSecondary = secondaryEmails => {
return [
200,
{ "Content-Type": "application/json" },
{
id: 1,
username: "eviltrout",
email: "eviltrout@example.com",
secondary_emails: secondaryEmails
}
];
};
const assertNoSecondary = assert => {
assert.equal(
find(".display-row.email .value a").text(),
@@ -31,49 +19,40 @@ const assertNoSecondary = assert => {
);
};
const assertMultipleSecondary = assert => {
const assertMultipleSecondary = (assert, firstEmail, secondEmail) => {
assert.equal(
find(".display-row.secondary-emails .value li:first-of-type a").text(),
"eviltrout1@example.com",
firstEmail,
"it should display the first secondary email"
);
assert.equal(
find(".display-row.secondary-emails .value li:last-of-type a").text(),
"eviltrout2@example.com",
secondEmail,
"it should display the second secondary email"
);
};
QUnit.test("viewing self without secondary emails", async assert => {
// prettier-ignore
server.get("/admin/users/1.json", () => { // eslint-disable-line no-undef
return responseWithSecondary([]);
});
await visit("/admin/users/1/eviltrout");
assertNoSecondary(assert);
});
QUnit.test("viewing self with multiple secondary emails", async assert => {
// prettier-ignore
server.get("/admin/users/1.json", () => { // eslint-disable-line no-undef
return responseWithSecondary([
"eviltrout1@example.com",
"eviltrout2@example.com",
]);
});
await visit("/admin/users/1/eviltrout");
await visit("/admin/users/3/markvanlan");
assert.equal(
find(".display-row.email .value a").text(),
"eviltrout@example.com",
"markvanlan@example.com",
"it should display the user's primary email"
);
assertMultipleSecondary(assert);
assertMultipleSecondary(
assert,
"markvanlan1@example.com",
"markvanlan2@example.com"
);
});
QUnit.test("viewing another user with no secondary email", async assert => {
@@ -84,20 +63,12 @@ QUnit.test("viewing another user with no secondary email", async assert => {
});
QUnit.test("viewing another account with secondary emails", async assert => {
// prettier-ignore
server.get("/u/regular/emails.json", () => { // eslint-disable-line no-undef
return [
200,
{ "Content-Type": "application/json" },
{
email: "eviltrout@example.com",
secondary_emails: ["eviltrout1@example.com", "eviltrout2@example.com"]
}
];
});
await visit("/admin/users/1234/regular");
await visit("/admin/users/1235/regular1");
await click(`.display-row.secondary-emails button`);
assertMultipleSecondary(assert);
assertMultipleSecondary(
assert,
"regular2alt1@example.com",
"regular2alt2@example.com"
);
});
@@ -1,10 +1,11 @@
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Admin - User Index", {
loggedIn: true,
pretend(server, helper) {
server.get("/groups/search.json", () => {
pretend(pretenderServer, helper) {
pretenderServer.get("/groups/search.json", () => {
return helper.response([
{
id: 42,
@@ -14,7 +15,6 @@ acceptance("Admin - User Index", {
alias_level: 99,
visible: true,
automatic_membership_email_domains: "",
automatic_membership_retroactive: false,
primary_group: false,
title: null,
grant_trust_level: null,
@@ -35,10 +35,11 @@ acceptance("Admin - User Index", {
});
QUnit.test("can edit username", async assert => {
/* global server */
server.put("/users/sam/preferences/username", () => [
pretender.put("/users/sam/preferences/username", () => [
200,
{ "Content-Type": "application/json" },
{
"Content-Type": "application/json"
},
{ id: 2, username: "new-sam" }
]);
@@ -85,10 +86,10 @@ QUnit.test("will clear unsaved groups when switching user", async assert => {
"the name should be correct"
);
const groupSelector = selectKit(".admin-group-selector");
await groupSelector.expand();
await groupSelector.selectRowByValue(42);
assert.equal(groupSelector.header().value(), 42, "group should be set");
const groupChooser = selectKit(".group-chooser");
await groupChooser.expand();
await groupChooser.selectRowByValue(42);
assert.equal(groupChooser.header().value(), 42, "group should be set");
await visit("/admin/users/1/eviltrout");
@@ -101,7 +102,7 @@ QUnit.test("will clear unsaved groups when switching user", async assert => {
);
assert.equal(
find('.admin-group-selector span[title="Macdonald"]').length,
find('.group-chooser span[title="Macdonald"]').length,
0,
"group should not be set"
);
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Admin - Users List", { loggedIn: true });
@@ -59,7 +60,7 @@ QUnit.test("switching tabs", async assert => {
const activeUser = "eviltrout";
const suspectUser = "sam";
const activeTitle = I18n.t("admin.users.titles.active");
const suspectTitle = I18n.t("admin.users.titles.suspect");
const suspectTitle = I18n.t("admin.users.titles.new");
await visit("/admin/users/list/active");
@@ -70,7 +71,7 @@ QUnit.test("switching tabs", async assert => {
.includes(activeUser)
);
await click('a[href="/admin/users/list/suspect"]');
await click('a[href="/admin/users/list/new"]');
assert.equal(find(".admin-title h2").text(), suspectTitle);
assert.ok(
@@ -0,0 +1,254 @@
import I18n from "I18n";
import {
acceptance,
loggedInUser,
acceptanceUseFakeClock
} from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
import { parsePostData } from "helpers/create-pretender";
acceptance("Bookmarking", {
loggedIn: true,
afterEach() {
sandbox.restore();
}
});
function handleRequest(assert, request) {
const data = parsePostData(request.requestBody);
assert.step(data.reminder_type || "none");
return [
200,
{
"Content-Type": "application/json"
},
{
id: 999,
success: "OK"
}
];
}
function mockSuccessfulBookmarkPost(assert) {
pretender.post("/bookmarks", request => handleRequest(assert, request));
pretender.put("/bookmarks/999", request => handleRequest(assert, request));
}
async function openBookmarkModal() {
if (exists(".topic-post:first-child button.show-more-actions")) {
await click(".topic-post:first-child button.show-more-actions");
}
await click(".topic-post:first-child button.bookmark");
}
async function openEditBookmarkModal() {
await click(".topic-post:first-child button.bookmarked");
}
test("Bookmarks modal opening", async assert => {
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
assert.ok(exists("#bookmark-reminder-modal"), "it shows the bookmark modal");
});
test("Bookmarks modal selecting reminder type", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click("#tap_tile_tomorrow");
await openBookmarkModal();
await click("#tap_tile_start_of_next_business_week");
await openBookmarkModal();
await click("#tap_tile_next_week");
await openBookmarkModal();
await click("#tap_tile_next_month");
await openBookmarkModal();
await click("#tap_tile_custom");
assert.ok(exists("#tap_tile_custom.active"), "it selects custom");
assert.ok(exists(".tap-tile-date-input"), "it shows the custom date input");
assert.ok(exists(".tap-tile-time-input"), "it shows the custom time input");
await click("#save-bookmark");
assert.verifySteps([
"tomorrow",
"start_of_next_business_week",
"next_week",
"next_month",
"custom"
]);
});
test("Saving a bookmark with a reminder", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await fillIn("input#bookmark-name", "Check this out later");
await click("#tap_tile_tomorrow");
assert.ok(
exists(".topic-post:first-child button.bookmark.bookmarked"),
"it shows the bookmarked icon on the post"
);
assert.ok(
exists(
".topic-post:first-child button.bookmark.bookmarked > .d-icon-discourse-bookmark-clock"
),
"it shows the bookmark clock icon because of the reminder"
);
assert.verifySteps(["tomorrow"]);
});
test("Opening the options panel and remembering the option", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click(".bookmark-options-button");
assert.ok(
exists(".bookmark-options-panel"),
"it should open the options panel"
);
await click("#delete_when_reminder_sent");
await click("#save-bookmark");
await openEditBookmarkModal();
assert.ok(
exists(".bookmark-options-panel"),
"it should reopen the options panel"
);
assert.ok(
exists(".bookmark-options-panel #delete_when_reminder_sent:checked"),
"it should pre-check delete when reminder sent option"
);
assert.verifySteps(["none"]);
});
test("Saving a bookmark with no reminder or name", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click("#save-bookmark");
assert.ok(
exists(".topic-post:first-child button.bookmark.bookmarked"),
"it shows the bookmarked icon on the post"
);
assert.not(
exists(
".topic-post:first-child button.bookmark.bookmarked > .d-icon-discourse-bookmark-clock"
),
"it shows the regular bookmark active icon"
);
assert.verifySteps(["none"]);
});
test("Deleting a bookmark with a reminder", async assert => {
pretender.delete("/bookmarks/999", () => [
200,
{
"Content-Type": "application/json"
},
{
success: "OK",
topic_bookmarked: false
}
]);
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click("#tap_tile_tomorrow");
assert.verifySteps(["tomorrow"]);
await openEditBookmarkModal();
assert.ok(exists("#bookmark-reminder-modal"), "it shows the bookmark modal");
await click("#delete-bookmark");
assert.ok(exists(".bootbox.modal"), "it asks for delete confirmation");
assert.ok(
find(".bootbox.modal")
.text()
.includes(I18n.t("bookmarks.confirm_delete")),
"it shows delete confirmation message"
);
await click(".bootbox.modal .btn-primary");
assert.not(
exists(".topic-post:first-child button.bookmark.bookmarked"),
"it no longer shows the bookmarked icon on the post after bookmark is deleted"
);
});
test("Cancelling saving a bookmark", async assert => {
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await click(".d-modal-cancel");
assert.not(
exists(".topic-post:first-child button.bookmark.bookmarked"),
"it does not show the bookmarked icon on the post because it is not saved"
);
});
test("Editing a bookmark", async assert => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
let now = moment.tz(loggedInUser().resolvedTimezone(loggedInUser()));
let tomorrow = now.add(1, "day").format("YYYY-MM-DD");
await openBookmarkModal();
await fillIn("input#bookmark-name", "Test name");
await click("#tap_tile_tomorrow");
await openEditBookmarkModal();
assert.equal(
find("#bookmark-name").val(),
"Test name",
"it should prefill the bookmark name"
);
assert.equal(
find("#bookmark-custom-date > input").val(),
tomorrow,
"it should prefill the bookmark date"
);
assert.equal(
find("#bookmark-custom-time").val(),
"08:00",
"it should prefill the bookmark time"
);
assert.verifySteps(["tomorrow"]);
});
QUnit.skip(
"Editing a bookmark that has a Later Today reminder, and it is before 6pm today",
async assert => {
await acceptanceUseFakeClock("2020-05-04T13:00:00", async () => {
mockSuccessfulBookmarkPost(assert);
await visit("/t/internationalization-localization/280");
await openBookmarkModal();
await fillIn("input#bookmark-name", "Test name");
await click("#tap_tile_later_today");
await openEditBookmarkModal();
assert.not(
exists("#bookmark-custom-date > input"),
"it does not show the custom date input"
);
assert.ok(
exists("#tap_tile_later_today.active"),
"it preselects Later Today"
);
assert.verifySteps(["later_today"]);
});
}
);
@@ -0,0 +1,89 @@
import { acceptance } from "helpers/qunit-helpers";
import DiscoveryFixtures from "fixtures/discovery_fixtures";
acceptance("Category Banners", {
pretend(server, helper) {
server.get("/c/test-read-only-without-banner/5/l/latest.json", () => {
return helper.response(
DiscoveryFixtures["/latest_can_create_topic.json"]
);
});
server.get("/c/test-read-only-with-banner/6/l/latest.json", () => {
return helper.response(
DiscoveryFixtures["/latest_can_create_topic.json"]
);
});
},
loggedIn: true,
site: {
categories: [
{
id: 5,
name: "test read only without banner",
slug: "test-read-only-without-banner",
permission: null
},
{
id: 6,
name: "test read only with banner",
slug: "test-read-only-with-banner",
permission: null,
read_only_banner:
"You need to video yourself doing the secret handshake to post here"
}
]
}
});
QUnit.test("Does not display category banners when not set", async assert => {
await visit("/c/test-read-only-without-banner");
await click("#create-topic");
assert.ok(!visible(".bootbox.modal"), "it does not pop up a modal");
assert.ok(
!visible(".category-read-only-banner"),
"it does not show a banner"
);
});
QUnit.test("Displays category banners when set", async assert => {
await visit("/c/test-read-only-with-banner");
await click("#create-topic");
assert.ok(visible(".bootbox.modal"), "it pops up a modal");
await click(".modal-footer>.btn-primary");
assert.ok(!visible(".bootbox.modal"), "it closes the modal");
assert.ok(visible(".category-read-only-banner"), "it shows a banner");
});
acceptance("Anonymous Category Banners", {
pretend(server, helper) {
server.get("/c/test-read-only-with-banner/6/l/latest.json", () => {
return helper.response(
DiscoveryFixtures["/latest_can_create_topic.json"]
);
});
},
loggedIn: false,
site: {
categories: [
{
id: 6,
name: "test read only with banner",
slug: "test-read-only-with-banner",
permission: null,
read_only_banner:
"You need to video yourself doing the secret handshake to post here"
}
]
}
});
QUnit.test("Does not display category banners when set", async assert => {
await visit("/c/test-read-only-with-banner");
assert.ok(
!visible(".category-read-only-banner"),
"it does not show a banner"
);
});
@@ -29,3 +29,19 @@ QUnit.test("prefill category when category_id is set", async assert => {
1
);
});
QUnit.test("filter is case insensitive", async assert => {
const categoryChooser = selectKit(".category-chooser");
await visit("/");
await click("#create-topic");
await categoryChooser.expand();
await categoryChooser.fillInFilter("bug");
assert.ok(categoryChooser.rows().length, 1);
await categoryChooser.emptyFilter();
await categoryChooser.fillInFilter("Bug");
assert.ok(categoryChooser.rows().length, 1);
});
@@ -84,7 +84,7 @@ QUnit.test("adding a previously removed permission", async assert => {
await visit("/c/bug");
await click(".edit-category");
await await click("li.edit-category-security a");
await click("li.edit-category-security a");
await click(".edit-category-tab-security .edit-permission");
await click(
".edit-category-tab-security .permission-list li:first-of-type .remove-permission"
@@ -21,6 +21,11 @@ QUnit.test("Editing the category", async assert => {
await visit("/c/bug");
await click(".edit-category");
assert.equal(find(".d-modal .badge-category").text(), "bug");
await fillIn("input.category-name", "testing");
assert.equal(find(".d-modal .badge-category").text(), "testing");
await fillIn("#edit-text-color", "#ff0000");
await click(".edit-category-topic-template");
@@ -1,10 +1,10 @@
import pretender from "helpers/create-pretender";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Click Track", {});
QUnit.test("Do not track mentions", async assert => {
/* global server */
server.post("/clicks/track", () => assert.ok(false));
QUnit.skip("Do not track mentions", async assert => {
pretender.post("/clicks/track", () => assert.ok(false));
await visit("/t/internationalization-localization/280");
assert.ok(invisible(".user-card"), "card should not appear");
@@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import { _clearSnapshots } from "select-kit/components/composer-actions";
@@ -15,9 +16,30 @@ acceptance("Composer Actions", {
},
beforeEach() {
_clearSnapshots();
},
afterEach() {
_clearSnapshots();
}
});
QUnit.test(
"creating new topic and then reply_as_private_message keeps attributes",
async assert => {
await visit("/");
await click("button#create-topic");
await fillIn("#reply-title", "this is the title");
await fillIn(".d-editor-input", "this is the reply");
const composerActions = selectKit(".composer-actions");
await composerActions.expand();
await composerActions.selectRowByValue("reply_as_private_message");
assert.ok(find("#reply-title").val(), "this is the title");
assert.ok(find(".d-editor-input").val(), "this is the reply");
}
);
QUnit.test("replying to post", async assert => {
const composerActions = selectKit(".composer-actions");
@@ -147,12 +169,19 @@ QUnit.test("reply_as_new_topic without a new_topic draft", async assert => {
});
QUnit.test("hide component if no content", async assert => {
const composerActions = selectKit(".composer-actions");
await visit("/");
await click("button#create-topic");
await visit("/u/eviltrout/messages");
await click(".new-private-message");
const composerActions = selectKit(".composer-actions");
await composerActions.expand();
await composerActions.selectRowByValue("reply_as_private_message");
assert.ok(composerActions.el().hasClass("is-hidden"));
assert.equal(composerActions.el().children().length, 0);
await click("button#create-topic");
await composerActions.expand();
assert.equal(composerActions.rows().length, 2);
});
QUnit.test("interactions", async assert => {
@@ -339,6 +368,18 @@ QUnit.test(
}
);
QUnit.test("editing post", async assert => {
const composerActions = selectKit(".composer-actions");
await visit("/t/internationalization-localization/280");
await click("article#post_1 button.show-more-actions");
await click("article#post_1 button.edit");
await composerActions.expand();
assert.equal(composerActions.rows().length, 1);
assert.equal(composerActions.rowByIndex(0).value(), "reply_to_post");
});
acceptance("Composer Actions With New Topic Draft", {
loggedIn: true,
settings: {
@@ -350,18 +391,23 @@ acceptance("Composer Actions With New Topic Draft", {
beforeEach() {
_clearSnapshots();
},
pretend(server, helper) {
server.get("draft.json", () => {
return helper.response({
draft:
'{"reply":"dum de dum da ba.","action":"createTopic","title":"dum da ba dum dum","categoryId":null,"archetypeId":"regular","metaData":null,"composerTime":540879,"typingTime":3400}',
draft_sequence: 0
});
});
afterEach() {
_clearSnapshots();
}
});
const stubDraftResponse = () => {
sandbox.stub(Draft, "get").returns(
Promise.resolve({
draft:
'{"reply":"dum de dum da ba.","action":"createTopic","title":"dum da ba dum dum","categoryId":null,"archetypeId":"regular","metaData":null,"composerTime":540879,"typingTime":3400}',
draft_sequence: 0
})
);
};
QUnit.test("shared draft", async assert => {
stubDraftResponse();
try {
toggleCheckDraftPopup(true);
@@ -399,6 +445,7 @@ QUnit.test("shared draft", async assert => {
} finally {
toggleCheckDraftPopup(false);
}
sandbox.restore();
});
QUnit.test("reply_as_new_topic with new_topic draft", async assert => {
@@ -406,10 +453,12 @@ QUnit.test("reply_as_new_topic with new_topic draft", async assert => {
await click(".create.reply");
const composerActions = selectKit(".composer-actions");
await composerActions.expand();
stubDraftResponse();
await composerActions.selectRowByValue("reply_as_new_topic");
assert.equal(
find(".bootbox .modal-body").text(),
I18n.t("composer.composer_actions.reply_as_new_topic.confirm")
);
await click(".modal-footer .btn.btn-default");
sandbox.restore();
});
@@ -0,0 +1,69 @@
import { acceptance } from "helpers/qunit-helpers";
function setupPretender(server, helper) {
server.post("/uploads/lookup-urls", () => {
return helper.response([
{
short_url: "upload://asdsad.png",
url: "/secure-media-uploads/default/3X/1/asjdiasjdiasida.png",
short_path: "/uploads/short-url/asdsad.png"
}
]);
});
}
async function writeInComposer(assert) {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .btn.create");
await fillIn(".d-editor-input", "[test](upload://abcdefg.png)");
assert.equal(
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a href="/404">test</a></p>'
);
await fillIn(".d-editor-input", "[test|attachment](upload://asdsad.png)");
}
acceptance("Composer Attachment", {
loggedIn: true,
pretend(server, helper) {
setupPretender(server, helper);
}
});
QUnit.test("attachments are cooked properly", async assert => {
await writeInComposer(assert);
assert.equal(
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a class="attachment" href="/uploads/short-url/asdsad.png">test</a></p>'
);
});
acceptance("Composer Attachment - Secure Media Enabled", {
loggedIn: true,
settings: {
secure_media: true
},
pretend(server, helper) {
setupPretender(server, helper);
}
});
QUnit.test(
"attachments are cooked properly when secure media is enabled",
async assert => {
await writeInComposer(assert);
assert.equal(
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a class="attachment" href="/secure-media-uploads/default/3X/1/asjdiasjdiasida.png">test</a></p>'
);
}
);
@@ -1,39 +0,0 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("Composer Attachment", {
loggedIn: true,
pretend(server, helper) {
server.post("/uploads/lookup-urls", () => {
return helper.response([
{
short_url: "upload://asdsad.png",
url: "/uploads/default/3X/1/asjdiasjdiasida.png",
short_path: "/uploads/short-url/asdsad.png"
}
]);
});
}
});
QUnit.test("attachments are cooked properly", async assert => {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .btn.create");
await fillIn(".d-editor-input", "[test](upload://abcdefg.png)");
assert.equal(
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a href="/404">test</a></p>'
);
await fillIn(".d-editor-input", "[test|attachment](upload://asdsad.png)");
assert.equal(
find(".d-editor-preview:visible")
.html()
.trim(),
'<p><a class="attachment" href="/uploads/short-url/asdsad.png">test</a></p>'
);
});
@@ -1,18 +1,16 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Composer - Edit conflict", {
loggedIn: true
});
QUnit.test("Edit a post that causes an edit conflict", async assert => {
// prettier-ignore
server.put("/posts/398", () => [ // eslint-disable-line no-undef
409, { "Content-Type": "application/json" }, { errors: ["edit conflict"] }
]);
await visit("/t/internationalization-localization/280");
await click(".topic-post:eq(0) button.show-more-actions");
await click(".topic-post:eq(0) button.edit");
await fillIn(".d-editor-input", "this will 409");
await click("#reply-control button.create");
assert.equal(
find("#reply-control button.create")
@@ -28,14 +26,33 @@ QUnit.test("Edit a post that causes an edit conflict", async assert => {
await click(".modal .btn-primary");
});
function handleDraftPretender(assert) {
pretender.post("/draft.json", request => {
if (
request.requestBody.indexOf("%22reply%22%3A%22%22") === -1 &&
request.requestBody.indexOf("Any+plans+to+support+localization") !== -1
) {
assert.notEqual(request.requestBody.indexOf("originalText"), -1);
}
if (
request.requestBody.indexOf(
"draft_key=topic_280&sequence=4&data=%7B%22reply%22%3A%22hello+world+hello+world+hello+world+hello+world+hello+world%22%2C%22action%22%3A%22reply%22%2C%22categoryId%22%3A2%2C%22archetypeId%22%3A%22regular%22%2C%22metaData"
) !== -1
) {
assert.equal(
request.requestBody.indexOf("originalText"),
-1,
request.requestBody
);
}
return [200, { "Content-Type": "application/json" }, { success: true }];
});
}
QUnit.test(
"Should not send originalText when posting a new reply",
async assert => {
// prettier-ignore
server.post("/draft.json", request => { // eslint-disable-line no-undef
assert.equal(request.requestBody.indexOf("originalText"), -1, request.requestBody);
return [ 200, { "Content-Type": "application/json" }, { success: true } ];
});
handleDraftPretender(assert);
await visit("/t/internationalization-localization/280");
await click(".topic-post:eq(0) button.reply");
@@ -47,13 +64,7 @@ QUnit.test(
);
QUnit.test("Should send originalText when editing a reply", async assert => {
// prettier-ignore
server.post("/draft.json", request => { // eslint-disable-line no-undef
if (request.requestBody.indexOf("%22reply%22%3A%22%22") === -1) {
assert.notEqual(request.requestBody.indexOf("originalText"), -1);
}
return [ 200, { "Content-Type": "application/json" }, { success: true } ];
});
handleDraftPretender(assert);
await visit("/t/internationalization-localization/280");
await click(".topic-post:eq(0) button.show-more-actions");
@@ -1,5 +1,4 @@
import { acceptance } from "helpers/qunit-helpers";
import { INLINE_ONEBOX_CSS_CLASS } from "pretty-text/context/inline-onebox-css-classes";
acceptance("Composer - Onebox", {
loggedIn: true,
@@ -36,10 +35,10 @@ http://www.example.com/has-title.html
.trim(),
`
<p><aside class=\"onebox\"><article class=\"onebox-body\"><h3><a href=\"http://www.example.com/article.html\">An interesting article</a></h3></article></aside><br>
This is another test <a href=\"http://www.example.com/has-title.html\" class=\"${INLINE_ONEBOX_CSS_CLASS}\">This is a great title</a></p>
This is another test <a href=\"http://www.example.com/has-title.html\" class=\"inline-onebox\">This is a great title</a></p>
<p><a href=\"http://www.example.com/no-title.html\" class=\"onebox\" target=\"_blank\">http://www.example.com/no-title.html</a></p>
<p>This is another test <a href=\"http://www.example.com/no-title.html\" class=\"\">http://www.example.com/no-title.html</a><br>
This is another test <a href=\"http://www.example.com/has-title.html\" class=\"${INLINE_ONEBOX_CSS_CLASS}\">This is a great title</a></p>
This is another test <a href=\"http://www.example.com/has-title.html\" class=\"inline-onebox\">This is a great title</a></p>
<p><aside class=\"onebox\"><article class=\"onebox-body\"><h3><a href=\"http://www.example.com/article.html\">An interesting article</a></h3></article></aside></p>
`.trim()
);
@@ -0,0 +1,58 @@
import Category from "discourse/models/category";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import selectKit from "helpers/select-kit-helper";
acceptance("Composer - Tags", {
loggedIn: true,
pretend(pretenderServer, helper) {
pretenderServer.post("/uploads/lookup-urls", () => {
return helper.response([]);
});
},
site: {
can_tag_topics: true
}
});
QUnit.test("staff bypass tag validation rule", async assert => {
await visit("/");
await click("#create-topic");
await fillIn("#reply-title", "this is my new topic title");
await fillIn(".d-editor-input", "this is the *content* of a post");
Category.findById(2).set("minimum_required_tags", 1);
const categoryChooser = selectKit(".category-chooser");
await categoryChooser.expand();
await categoryChooser.selectRowByValue(2);
await click("#reply-control button.create");
assert.notEqual(currentURL(), "/");
});
QUnit.test("users do not bypass tag validation rule", async assert => {
await visit("/");
await click("#create-topic");
await fillIn("#reply-title", "this is my new topic title");
await fillIn(".d-editor-input", "this is the *content* of a post");
Category.findById(2).set("minimum_required_tags", 1);
const categoryChooser = selectKit(".category-chooser");
await categoryChooser.expand();
await categoryChooser.selectRowByValue(2);
updateCurrentUser({ moderator: false, admin: false, trust_level: 1 });
await click("#reply-control button.create");
assert.equal(currentURL(), "/");
const tags = selectKit(".mini-tag-chooser");
await tags.expand();
await tags.selectRowByValue("monkey");
await click("#reply-control button.create");
assert.notEqual(currentURL(), "/");
});
@@ -1,18 +1,15 @@
import I18n from "I18n";
import { run } from "@ember/runloop";
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";
import { toggleCheckDraftPopup } from "discourse/controllers/composer";
import Draft from "discourse/models/draft";
import { Promise } from "rsvp";
acceptance("Composer", {
loggedIn: true,
pretend(server, helper) {
server.get("/draft.json", () => {
return helper.response({
draft: null,
draft_sequence: 42
});
});
server.post("/uploads/lookup-urls", () => {
pretend(pretenderServer, helper) {
pretenderServer.post("/uploads/lookup-urls", () => {
return helper.response([]);
});
},
@@ -21,7 +18,7 @@ acceptance("Composer", {
}
});
QUnit.test("Tests the Composer controls", async assert => {
QUnit.skip("Tests the Composer controls", async assert => {
await visit("/");
assert.ok(exists("#create-topic"), "the create button is visible");
@@ -274,6 +271,24 @@ QUnit.test("Create a Reply", async assert => {
);
});
QUnit.test("Can edit a post after starting a reply", async assert => {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .create");
await fillIn(".d-editor-input", "this is the content of my reply");
await click(".topic-post:eq(0) button.show-more-actions");
await click(".topic-post:eq(0) button.edit");
await click("a[data-handler='0']");
assert.ok(!visible(".bootbox.modal"));
assert.equal(
find(".d-editor-input").val(),
"this is the content of my reply"
);
});
QUnit.test("Posting on a different topic", async assert => {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .btn.create");
@@ -528,7 +543,7 @@ QUnit.test(
);
assert.ok(
find(".composer-fields .whisper")
find(".composer-fields .unlist")
.text()
.indexOf(I18n.t("composer.unlist")) > 0,
"it sets the topic to unlisted"
@@ -617,14 +632,6 @@ QUnit.test("Checks for existing draft", async assert => {
try {
toggleCheckDraftPopup(true);
// prettier-ignore
server.get("/draft.json", () => { // eslint-disable-line no-undef
return [ 200, { "Content-Type": "application/json" }, {
draft: "{\"reply\":\"This is a draft of the first post\",\"action\":\"reply\",\"categoryId\":1,\"archetypeId\":\"regular\",\"metaData\":null,\"composerTime\":2863,\"typingTime\":200}",
draft_sequence: 42
} ];
});
await visit("/t/internationalization-localization/280");
await click(".topic-post:eq(0) button.show-more-actions");
@@ -646,18 +653,17 @@ QUnit.test("Can switch states without abandon popup", async assert => {
const longText = "a".repeat(256);
sandbox.stub(Draft, "get").returns(
Promise.resolve({
draft: null,
draft_sequence: 0
})
);
await click(".btn-primary.create.btn");
await fillIn(".d-editor-input", longText);
// prettier-ignore
server.get("/draft.json", () => { // eslint-disable-line no-undef
return [ 200, { "Content-Type": "application/json" }, {
draft: "{\"reply\":\"This is a draft of the first post\",\"action\":\"reply\",\"categoryId\":1,\"archetypeId\":\"regular\",\"metaData\":null,\"composerTime\":2863,\"typingTime\":200}",
draft_sequence: 42
} ];
});
await click("article#post_3 button.reply");
const composerActions = selectKit(".composer-actions");
@@ -686,19 +692,20 @@ QUnit.test("Can switch states without abandon popup", async assert => {
} finally {
toggleCheckDraftPopup(false);
}
sandbox.restore();
});
QUnit.test("Loading draft also replaces the recipients", async assert => {
try {
toggleCheckDraftPopup(true);
// prettier-ignore
server.get("/draft.json", () => { // eslint-disable-line no-undef
return [ 200, { "Content-Type": "application/json" }, {
"draft":"{\"reply\":\"hello\",\"action\":\"privateMessage\",\"title\":\"hello\",\"categoryId\":null,\"archetypeId\":\"private_message\",\"metaData\":null,\"usernames\":\"codinghorror\",\"composerTime\":9159,\"typingTime\":2500}",
"draft_sequence":0
} ];
});
sandbox.stub(Draft, "get").returns(
Promise.resolve({
draft:
'{"reply":"hello","action":"privateMessage","title":"hello","categoryId":null,"archetypeId":"private_message","metaData":null,"recipients":"codinghorror","composerTime":9159,"typingTime":2500}',
draft_sequence: 0
})
);
await visit("/u/charlie");
await click("button.compose-pm");
@@ -853,6 +860,10 @@ QUnit.test("can reply to a private message", async assert => {
return [200, { "Content-Type": "application/json" }, {}];
});
// a bit messy but we need a fake here cause we issue a route transition
// to the new post
server.get("/t/34/4.json", () => server.get("/t/34.json"));
await visit("/t/34");
await click(".topic-post:eq(0) button.reply");
await fillIn(".d-editor-input", "this is the *content* of the reply");
@@ -3,14 +3,6 @@ import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
acceptance("Composer and uncategorized is not allowed", {
loggedIn: true,
pretend(server, helper) {
server.get("/draft.json", () => {
return helper.response({
draft: null,
draft_sequence: 42
});
});
},
settings: {
enable_whispers: true,
allow_uncategorized_topics: false
@@ -31,10 +31,10 @@ QUnit.test("create account with user fields", async assert => {
assert.ok(exists(".create-account"), "it shows the create account modal");
assert.ok(exists(".user-field"), "it has at least one user field");
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"create account is disabled at first"
);
await click(".modal-footer .btn-primary");
assert.ok(exists("#modal-alert"), "it shows the required field alert");
assert.equal(find("#modal-alert").text(), "Please enter an email address");
await fillIn("#new-account-name", "Dr. Good Tuna");
await fillIn("#new-account-password", "cool password bro");
@@ -52,28 +52,13 @@ QUnit.test("create account with user fields", async assert => {
exists("#account-email-validation.good"),
"the email validation is good"
);
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"create account is still disabled due to lack of user fields"
);
await click(".modal-footer .btn-primary");
assert.equal(find("#modal-alert")[0].style.display, "");
await fillIn(".user-field input[type=text]:first", "Barky");
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"create account is disabled because field is not checked"
);
await click(".user-field input[type=checkbox]");
assert.ok(
!exists(".modal-footer .btn-primary:disabled"),
"create account is enabled because field is checked"
);
await click(".user-field input[type=checkbox]");
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"unchecking the checkbox disables the create account button"
);
await click(".modal-footer .btn-primary");
assert.equal(find("#modal-alert")[0].style.display, "none");
});
@@ -1,6 +1,6 @@
import { acceptance } from "helpers/qunit-helpers";
import { setCustomHTML } from "discourse/helpers/custom-html";
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
acceptance("CustomHTML set");
@@ -4,6 +4,7 @@ import { acceptance } from "helpers/qunit-helpers";
acceptance("Dashboard", {
loggedIn: true,
settings: {
dashboard_visible_tabs: "moderation|security|reports",
dashboard_general_tab_activity_metrics: "page_view_total_reqs"
},
site: {
@@ -20,8 +21,9 @@ acceptance("Dashboard", {
}
});
QUnit.test("Dashboard", async assert => {
QUnit.test("default", async assert => {
await visit("/admin");
assert.ok(exists(".dashboard"), "has dashboard-next class");
});
@@ -57,7 +59,7 @@ QUnit.test("general tab", async assert => {
);
});
QUnit.test("general tab - activity metrics", async assert => {
QUnit.test("activity metrics", async assert => {
await visit("/admin");
assert.ok(exists(".admin-report.page-view-total-reqs .today-count"));
@@ -100,9 +102,9 @@ QUnit.test("reports tab", async assert => {
);
});
QUnit.test("report filters", async assert => {
QUnit.test("reports filters", async assert => {
await visit(
'/admin/reports/signups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'
'/admin/reports/signups_with_groups?end_date=2018-07-16&filters=%7B"group"%3A88%7D&start_date=2018-06-16'
);
const groupFilter = selectKit(".group-filter .combo-box");
@@ -113,3 +115,41 @@ QUnit.test("report filters", async assert => {
"its set the value of the filter from the query params"
);
});
acceptance("Dashboard: dashboard_visible_tabs", {
loggedIn: true,
settings: {
dashboard_visible_tabs: "general|security|reports"
}
});
QUnit.test("visible tabs", async assert => {
await visit("/admin");
assert.ok(exists(".dashboard .navigation-item.general"), "general tab");
assert.notOk(
exists(".dashboard .navigation-item.moderation"),
"moderation tab"
);
assert.ok(exists(".dashboard .navigation-item.security"), "security tab");
assert.ok(exists(".dashboard .navigation-item.reports"), "reports tab");
});
acceptance("Dashboard: dashboard_hidden_reports", {
loggedIn: true,
settings: {
dashboard_visible_tabs: "reports",
dashboard_hidden_reports: "posts|dau_by_mau"
}
});
QUnit.test("hidden reports", async assert => {
await visit("/admin");
assert.ok(exists(".admin-report.signups.is-visible"), "signups report");
assert.notOk(exists(".admin-report.is-visible.posts"), "posts report");
assert.notOk(
exists(".admin-report.is-visible.dau-by-mau"),
"dau-by-mau report"
);
});
@@ -6,6 +6,10 @@ acceptance("EmojiPicker", {
beforeEach() {
const store = Discourse.__container__.lookup("service:emoji-store");
store.reset();
},
afterEach() {
const store = Discourse.__container__.lookup("service:emoji-store");
store.reset();
}
});
@@ -18,7 +22,7 @@ QUnit.test("emoji picker can be opened/closed", async assert => {
find(".emoji-picker")
.html()
.trim(),
"",
"<!---->",
"it opens the picker"
);
@@ -27,7 +31,7 @@ QUnit.test("emoji picker can be opened/closed", async assert => {
find(".emoji-picker")
.html()
.trim(),
"",
"<!---->",
"it closes the picker"
);
});
@@ -164,19 +168,6 @@ QUnit.test(
}
);
QUnit.test("emoji picker lazy loads emojis", async assert => {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .btn.create");
await click("button.emoji.btn");
assert.equal(
find('.emoji-picker button[title="massage_woman"]').css("background-image"),
"none",
"it doesn't load invisible emojis"
);
});
QUnit.test("emoji picker persists state", async assert => {
await visit("/t/internationalization-localization/280");
await click("#topic-footer-buttons .btn.create");
@@ -0,0 +1,56 @@
import { acceptance } from "helpers/qunit-helpers";
import DiscoveryFixtures from "fixtures/discovery_fixtures";
acceptance("Encoded Sub Category Discovery", {
pretend(server, helper) {
server.get(
"/c/%E6%BC%A2%E5%AD%97-parent/%E6%BC%A2%E5%AD%97-subcategory/6/l/latest.json",
() => {
return helper.response(
DiscoveryFixtures["/latest_can_create_topic.json"]
);
}
);
server.get(
"/c/%E6%BC%A2%E5%AD%97-parent/%E6%BC%A2%E5%AD%97-subcategory/find_by_slug.json",
() => {
//respond with an error here: these tests are to check that ember can route this itself without falling back to rails
return helper.response(500, {});
}
);
},
settings: {
slug_generation_method: "encoded"
},
site: {
categories: [
{
id: 5,
name: "漢字-parent",
slug: "%E6%BC%A2%E5%AD%97-parent",
permission: null
},
{
id: 6,
name: "漢字-subcategory",
slug: "%E6%BC%A2%E5%AD%97-subcategory",
permission: null,
parent_category_id: 5
}
]
}
});
QUnit.test("Visit subcategory by slug", async assert => {
let bodySelector =
"body.category-\\%E6\\%BC\\%A2\\%E5\\%AD\\%97-parent-\\%E6\\%BC\\%A2\\%E5\\%AD\\%97-subcategory";
await visit("/c/%E6%BC%A2%E5%AD%97-parent/%E6%BC%A2%E5%AD%97-subcategory");
assert.ok($(bodySelector).length, "has the default navigation");
assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.ok(exists(".topic-list .topic-list-item"), "has topics");
await visit("/c/漢字-parent/漢字-subcategory");
assert.ok($(bodySelector).length, "has the default navigation");
assert.ok(exists(".topic-list"), "The list of topics was rendered");
assert.ok(exists(".topic-list .topic-list-item"), "has topics");
});
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
let userFound = false;
@@ -3,7 +3,7 @@ import DiscourseURL from "discourse/lib/url";
acceptance("Group Card");
QUnit.test("group card", async assert => {
QUnit.skip("group card", async assert => {
await visit("/t/-/301/1");
assert.ok(invisible(".group-card"), "user card is invisible by default");
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
acceptance("Group Members");
@@ -13,7 +13,6 @@ acceptance("Group logs", {
alias_level: 0,
visible: true,
automatic_membership_email_domains: "",
automatic_membership_retroactive: false,
primary_group: true,
title: "Team Snorlax",
grant_trust_level: null,
@@ -13,11 +13,6 @@ QUnit.test("As an admin", async assert => {
"it should display automatic membership label"
);
assert.ok(
find(".groups-form-automatic-membership-retroactive").length === 1,
"it should display automatic membership retroactive checkbox"
);
assert.ok(
find(".groups-form-primary-group").length === 1,
"it should display set as primary group checkbox"
@@ -17,7 +17,6 @@ acceptance("Group Requests", {
messageable_level: 0,
visibility_level: 0,
automatic_membership_email_domains: "",
automatic_membership_retroactive: false,
primary_group: false,
title: "Macdonald",
grant_trust_level: null,
@@ -1,12 +1,14 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
let groupArgs = {
settings: {
enable_group_directory: true
},
pretend(server, helper) {
server.post("/groups/Macdonald/request_membership", () => {
pretend(pretenderServer, helper) {
pretenderServer.post("/groups/Macdonald/request_membership", () => {
return helper.response({
relative_url: "/t/internationalization-localization/280"
});
@@ -26,7 +28,7 @@ QUnit.test("Anonymous Viewing Group", async assert => {
assert.equal(
count(".nav-pills li a[title='Messages']"),
0,
"it deos not show group messages navigation link"
"it does not show group messages navigation link"
);
await click(".nav-pills li a[title='Activity']");
@@ -81,7 +83,7 @@ QUnit.test("Anonymous Viewing Automatic Group", async assert => {
assert.equal(
count(".nav-pills li a[title='Manage']"),
0,
"it deos not show group messages navigation link"
"it does not show group messages navigation link"
);
});
@@ -127,10 +129,12 @@ QUnit.test("User Viewing Group", async assert => {
QUnit.test(
"Admin viewing group messages when there are no messages",
async assert => {
// prettier-ignore
server.get("/topics/private-messages-group/eviltrout/discourse.json", () => { // eslint-disable-line no-undef
return response({ topic_list: { topics: [] } });
});
pretender.get(
"/topics/private-messages-group/eviltrout/discourse.json",
() => {
return response({ topic_list: { topics: [] } });
}
);
await visit("/g/discourse");
await click(".nav-pills li a[title='Messages']");
@@ -146,87 +150,89 @@ QUnit.test(
);
QUnit.test("Admin viewing group messages", async assert => {
// prettier-ignore
server.get("/topics/private-messages-group/eviltrout/discourse.json", () => { // eslint-disable-line no-undef
return response({
users: [
{
id: 2,
username: "bruce1",
avatar_template:
"/user_avatar/meta.discourse.org/bruce1/{size}/5245.png"
},
{
id: 3,
username: "CodingHorror",
avatar_template:
"/user_avatar/meta.discourse.org/codinghorror/{size}/5245.png"
}
],
primary_groups: [],
topic_list: {
can_create_topic: true,
draft: null,
draft_key: "new_topic",
draft_sequence: 0,
per_page: 30,
topics: [
pretender.get(
"/topics/private-messages-group/eviltrout/discourse.json",
() => {
return response({
users: [
{
id: 12199,
title: "This is a private message 1",
fancy_title: "This is a private message 1",
slug: "this-is-a-private-message-1",
posts_count: 0,
reply_count: 0,
highest_post_number: 0,
image_url: null,
created_at: "2018-03-16T03:38:45.583Z",
last_posted_at: null,
bumped: true,
bumped_at: "2018-03-16T03:38:45.583Z",
unseen: false,
pinned: false,
unpinned: null,
visible: true,
closed: false,
archived: false,
bookmarked: null,
liked: null,
views: 0,
like_count: 0,
has_summary: false,
archetype: "private_message",
last_poster_username: "bruce1",
category_id: null,
pinned_globally: false,
featured_link: null,
posters: [
{
extras: "latest single",
description: "Original Poster, Most Recent Poster",
user_id: 2,
primary_group_id: null
}
],
participants: [
{
extras: "latest",
description: null,
user_id: 2,
primary_group_id: null
},
{
extras: null,
description: null,
user_id: 3,
primary_group_id: null
}
]
id: 2,
username: "bruce1",
avatar_template:
"/user_avatar/meta.discourse.org/bruce1/{size}/5245.png"
},
{
id: 3,
username: "CodingHorror",
avatar_template:
"/user_avatar/meta.discourse.org/codinghorror/{size}/5245.png"
}
]
}
});
});
],
primary_groups: [],
topic_list: {
can_create_topic: true,
draft: null,
draft_key: "new_topic",
draft_sequence: 0,
per_page: 30,
topics: [
{
id: 12199,
title: "This is a private message 1",
fancy_title: "This is a private message 1",
slug: "this-is-a-private-message-1",
posts_count: 0,
reply_count: 0,
highest_post_number: 0,
image_url: null,
created_at: "2018-03-16T03:38:45.583Z",
last_posted_at: null,
bumped: true,
bumped_at: "2018-03-16T03:38:45.583Z",
unseen: false,
pinned: false,
unpinned: null,
visible: true,
closed: false,
archived: false,
bookmarked: null,
liked: null,
views: 0,
like_count: 0,
has_summary: false,
archetype: "private_message",
last_poster_username: "bruce1",
category_id: null,
pinned_globally: false,
featured_link: null,
posters: [
{
extras: "latest single",
description: "Original Poster, Most Recent Poster",
user_id: 2,
primary_group_id: null
}
],
participants: [
{
extras: "latest",
description: null,
user_id: 2,
primary_group_id: null
},
{
extras: null,
description: null,
user_id: 3,
primary_group_id: null
}
]
}
]
}
});
}
);
await visit("/g/discourse");
await click(".nav-pills li a[title='Messages']");
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("New Group");
@@ -1,5 +1,5 @@
import { acceptance } from "helpers/qunit-helpers";
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
acceptance("Invite Accept", {
settings: {
@@ -16,11 +16,13 @@ QUnit.test("Invite Acceptance Page", async assert => {
name: "Neil Lalonde",
title: "team"
},
email: "invited@asdf.com",
username: "invited"
email: null,
username: "invited",
is_invite_link: true
});
await visit("/invites/myvalidinvitetoken");
assert.ok(exists("#new-account-email"), "shows the email input");
assert.ok(exists("#new-account-username"), "shows the username input");
assert.equal(
find("#new-account-username").val(),
@@ -31,10 +33,16 @@ QUnit.test("Invite Acceptance Page", async assert => {
assert.ok(exists("#new-account-password"), "shows the password input");
assert.ok(
exists(".invites-show .btn-primary:disabled"),
"submit is disabled because name is not filled"
"submit is disabled because name and email is not filled"
);
await fillIn("#new-account-name", "John Doe");
assert.ok(
exists(".invites-show .btn-primary:disabled"),
"submit is disabled because email is not filled"
);
await fillIn("#new-account-email", "john.doe@example.com");
assert.not(
exists(".invites-show .btn-primary:disabled"),
"submit is enabled"
@@ -54,10 +62,19 @@ QUnit.test("Invite Acceptance Page", async assert => {
"submit is disabled"
);
await fillIn("#new-account-email", "john.doe@example");
assert.ok(exists(".email-input .bad"), "email is not valid");
assert.ok(
exists(".invites-show .btn-primary:disabled"),
"submit is disabled"
);
await fillIn("#new-account-username", "validname");
await fillIn("#new-account-password", "secur3ty4Y0uAndMe");
await fillIn("#new-account-email", "john.doe@example.com");
assert.ok(exists(".username-input .good"), "username is valid");
assert.ok(exists(".password-input .good"), "password is valid");
assert.ok(exists(".email-input .good"), "email is valid");
assert.not(
exists(".invites-show .btn-primary:disabled"),
"submit is enabled"
@@ -1,4 +1,5 @@
import { acceptance } from "helpers/qunit-helpers";
import PreloadStore from "discourse/lib/preload-store";
acceptance("Accept Invite - User Fields", {
site: {
@@ -26,6 +27,19 @@ acceptance("Accept Invite - User Fields", {
});
QUnit.test("accept invite with user fields", async assert => {
PreloadStore.store("invite_info", {
invited_by: {
id: 123,
username: "neil",
avatar_template: "/user_avatar/localhost/neil/{size}/25_1.png",
name: "Neil Lalonde",
title: "team"
},
email: "invited@asdf.com",
username: "invited",
is_invite_link: false
});
await visit("/invites/myvalidinvitetoken");
assert.ok(exists(".invites-show"), "shows the accept invite page");
assert.ok(exists(".user-field"), "it has at least one user field");
@@ -1,16 +1,16 @@
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Keyboard Shortcuts", { loggedIn: true });
test("go to first suggested topic", async assert => {
/* global server */
server.get("/t/27331/4.json", () => [
pretender.get("/t/27331/4.json", () => [
200,
{ "Content-Type": "application/json" },
{}
]);
server.get("/t/27331.json", () => [
pretender.get("/t/27331.json", () => [
200,
{ "Content-Type": "application/json" },
{}
@@ -20,7 +20,7 @@ test("go to first suggested topic", async assert => {
* No suggested topics exist.
*/
server.get("/t/9/last.json", () => [
pretender.get("/t/9/last.json", () => [
200,
{ "Content-Type": "application/json" },
{}
@@ -44,7 +44,7 @@ test("go to first suggested topic", async assert => {
* Suggested topic is returned by server.
*/
server.get("/t/28830/last.json", () => [
pretender.get("/t/28830/last.json", () => [
200,
{ "Content-Type": "application/json" },
{
@@ -1,4 +1,6 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Login with email - hide email address taken", {
settings: {
@@ -10,8 +12,7 @@ acceptance("Login with email - hide email address taken", {
return [200, { "Content-Type": "application/json" }, object];
};
// prettier-ignore
server.post("/u/email-login", () => { // eslint-disable-line no-undef
pretender.post("/u/email-login", () => {
return response({ success: "OK" });
});
}
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
let userFound = false;
@@ -4,7 +4,7 @@ import showModal from "discourse/lib/show-modal";
acceptance("Modal");
QUnit.test("modal", async function(assert) {
QUnit.skip("modal", async function(assert) {
await visit("/");
assert.ok(
@@ -0,0 +1,40 @@
import { acceptance } from "helpers/qunit-helpers";
acceptance("Page Publishing", {
loggedIn: true,
pretend(server, helper) {
const validSlug = helper.response({ valid_slug: true });
server.put("/pub/by-topic/280", () => {
return helper.response({});
});
server.get("/pub/by-topic/280", () => {
return helper.response({});
});
server.get("/pub/check-slug", req => {
if (req.queryParams.slug === "internationalization-localization") {
return validSlug;
}
return helper.response({
valid_slug: false,
reason: "i don't need a reason"
});
});
}
});
QUnit.test("can publish a page via modal", async assert => {
await visit("/t/internationalization-localization/280");
await click(".topic-post:eq(0) button.show-more-actions");
await click(".topic-post:eq(0) button.show-post-admin-menu");
await click(".topic-post:eq(0) .publish-page");
await fillIn(".publish-slug", "bad-slug");
assert.ok(!exists(".valid-slug"));
assert.ok(exists(".invalid-slug"));
await fillIn(".publish-slug", "internationalization-localization");
assert.ok(exists(".valid-slug"));
assert.ok(!exists(".invalid-slug"));
await click(".publish-page");
assert.ok(exists(".current-url"));
});
@@ -1,5 +1,6 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import PreloadStore from "preload-store";
import PreloadStore from "discourse/lib/preload-store";
import { parsePostData } from "helpers/create-pretender";
acceptance("Password Reset", {
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Personal Message", {
@@ -23,17 +24,3 @@ QUnit.test("suggested messages", async assert => {
I18n.t("suggested_topics.pm_title")
);
});
acceptance("Personal Message Tagging", {
loggedIn: true,
site: { can_tag_pms: true }
});
QUnit.test("show footer edit button", async assert => {
await visit("/t/pm-for-testing/12");
assert.ok(
exists(".edit-message"),
"shows edit first post button on footer when PM tagging is enabled"
);
});
@@ -0,0 +1,54 @@
import { acceptance } from "helpers/qunit-helpers";
import { withPluginApi } from "discourse/lib/plugin-api";
import KeyboardShortcuts from "discourse/lib/keyboard-shortcuts";
import KeyboardShortcutInitializer from "discourse/initializers/keyboard-shortcuts";
function initKeyboardShortcuts() {
// this is here because initializers/keyboard-shortcuts is not
// firing for this acceptance test, and it needs to be fired before
// more keyboard shortcuts can be added
KeyboardShortcutInitializer.initialize(Discourse.__container__);
}
acceptance("Plugin Keyboard Shortcuts - Logged In", {
loggedIn: true
});
test("a plugin can add a keyboard shortcut", async assert => {
initKeyboardShortcuts();
withPluginApi("0.8.38", api => {
api.addKeyboardShortcut("]", () => {
$("#qunit-fixture").html(
"<div id='added-element'>Test adding plugin shortcut</div>"
);
});
});
await visit("/t/this-is-a-test-topic/9");
await keyEvent(document, "keypress", "]".charCodeAt(0));
assert.equal(
$("#added-element").length,
1,
"the keyboard shortcut callback fires successfully"
);
});
acceptance("Plugin Keyboard Shortcuts - Anonymous", {
loggedIn: false
});
test("a plugin can add a keyboard shortcut with an option", async assert => {
var spy = sandbox.spy(KeyboardShortcuts, "_bindToPath");
initKeyboardShortcuts();
withPluginApi("0.8.38", api => {
api.addKeyboardShortcut("]", () => {}, {
anonymous: true,
path: "test-path"
});
});
assert.ok(
spy.calledWith("test-path", "]"),
"bindToPath is called due to options provided"
);
});
@@ -1,6 +1,6 @@
import I18n from "I18n";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import selectKit from "helpers/select-kit-helper";
import User from "discourse/models/user";
acceptance("User Preferences", {
@@ -20,6 +20,16 @@ acceptance("User Preferences", {
});
});
server.post("/u/create_second_factor_security_key.json", () => {
return helper.response({
challenge:
"a6d393d12654c130b2273e68ca25ca232d1d7f4c2464c2610fb8710a89d4",
rp_id: "localhost",
rp_name: "Discourse",
supported_algorithms: [-7, -257]
});
});
server.post("/u/enable_second_factor_totp.json", () => {
return helper.response({ error: "invalid token" });
});
@@ -67,10 +77,10 @@ QUnit.test("update some fields", async assert => {
assert.ok(exists(".user-preferences"), "it shows the preferences");
const savePreferences = async () => {
assert.ok(!exists(".saved-user"), "it hasn't been saved yet");
await click(".save-user");
assert.ok(exists(".saved-user"), "it displays the saved message");
find(".saved-user").remove();
assert.ok(!exists(".saved"), "it hasn't been saved yet");
await click(".save-changes");
assert.ok(exists(".saved"), "it displays the saved message");
find(".saved").remove();
};
fillIn(".pref-name input[type=text]", "Jon Snow");
@@ -114,10 +124,10 @@ QUnit.test("font size change", async assert => {
$.removeCookie("text_size");
const savePreferences = async () => {
assert.ok(!exists(".saved-user"), "it hasn't been saved yet");
await click(".save-user");
assert.ok(exists(".saved-user"), "it displays the saved message");
find(".saved-user").remove();
assert.ok(!exists(".saved"), "it hasn't been saved yet");
await click(".save-changes");
assert.ok(exists(".saved"), "it displays the saved message");
find(".saved").remove();
};
await visit("/u/eviltrout/preferences/interface");
@@ -211,7 +221,7 @@ QUnit.test("connected accounts", async assert => {
.indexOf("Connect") > -1;
});
QUnit.test("second factor", async assert => {
QUnit.test("second factor totp", async assert => {
await visit("/u/eviltrout/preferences/second-factor");
assert.ok(exists("#password"), "it has a password input");
@@ -223,17 +233,44 @@ QUnit.test("second factor", async assert => {
await click(".new-totp");
assert.ok(exists("#test-qr"), "shows qr code");
await fillIn("#second-factor-token", "111111");
await click(".add-totp");
assert.ok(
find(".alert-error")
.html()
.indexOf("invalid token") > -1,
"shows server validation error message"
.indexOf("provide a name and the code") > -1,
"shows name/token missing error message"
);
});
QUnit.test("second factor security keys", async assert => {
await visit("/u/eviltrout/preferences/second-factor");
assert.ok(exists("#password"), "it has a password input");
await fillIn("#password", "secrets");
await click(".user-preferences .btn-primary");
assert.notOk(exists("#password"), "it hides the password input");
await click(".new-security-key");
assert.ok(exists("#security-key-name"), "shows security key name input");
fillIn("#security-key-name", "");
// The following tests can only run when Webauthn is enabled. This is not
// always the case, for example on a browser running on a non-standard port
if (typeof PublicKeyCredential !== "undefined") {
await click(".add-security-key");
assert.ok(
find(".alert-error")
.html()
.indexOf("provide a name") > -1,
"shows name missing error message"
);
}
});
QUnit.test("default avatar selector", async assert => {
await visit("/u/eviltrout/preferences");
@@ -1,16 +1,23 @@
import { acceptance } from "helpers/qunit-helpers";
import compile from "handlebars-compiler";
import {
addRawTemplate,
removeRawTemplate
} from "discourse-common/lib/raw-templates";
const CONNECTOR =
"javascripts/raw-test/connectors/topic-list-before-status/lala";
acceptance("Raw Plugin Outlet", {
beforeEach() {
Discourse.RAW_TEMPLATES[CONNECTOR] = Handlebars.compile(
`<span class='topic-lala'>{{context.topic.id}}</span>`
addRawTemplate(
CONNECTOR,
compile(`<span class='topic-lala'>{{context.topic.id}}</span>`)
);
},
afterEach() {
delete Discourse.RAW_TEMPLATES[CONNECTOR];
removeRawTemplate(CONNECTOR);
}
});
@@ -30,7 +30,6 @@ acceptance("Search - Full Page", {
alias_level: 0,
visible: true,
automatic_membership_email_domains: null,
automatic_membership_retroactive: false,
primary_group: false,
title: null,
grant_trust_level: null,
@@ -173,72 +172,6 @@ QUnit.test("update category through advanced search ui", async assert => {
);
});
// test("update group through advanced search ui", assert => {
// visit("/search");
// fillIn('.search-query', 'none');
//
// fillIn('.search-advanced-options .group-selector', 'moderators');
// click('.search-advanced-options .group-selector');
// keyEvent('.search-advanced-options .group-selector', 'keydown', 8);
//
// andThen(() => {
// waitFor(() => {
// assert.ok(visible('.search-advanced-options .autocomplete'), '"autocomplete" popup is visible');
// assert.ok(exists('.search-advanced-options .autocomplete ul li a:contains("moderators")'), '"autocomplete" popup has an entry for "moderators"');
//
// click('.search-advanced-options .autocomplete ul li a:first');
//
// andThen(() => {
// assert.ok(exists('.search-advanced-options span:contains("moderators")'), 'has "moderators" pre-populated');
// assert.equal(find('.search-query').val(), "none group:moderators", 'has updated search term to "none group:moderators"');
// });
// });
// });
// });
// test("update badges through advanced search ui", assert => {
// visit("/search");
// fillIn('.search-query', 'none');
//
// fillIn('.search-advanced-options .badge-names', 'Reader');
// click('.search-advanced-options .badge-names');
// keyEvent('.search-advanced-options .badge-names', 'keydown', 8);
//
// andThen(() => {
// waitFor(() => {
// assert.ok(visible('.search-advanced-options .autocomplete'), '"autocomplete" popup is visible');
// assert.ok(exists('.search-advanced-options .autocomplete ul li a:contains("Reader")'), '"autocomplete" popup has an entry for "Reader"');
//
// click('.search-advanced-options .autocomplete ul li a:first');
//
// andThen(() => {
// assert.ok(exists('.search-advanced-options span:contains("Reader")'), 'has "Reader" pre-populated');
// assert.equal(find('.search-query').val(), "none badge:Reader", 'has updated search term to "none badge:Reader"');
// });
// });
// });
// });
// test("update tags through advanced search ui", assert => {
// visit("/search");
// fillIn('.search-query', 'none');
//
//
// keyEvent('.search-advanced-options .tag-chooser input.select2-input', 'keydown', 110);
// fillIn('.search-advanced-options .tag-chooser input.select2-input', 'monkey');
// keyEvent('.search-advanced-options .tag-chooser input.select2-input', 'keyup', 110);
//
// andThen(() => {
// waitFor(() => {
// click('li.select2-result-selectable:first');
// andThen(() => {
// assert.ok(exists('.search-advanced-options .tag-chooser .tag-monkey'), 'has "monkey" pre-populated');
// assert.equal(find('.search-query').val(), "none tags:monkey", 'has updated search term to "none tags:monkey"');
// });
// });
// });
// });
//
QUnit.test(
"update in:title filter through advanced search ui",
async assert => {
@@ -28,6 +28,10 @@ QUnit.test("search", async assert => {
await fillIn("#search-term", "dev");
await keyEvent("#search-term", "keyup", 16);
assert.ok(exists(".search-menu .results ul li"), "it shows results");
assert.ok(
exists(".search-menu .results ul li .topic-title[data-topic-id]"),
"topic has data-topic-id"
);
await click(".show-help");
@@ -94,13 +98,13 @@ QUnit.test("Search with context", async assert => {
const highlighted = [];
find("#post_7 span.highlight-strong").map((_, span) => {
find("#post_7 span.highlighted").map((_, span) => {
highlighted.push(span.innerText);
});
assert.deepEqual(
highlighted,
["a", "a", "proper", "a"],
["a proper"],
"it should highlight the post with the search terms correctly"
);
@@ -131,7 +135,6 @@ QUnit.test("Right filters are shown to anonymous users", async assert => {
assert.ok(inSelector.rowByValue("first").exists());
assert.ok(inSelector.rowByValue("pinned").exists());
assert.ok(inSelector.rowByValue("unpinned").exists());
assert.ok(inSelector.rowByValue("wiki").exists());
assert.ok(inSelector.rowByValue("images").exists());
@@ -157,7 +160,6 @@ QUnit.test("Right filters are shown to logged-in users", async assert => {
assert.ok(inSelector.rowByValue("first").exists());
assert.ok(inSelector.rowByValue("pinned").exists());
assert.ok(inSelector.rowByValue("unpinned").exists());
assert.ok(inSelector.rowByValue("wiki").exists());
assert.ok(inSelector.rowByValue("images").exists());
@@ -68,7 +68,7 @@ QUnit.test("sign in - not activated - edit email", async assert => {
assert.equal(find(".modal-body b").text(), "different@example.com");
});
QUnit.test("second factor", async assert => {
QUnit.skip("second factor", async assert => {
await visit("/");
await click("header .login-button");
@@ -101,7 +101,7 @@ QUnit.test("second factor", async assert => {
);
});
QUnit.test("security key", async assert => {
QUnit.skip("security key", async assert => {
await visit("/");
await click("header .login-button");
@@ -132,10 +132,6 @@ QUnit.test("create account", async assert => {
await click("header .sign-up-button");
assert.ok(exists(".create-account"), "it shows the create account modal");
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"create account is disabled at first"
);
await fillIn("#new-account-name", "Dr. Good Tuna");
await fillIn("#new-account-password", "cool password bro");
@@ -151,20 +147,14 @@ QUnit.test("create account", async assert => {
exists("#username-validation.bad"),
"the username validation is bad"
);
assert.ok(
exists(".modal-footer .btn-primary:disabled"),
"create account is still disabled"
);
await click(".modal-footer .btn-primary");
assert.ok(exists("#new-account-username:focus"), "username field is focused");
await fillIn("#new-account-username", "goodtuna");
assert.ok(
exists("#username-validation.good"),
"the username validation is good"
);
assert.not(
exists(".modal-footer .btn-primary:disabled"),
"create account is enabled"
);
await click(".modal-footer .btn-primary");
assert.ok(
@@ -1,4 +1,6 @@
import { updateCurrentUser, acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";
acceptance("Tags", { loggedIn: true });
QUnit.test("list the tags", async assert => {
@@ -19,48 +21,6 @@ acceptance("Tags listed by group", {
});
QUnit.test("list the tags in groups", async assert => {
// prettier-ignore
server.get("/tags", () => { // eslint-disable-line no-undef
return [
200,
{ "Content-Type": "application/json" },
{
tags: [
{ id: "planned", text: "planned", count: 7, pm_count: 0 },
{ id: "private", text: "private", count: 0, pm_count: 7 }
],
extras: {
tag_groups: [
{
id: 2,
name: "Ford Cars",
tags: [
{ id: "Escort", text: "Escort", count: 1, pm_count: 0 },
{ id: "focus", text: "focus", count: 3, pm_count: 0 }
]
},
{
id: 1,
name: "Honda Cars",
tags: [
{ id: "civic", text: "civic", count: 4, pm_count: 0 },
{ id: "accord", text: "accord", count: 2, pm_count: 0 }
]
},
{
id: 1,
name: "Makes",
tags: [
{ id: "ford", text: "ford", count: 5, pm_count: 0 },
{ id: "honda", text: "honda", count: 6, pm_count: 0 }
]
}
]
}
}
];
});
await visit("/tags");
assert.equal(
$(".tag-list").length,
@@ -102,14 +62,13 @@ QUnit.test("list the tags in groups", async assert => {
});
test("new topic button is not available for staff-only tags", async assert => {
/* global server */
server.get("/tag/regular-tag/notifications", () => [
pretender.get("/tag/regular-tag/notifications", () => [
200,
{ "Content-Type": "application/json" },
{ tag_notification: { id: "regular-tag", notification_level: 1 } }
]);
server.get("/tag/regular-tag/l/latest.json", () => [
pretender.get("/tag/regular-tag/l/latest.json", () => [
200,
{ "Content-Type": "application/json" },
{
@@ -133,13 +92,13 @@ test("new topic button is not available for staff-only tags", async assert => {
}
]);
server.get("/tag/staff-only-tag/notifications", () => [
pretender.get("/tag/staff-only-tag/notifications", () => [
200,
{ "Content-Type": "application/json" },
{ tag_notification: { id: "staff-only-tag", notification_level: 1 } }
]);
server.get("/tag/staff-only-tag/l/latest.json", () => [
pretender.get("/tag/staff-only-tag/l/latest.json", () => [
200,
{ "Content-Type": "application/json" },
{
@@ -286,7 +245,7 @@ test("tag info can show synonyms", async assert => {
});
test("admin can manage tags", async assert => {
server.delete("/tag/planters/synonyms/containers", () => [
pretender.delete("/tag/planters/synonyms/containers", () => [
200,
{ "Content-Type": "application/json" },
{ success: true }
@@ -1,4 +1,6 @@
import { acceptance } from "helpers/qunit-helpers";
import MessageBus from "message-bus-client";
acceptance("Topic Discovery", {
settings: {
show_pinned_excerpt_desktop: true
@@ -85,7 +87,7 @@ QUnit.test("Live update unread state", async assert => {
);
// Mimic a messagebus message
window.MessageBus.callbacks.filterBy("channel", "/latest").map(c =>
MessageBus.callbacks.filterBy("channel", "/latest").map(c =>
c.func({
message_type: "read",
topic_id: 11995,
@@ -66,7 +66,7 @@ QUnit.test("autoclose - specific time", async assert => {
assert.ok(regex.test(html));
});
QUnit.test("autoclose", async assert => {
QUnit.skip("autoclose", async assert => {
updateCurrentUser({ moderator: true, canManageTopic: true });
const futureDateInputSelector = selectKit(".future-date-input-selector");
@@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { withPluginApi } from "discourse/lib/plugin-api";
import { clearTopicFooterButtons } from "discourse/lib/register-topic-footer-button";
@@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Topic move posts", { loggedIn: true });

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