2015-05-15 11:03:27 -04:00
|
|
|
import { acceptance } from "helpers/qunit-helpers";
|
|
|
|
|
|
|
|
acceptance("Category Edit", { loggedIn: true });
|
|
|
|
|
2015-07-02 12:06:24 -04:00
|
|
|
test("Can open the category modal", (assert) => {
|
2015-05-15 11:03:27 -04:00
|
|
|
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');
|
|
|
|
});
|
|
|
|
});
|
2015-07-02 12:06:24 -04:00
|
|
|
|
|
|
|
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(Discourse.URL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
|
|
|
});
|
|
|
|
});
|
2015-07-02 16:18:59 -04:00
|
|
|
|
|
|
|
test("Change the topic template", (assert) => {
|
|
|
|
visit("/c/bug");
|
|
|
|
|
|
|
|
click('.edit-category');
|
|
|
|
click('.edit-category-topic-template');
|
2015-07-13 16:36:38 -04:00
|
|
|
fillIn('.wmd-input', 'this is the new topic template');
|
2015-07-02 16:18:59 -04:00
|
|
|
click('#save-category');
|
|
|
|
andThen(() => {
|
|
|
|
assert.ok(!visible('#discourse-modal'), 'it closes the modal');
|
|
|
|
assert.equal(Discourse.URL.redirectedTo, '/c/bug', 'it does one of the rare full page redirects');
|
|
|
|
});
|
|
|
|
});
|