Skip to content

Commit

Permalink
Fix flaky filtering test (hashicorp#20605)
Browse files Browse the repository at this point in the history
* fix failing test

* more specific
  • Loading branch information
Monkeychip committed May 16, 2023
1 parent b78f4bf commit ba1633f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/tests/acceptance/secrets/backend/engines-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ module('Acceptance | secret-engine list view', function (hooks) {
});

test('it filters by name and engine type', async function (assert) {
assert.expect(3);
assert.expect(4);
const enginePath1 = `aws-1-${this.uid}`;
const enginePath2 = `aws-2-${this.uid}`;

Expand All @@ -98,10 +98,11 @@ module('Acceptance | secret-engine list view', function (hooks) {
assert.strictEqual(rows.length, rowsAws.length, 'all rows returned are aws');
// filter by name
await clickTrigger('#filter-by-engine-name');
await searchSelect.options.objectAt(1).click();
const firstItemToSelect = searchSelect.options.objectAt(0).text;
await searchSelect.options.objectAt(0).click();
const singleRow = document.querySelectorAll('[data-test-auth-backend-link]');

assert.dom(singleRow[0]).includesText('aws-2', 'shows the filtered by name engine');
assert.strictEqual(singleRow.length, 1, 'returns only one row');
assert.dom(singleRow[0]).includesText(firstItemToSelect, 'shows the filtered by name engine');
// clear filter by engine name
await searchSelect.deleteButtons.objectAt(1).click();
const rowsAgain = document.querySelectorAll('[data-test-auth-backend-link]');
Expand Down

0 comments on commit ba1633f

Please sign in to comment.