mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
FEATURE: Add toggle topic visibility button in popup menu.
This commit is contained in:
@ -1,6 +1,11 @@
|
||||
import { acceptance } from "helpers/qunit-helpers";
|
||||
|
||||
acceptance("Composer", { loggedIn: true });
|
||||
acceptance("Composer", {
|
||||
loggedIn: true,
|
||||
settings: {
|
||||
enable_whispers: true
|
||||
}
|
||||
});
|
||||
|
||||
test("Tests the Composer controls", () => {
|
||||
visit("/");
|
||||
@ -254,6 +259,52 @@ test("Composer can toggle between edit and reply", () => {
|
||||
});
|
||||
});
|
||||
|
||||
test("Composer can toggle between reply and createTopic", () => {
|
||||
visit("/t/this-is-a-test-topic/9");
|
||||
|
||||
click('.topic-post:eq(0) button.reply');
|
||||
click('button.options');
|
||||
click('.popup-menu .fa-eye-slash');
|
||||
andThen(() => {
|
||||
ok(
|
||||
find('.composer-fields .whisper').text().indexOf(I18n.t("composer.whisper")) > 0,
|
||||
'it sets the post type to whisper'
|
||||
);
|
||||
});
|
||||
|
||||
visit("/");
|
||||
andThen(() => {
|
||||
ok(exists('#create-topic'), 'the create topic button is visible');
|
||||
});
|
||||
|
||||
click('#create-topic');
|
||||
andThen(() => {
|
||||
ok(
|
||||
find('.composer-fields .whisper').text().indexOf(I18n.t("composer.whisper")) === -1,
|
||||
"it should reset the state of the composer's model"
|
||||
);
|
||||
});
|
||||
|
||||
click('button.options');
|
||||
click('.popup-menu .fa-eye-slash');
|
||||
andThen(() => {
|
||||
ok(
|
||||
find('.composer-fields .whisper').text().indexOf(I18n.t("composer.unlist")) > 0,
|
||||
'it sets the topic to unlisted'
|
||||
);
|
||||
});
|
||||
|
||||
visit("/t/this-is-a-test-topic/9");
|
||||
|
||||
click('.topic-post:eq(0) button.reply');
|
||||
andThen(() => {
|
||||
ok(
|
||||
find('.composer-fields .whisper').text().indexOf(I18n.t("composer.unlist")) === -1,
|
||||
"it should reset the state of the composer's model"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test("Composer with dirty reply can toggle to edit", () => {
|
||||
visit("/t/this-is-a-test-topic/9");
|
||||
|
||||
|
Reference in New Issue
Block a user