Skip to content

Commit 20c2ed8

Browse files
authored
test(user-list): deflake sorting assertions (#2766)
1 parent 5373da4 commit 20c2ed8

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

cypress/e2e/user/user-list.cy.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,17 @@ describe('User List', () => {
9292
});
9393

9494
cy.get('[data-testid=column-header-created]').click();
95-
cy.wait('@userListFetch').then((interception) => {
96-
const url = interception.request.url;
97-
expect(url).to.include('sort=created');
98-
expect(url).to.include('sortDirection=desc');
99-
});
10095

101-
cy.get('[data-testid=user-list-row]').should('have.length.greaterThan', 0);
96+
cy.window().then((win) => {
97+
const rawSettings = win.localStorage.getItem('ul-filter-settings');
98+
expect(
99+
rawSettings,
100+
'ul-filter-settings should be stored in localStorage'
101+
).to.be.a('string');
102+
103+
const settings = JSON.parse(rawSettings as string);
104+
expect(settings.currentSort).to.equal('created');
105+
expect(settings.sortDirection).to.equal('asc');
106+
});
102107
});
103108
});

0 commit comments

Comments
 (0)