diff --git a/addons/core/addon/components/dropdown/index.hbs b/addons/core/addon/components/dropdown/index.hbs index a17ef41b9..e48b0dee4 100644 --- a/addons/core/addon/components/dropdown/index.hbs +++ b/addons/core/addon/components/dropdown/index.hbs @@ -4,15 +4,15 @@ }} diff --git a/addons/core/tests/integration/components/dropdown/index-test.js b/addons/core/tests/integration/components/dropdown/index-test.js index 13f6a6656..62ee9f84a 100644 --- a/addons/core/tests/integration/components/dropdown/index-test.js +++ b/addons/core/tests/integration/components/dropdown/index-test.js @@ -23,17 +23,19 @@ module('Integration | Component | dropdown/index', function (hooks) { name: 'Fake Project', displayName: 'Fake Project', }; - const name = 'Click Me'; + const name = 'test'; + const toggleText = 'Click Me'; const FIRST_ITEM_SELECTOR = `[data-test-checkbox="${firstItem.id}"]`; const SECOND_ITEM_SELECTOR = `[data-test-checkbox="${secondItem.id}"]`; - const TOGGLE_DROPDOWN_SELECTOR = '.hds-dropdown-toggle-button'; + const TOGGLE_DROPDOWN_SELECTOR = `[name=${name}] button`; const SEARCH_INPUT_SELECTOR = '[data-test-dropdown-search]'; - const COUNT_SELECTOR = '.hds-dropdown-toggle-button__count'; - const ITEM_SELECTOR = '.hds-dropdown-list-item'; + const COUNT_SELECTOR = `[name=${name}] button div:nth-child(2)`; + const ITEM_SELECTOR = 'li'; hooks.beforeEach(function () { this.set('name', name); + this.set('toggleText', toggleText); this.set('array', [firstItem, secondItem]); this.set('checkedItems', [firstItem.id]); this.set('applyFilter', () => {}); @@ -41,14 +43,15 @@ module('Integration | Component | dropdown/index', function (hooks) { test('it renders', async function (assert) { await render(hbs``); await click(TOGGLE_DROPDOWN_SELECTOR); - assert.dom('.hds-dropdown-toggle-button__text').hasText(name); + assert.dom(TOGGLE_DROPDOWN_SELECTOR).includesText(toggleText); assert.dom(FIRST_ITEM_SELECTOR).isVisible(); assert.dom(FIRST_ITEM_SELECTOR).isChecked(); assert.dom(SECOND_ITEM_SELECTOR).isVisible(); @@ -58,7 +61,8 @@ module('Integration | Component | dropdown/index', function (hooks) { test('it renders a search input when isSearchable is true', async function (assert) { await render(hbs`