(frontend) add logout button

Rework the header based on latest Johann's design, which introduced a
dropdown menu to manage user account.

In this menu, you can find a logout button, which ends up the backend
session by calling the logout endpoint. Please that automatic redirection
when receiving the backend response were disabled. We handle it in our
custom hook, which reload the page.

Has the session cookie have been cleared, on reloading the page, a new
loggin flow is initiated, and the user is redirected to the OIDC provider.
This commit is contained in:
Anthony LC
2024-05-14 13:08:21 +02:00
committed by Anthony LC
parent d221ebe4f9
commit 004a4edfe7
8 changed files with 65 additions and 28 deletions

View File

@@ -64,4 +64,20 @@ test.describe('Header', () => {
await expect(page.getByRole('link', { name: 'Grist' })).toBeVisible();
});
test('checks logout button', async ({ page }) => {
await page
.getByRole('button', {
name: 'My account',
})
.click();
await page
.getByRole('button', {
name: 'Logout',
})
.click();
await expect(page.getByRole('button', { name: 'Sign in' })).toBeVisible();
});
});