feat: implement permissions and actions management
- Add permissions logic for status options in corrective actions. - Create tests for permissions functionality. - Implement queries for user authentication and actions management. - Develop Actions page to display and manage corrective actions. - Create authentication pages for login, setup, and password reset. - Add IncidentDetail page to view incident details and associated actions. - Implement Settings page for user management and password changes.
This commit is contained in:
1 parent
708da6b9f7
commit
3f6dff5f24
94 files changed
+7213
-643
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import { expect, type Page } from '@playwright/test'
|
||||
|
||||
export const PASSWORD = 'e2e test password'
|
||||
export const users = {
|
||||
admin: { name: 'Avery Admin', email: 'admin@e2e.test' },
|
||||
supervisor: { name: 'Sam Supervisor', email: 'supervisor@e2e.test' },
|
||||
reporter: { name: 'Riley Reporter', email: 'reporter@e2e.test' },
|
||||
} as const
|
||||
|
||||
export async function signIn(page: Page, who: keyof typeof users) {
|
||||
await page.goto('/login')
|
||||
await page.getByLabel('Email').fill(users[who].email)
|
||||
await page.getByLabel('Password').fill(PASSWORD)
|
||||
await page.getByRole('button', { name: 'Sign in', exact: true }).click()
|
||||
await expect(page.getByRole('heading', { level: 1 })).toContainText(users[who].name.split(' ')[0])
|
||||
}
|
||||
|
||||
/** A unique title so parallel tests (and the desktop/mobile projects) never collide. */
|
||||
export const unique = (title: string) => `${title} ${Math.random().toString(36).slice(2, 7)}`
|
||||
|
||||
/** 1×1 PNG. */
|
||||
export const photo = {
|
||||
name: 'scene.png',
|
||||
mimeType: 'image/png',
|
||||
buffer: Buffer.from('iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==', 'base64'),
|
||||
}
|
||||
Reference in new issue
Block a user