From 83d968c48d2d52cbe0b2ab349e99ec1a101fa0e8 Mon Sep 17 00:00:00 2001 From: Olivia Guyot Date: Wed, 13 Dec 2023 14:59:19 +0100 Subject: [PATCH] fix(e2e): avoid race condition in datahub when sorting records --- apps/datahub-e2e/src/e2e/datasets.cy.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/apps/datahub-e2e/src/e2e/datasets.cy.ts b/apps/datahub-e2e/src/e2e/datasets.cy.ts index b096d09cec..2f8b6325c3 100644 --- a/apps/datahub-e2e/src/e2e/datasets.cy.ts +++ b/apps/datahub-e2e/src/e2e/datasets.cy.ts @@ -445,15 +445,13 @@ describe('datasets', () => { .as('initialResultTitles') cy.get('@sortBy').selectDropdownOption('desc,createDate') }) - it('changes the results order', () => { - cy.get('@initialResultTitles').then((initialResultTitles) => { - cy.get('@results') - .find('[data-cy="recordTitle"]') - .then(($titles) => - $titles.toArray().map((title) => title.innerText.trim()) - ) - .should('not.eql', initialResultTitles) - }) + it('changes the results order', function () { + cy.get('@results') + .find('[data-cy="recordTitle"]') + .then(($titles) => + $titles.toArray().map((title) => title.innerText.trim()) + ) + .should('not.eql', this.initialResultTitles) // @initialResultTitles }) }) })