major features update
This commit is contained in:
parent
519fb49901
commit
4e2fab67c5
48 changed files with 3925 additions and 208 deletions
49
e2e/pages/home.spec.ts
Normal file
49
e2e/pages/home.spec.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { test, expect } from '@playwright/test';
|
||||
import { login, verifyCreateUser, todate } from './util';
|
||||
|
||||
test('can log out', async ({ page }) => {
|
||||
await login(page);
|
||||
|
||||
await page.getByText("Logout").click();
|
||||
await expect(page.getByLabel("Username")).toBeVisible();
|
||||
});
|
||||
|
||||
test('has no contacts', async ({ page }) => {
|
||||
await login(page);
|
||||
|
||||
await expect(page.getByRole("navigation").getByRole("link")).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('can add contacts', async ({ page }) => {
|
||||
await login(page);
|
||||
await verifyCreateUser(page, { names: ['John Contact'] });
|
||||
await verifyCreateUser(page, { names: ['Jack Contact'] });
|
||||
await expect(page.getByRole("navigation").getByRole("link")).toHaveCount(2);
|
||||
});
|
||||
|
||||
test('shows "never" for unfreshened contacts', async ({ page }) => {
|
||||
await login(page);
|
||||
await verifyCreateUser(page, { names: ['John Contact'] });
|
||||
await page.getByRole('link', { name: 'Mascarpone' }).click();
|
||||
|
||||
await expect(page.locator('#freshness')).toContainText('John Contactnever');
|
||||
});
|
||||
|
||||
test('shows the date for fresh contacts', async ({ page }) => {
|
||||
await login(page);
|
||||
await verifyCreateUser(page, { names: ['John Contact'] });
|
||||
await page.getByRole('link', { name: /edit/i }).click();
|
||||
await page.getByRole('button', { name: /fresh/i }).click();
|
||||
await page.getByRole('button', { name: /save/i }).click();
|
||||
await page.getByRole('link', { name: 'Mascarpone' }).click();
|
||||
await expect(page.locator('#freshness')).toContainText(`John Contact${todate()}`);
|
||||
});
|
||||
|
||||
test('sidebar is sorted alphabetically', async ({ page }) => {
|
||||
await login(page);
|
||||
await verifyCreateUser(page, { names: ['Zulu'] });
|
||||
await verifyCreateUser(page, { names: ['Alfa'] });
|
||||
await verifyCreateUser(page, { names: ['Golf'] });
|
||||
|
||||
await expect(page.getByRole('navigation')).toHaveText(/Alfa\s*Golf\s*Zulu/);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue