mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-16 20:22:15 +01:00
add dashboard frontend
This commit is contained in:
@@ -8,9 +8,7 @@ async function registerNewUser(page, email, password) {
|
||||
await page.getByLabel('Password', { exact: true }).fill(password);
|
||||
await page.getByLabel('Confirm Password').fill(password);
|
||||
await page.getByRole('button', { name: 'Register' }).click();
|
||||
await expect(
|
||||
page.getByRole('heading', { name: 'Dashboard' })
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId('dashboard_view')).toBeVisible();
|
||||
}
|
||||
|
||||
test('can register, logout and log back in', async ({ page }) => {
|
||||
@@ -18,20 +16,15 @@ test('can register, logout and log back in', async ({ page }) => {
|
||||
const email = `john+${Math.round(Math.random() * 10000)}@doe.com`;
|
||||
const password = 'suchagreatpassword123';
|
||||
await registerNewUser(page, email, password);
|
||||
await expect(
|
||||
page.getByRole('button', { name: "John's Organization" })
|
||||
).toBeVisible();
|
||||
await page.locator('#currentUserButton').click();
|
||||
|
||||
await page.getByRole('button', { name: 'Log Out' }).click();
|
||||
await expect(page.getByTestId('dashboard_view')).toBeVisible();
|
||||
await page.getByTestId('current_user_button').click();
|
||||
await page.getByText('Log Out').click();
|
||||
await page.waitForURL(PLAYWRIGHT_BASE_URL + '/');
|
||||
await page.goto(PLAYWRIGHT_BASE_URL + '/login');
|
||||
await page.getByLabel('Email').fill(email);
|
||||
await page.getByLabel('Password').fill(password);
|
||||
await page.getByRole('button', { name: 'Log in' }).click();
|
||||
await expect(
|
||||
page.getByRole('heading', { name: 'Dashboard' })
|
||||
).toBeVisible();
|
||||
await expect(page.getByTestId('dashboard_view')).toBeVisible();
|
||||
});
|
||||
|
||||
test('can register and delete account', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user