From 20c2ed866fdca77eae80b98d2265028b2be7d100 Mon Sep 17 00:00:00 2001 From: 0xsysr3ll <31414959+0xSysR3ll@users.noreply.github.com> Date: Fri, 27 Mar 2026 10:41:32 +0100 Subject: [PATCH] test(user-list): deflake sorting assertions (#2766) --- cypress/e2e/user/user-list.cy.ts | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/cypress/e2e/user/user-list.cy.ts b/cypress/e2e/user/user-list.cy.ts index 45fdd8c39..09b5d1814 100644 --- a/cypress/e2e/user/user-list.cy.ts +++ b/cypress/e2e/user/user-list.cy.ts @@ -92,12 +92,17 @@ describe('User List', () => { }); cy.get('[data-testid=column-header-created]').click(); - cy.wait('@userListFetch').then((interception) => { - const url = interception.request.url; - expect(url).to.include('sort=created'); - expect(url).to.include('sortDirection=desc'); - }); - cy.get('[data-testid=user-list-row]').should('have.length.greaterThan', 0); + cy.window().then((win) => { + const rawSettings = win.localStorage.getItem('ul-filter-settings'); + expect( + rawSettings, + 'ul-filter-settings should be stored in localStorage' + ).to.be.a('string'); + + const settings = JSON.parse(rawSettings as string); + expect(settings.currentSort).to.equal('created'); + expect(settings.sortDirection).to.equal('asc'); + }); }); });