From 1bcfa87d187d92b8e9112c8531534c4d916bdf61 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 29 Aug 2017 15:51:25 +0200 Subject: [PATCH] FIX: select-box broken spec Introduces a test helper for selectBox to simplify these cases. --- test/javascripts/acceptance/topic-test.js.es6 | 3 ++- test/javascripts/helpers/assertions.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/test/javascripts/acceptance/topic-test.js.es6 b/test/javascripts/acceptance/topic-test.js.es6 index ac53c41dd75..2c85636b9a4 100644 --- a/test/javascripts/acceptance/topic-test.js.es6 +++ b/test/javascripts/acceptance/topic-test.js.es6 @@ -51,7 +51,8 @@ QUnit.test("Updating the topic title and category", assert => { click('#topic-title .d-icon-pencil'); fillIn('#edit-title', 'this is the new title'); - selectDropdown('.category-combobox', 4); + + selectBox('.title-wrapper .category-select-box', 'faq'); click('#topic-title .submit-edit'); diff --git a/test/javascripts/helpers/assertions.js b/test/javascripts/helpers/assertions.js index 4e6b53b5d16..51531fb606c 100644 --- a/test/javascripts/helpers/assertions.js +++ b/test/javascripts/helpers/assertions.js @@ -18,6 +18,11 @@ Ember.Test.registerAsyncHelper('selectDropdown', function(app, selector, itemId) $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) { var $items = find(selector + ":visible"); return $items.length === 0 ||