From 02eaca60c9a6599cb12ad98cde8b259372c7c486 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=9Al=C4=99zak?= Date: Thu, 10 Jul 2025 15:15:25 +0200 Subject: [PATCH 1/2] fix logout when disabled e2e test --- e2e/tests/auth.spec.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/e2e/tests/auth.spec.ts b/e2e/tests/auth.spec.ts index 604ca20f8b..ad2d019ddc 100644 --- a/e2e/tests/auth.spec.ts +++ b/e2e/tests/auth.spec.ts @@ -109,14 +109,9 @@ test.describe('Test user authentication', () => { await waitForRoute(page, routes.me); expect(page.url()).toBe(routes.base + routes.me); await disableUser(browser, testUser); - // The user should be logged out when the admin disables him - await waitForPromise(2000); - const responsePromise = page.waitForResponse( - (resp) => resp.url() === '**/user/' + testUser.username && resp.status() === 401, - ); + const responsePromise = page.waitForResponse((resp) => resp.status() === 401); await page.locator('a[href="/me"]').click(); - const response = await responsePromise; - expect(response.status()).toBe(401); + await responsePromise; }); }); From 33dcbe2d19e0ce8aa39632e158d05862c75c1b47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=9Al=C4=99zak?= Date: Thu, 10 Jul 2025 15:18:06 +0200 Subject: [PATCH 2/2] fix lint --- e2e/tests/auth.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/e2e/tests/auth.spec.ts b/e2e/tests/auth.spec.ts index ad2d019ddc..e2a5cb1257 100644 --- a/e2e/tests/auth.spec.ts +++ b/e2e/tests/auth.spec.ts @@ -13,7 +13,6 @@ import { changePassword, changePasswordByAdmin } from '../utils/controllers/prof import { disableUser } from '../utils/controllers/toggleUserState'; import { dockerDown, dockerRestart } from '../utils/docker'; import { waitForBase } from '../utils/waitForBase'; -import { waitForPromise } from '../utils/waitForPromise'; import { waitForRoute } from '../utils/waitForRoute'; test.describe('Test user authentication', () => {