mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-20 12:32:39 -05:00
94b60e62a2
Note this commit leaves out the biggest occurrence of the editor which is the post/topic composer. To avoid major breakage, this replaces it everywhere else it was used: * User preferences (About Me) * Admin Customizations > Text Content * Category Templates * Editing Queued Posts A future commit will replace the main composer with this editor and will remove the unused pagedown code.
43 lines
1.2 KiB
JavaScript
43 lines
1.2 KiB
JavaScript
import DiscourseURL from 'discourse/lib/url';
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
acceptance("Category Edit", { loggedIn: true });
|
|
|
|
test("Can open the category modal", assert => {
|
|
visit("/c/bug");
|
|
|
|
click('.edit-category');
|
|
andThen(() => {
|
|
assert.ok(visible('#discourse-modal'), 'it pops up a modal');
|
|
});
|
|
|
|
click('a.close');
|
|
andThen(() => {
|
|
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
|
});
|
|
});
|
|
|
|
test("Change the category color", assert => {
|
|
visit("/c/bug");
|
|
|
|
click('.edit-category');
|
|
fillIn('#edit-text-color', '#ff0000');
|
|
click('#save-category');
|
|
andThen(() => {
|
|
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
|
assert.equal(DiscourseURL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
|
});
|
|
});
|
|
|
|
test("Change the topic template", assert => {
|
|
visit("/c/bug");
|
|
|
|
click('.edit-category');
|
|
click('.edit-category-topic-template');
|
|
fillIn('.d-editor-input', 'this is the new topic template');
|
|
click('#save-category');
|
|
andThen(() => {
|
|
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
|
assert.equal(DiscourseURL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
|
});
|
|
});
|