Fix flaky filtering test (#20605)

* fix failing test

* more specific
This commit is contained in:
Angel Garbarino 2023-05-16 13:39:19 -06:00 committed by GitHub
parent 43fae50512
commit 74be2f8592
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -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}`;
@ -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]');