mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
Replaces toolbar popup-menu with select-kit
This commit is contained in:
@ -20,7 +20,6 @@ function initializeDetails(api) {
|
||||
"details_text",
|
||||
{ multiline: false }
|
||||
);
|
||||
this.set('optionsVisible', false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -8,10 +8,9 @@ function findTextarea() {
|
||||
|
||||
test('details button', (assert) => {
|
||||
visit("/");
|
||||
|
||||
click('#create-topic');
|
||||
click('button.options');
|
||||
click('.popup-menu .d-icon-caret-right');
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
selectKitSelectRow('insertDetails', { selector: '.toolbar-popup-menu-options'});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
@ -29,8 +28,8 @@ test('details button', (assert) => {
|
||||
textarea.selectionEnd = textarea.value.length;
|
||||
});
|
||||
|
||||
click('button.options');
|
||||
click('.popup-menu .d-icon-caret-right');
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
selectKitSelectRow('insertDetails', { selector: '.toolbar-popup-menu-options'});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
@ -52,8 +51,8 @@ test('details button', (assert) => {
|
||||
textarea.selectionEnd = 28;
|
||||
});
|
||||
|
||||
click('button.options');
|
||||
click('.popup-menu .d-icon-caret-right');
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
selectKitSelectRow('insertDetails', { selector: '.toolbar-popup-menu-options'});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
@ -75,8 +74,8 @@ test('details button', (assert) => {
|
||||
textarea.selectionEnd = 29;
|
||||
});
|
||||
|
||||
click('button.options');
|
||||
click('.popup-menu .d-icon-caret-right');
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
selectKitSelectRow('insertDetails', { selector: '.toolbar-popup-menu-options'});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
@ -104,8 +103,8 @@ test('details button surrounds all selected text in a single details block', (as
|
||||
textarea.selectionEnd = textarea.value.length;
|
||||
});
|
||||
|
||||
click('button.options');
|
||||
click('.popup-menu .d-icon-caret-right');
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
selectKitSelectRow('insertDetails', { selector: '.toolbar-popup-menu-options'});
|
||||
|
||||
andThen(() => {
|
||||
assert.equal(
|
||||
|
@ -16,7 +16,7 @@ test("regular user - sufficient trust level", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(!exists("button[title='Build Poll']"), "it hides the builder button");
|
||||
assert.ok(!exists(".select-kit-row[title='Build Poll']"), "it hides the builder button");
|
||||
});
|
||||
});
|
||||
|
||||
@ -26,7 +26,7 @@ test("regular user - insufficient trust level", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(!exists("button[title='Build Poll']"), "it hides the builder button");
|
||||
assert.ok(!exists(".select-kit-row[title='Build Poll']"), "it hides the builder button");
|
||||
});
|
||||
});
|
||||
|
||||
@ -36,6 +36,6 @@ test("staff", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(!exists("button[title='Build Poll']"), "it hides the builder button");
|
||||
assert.ok(!exists(".select-kit-row[title='Build Poll']"), "it hides the builder button");
|
||||
});
|
||||
});
|
||||
|
@ -16,7 +16,7 @@ test("regular user - sufficient trust level", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(exists("button[title='Build Poll']"), "it shows the builder button");
|
||||
assert.ok(exists(".select-kit-row[title='Build Poll']"), "it shows the builder button");
|
||||
});
|
||||
});
|
||||
|
||||
@ -26,7 +26,7 @@ test("regular user - insufficient trust level", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(!exists("button[title='Build Poll']"), "it hides the builder button");
|
||||
assert.ok(!exists(".select-kit-row[title='Build Poll']"), "it hides the builder button");
|
||||
});
|
||||
});
|
||||
|
||||
@ -36,6 +36,6 @@ test("staff - with insufficient trust level", (assert) => {
|
||||
displayPollBuilderButton();
|
||||
|
||||
andThen(() => {
|
||||
assert.ok(exists("button[title='Build Poll']"), "it shows the builder button");
|
||||
assert.ok(exists(".select-kit-row[title='Build Poll']"), "it shows the builder button");
|
||||
});
|
||||
});
|
||||
|
@ -2,4 +2,6 @@ export function displayPollBuilderButton() {
|
||||
visit("/");
|
||||
click("#create-topic");
|
||||
click(".d-editor-button-bar .options");
|
||||
|
||||
expandSelectKit('.toolbar-popup-menu-options');
|
||||
}
|
||||
|
Reference in New Issue
Block a user