mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
FIX: select-box broken spec
Introduces a test helper for selectBox to simplify these cases.
This commit is contained in:
@ -51,7 +51,8 @@ QUnit.test("Updating the topic title and category", assert => {
|
|||||||
click('#topic-title .d-icon-pencil');
|
click('#topic-title .d-icon-pencil');
|
||||||
|
|
||||||
fillIn('#edit-title', 'this is the new title');
|
fillIn('#edit-title', 'this is the new title');
|
||||||
selectDropdown('.category-combobox', 4);
|
|
||||||
|
selectBox('.title-wrapper .category-select-box', 'faq');
|
||||||
|
|
||||||
click('#topic-title .submit-edit');
|
click('#topic-title .submit-edit');
|
||||||
|
|
||||||
|
@ -18,6 +18,11 @@ Ember.Test.registerAsyncHelper('selectDropdown', function(app, selector, itemId)
|
|||||||
$select2.trigger("change");
|
$select2.trigger("change");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Ember.Test.registerAsyncHelper('selectBox', function(app, selector, title) {
|
||||||
|
click(`${selector} .select-box-header`);
|
||||||
|
click(`${selector} .select-box-row[title="${title}"]`);
|
||||||
|
});
|
||||||
|
|
||||||
function invisible(selector) {
|
function invisible(selector) {
|
||||||
var $items = find(selector + ":visible");
|
var $items = find(selector + ":visible");
|
||||||
return $items.length === 0 ||
|
return $items.length === 0 ||
|
||||||
|
Reference in New Issue
Block a user