Compare commits
8 Commits
4f72ef1b4a
...
d0ae3b6f04
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d0ae3b6f04 | ||
e09a6892cc | |||
bcc86f2c3b | |||
1b957879d4 | |||
536f74cd7a | |||
2399f6238c | |||
![]() |
5d2c43cfef | ||
![]() |
2055c95c82 |
@ -21,7 +21,12 @@ export default function GroupsTable({ groups, onUpdate, onEdit, onEditAffinities
|
||||
|
||||
const actions = (group: Group) => (
|
||||
<div className="flex flex-row items-center">
|
||||
<TrashIcon className='size-6 cursor-pointer' onClick={() => { api.destroy(serializer, group, onUpdate) }} />
|
||||
<TrashIcon className='size-6 cursor-pointer' onClick={() => {
|
||||
if (window.confirm(`Are you sure you want to delete guest "${group.name}"?`)) {
|
||||
api.destroy(serializer, group, onUpdate)
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<PencilIcon className='size-6 cursor-pointer' onClick={() => onEdit(group)} />
|
||||
<AdjustmentsHorizontalIcon className='size-6 cursor-pointer' onClick={() => onEditAffinities(group)} />
|
||||
</div>
|
||||
|
@ -18,12 +18,12 @@
|
||||
"dompurify": "^3.2.6",
|
||||
"next": "15.3.3",
|
||||
"next-auth": "5.0.0-beta.28",
|
||||
"postcss": "8.5.5",
|
||||
"postcss": "8.5.6",
|
||||
"primeicons": "^7.0.0",
|
||||
"primereact": "^10.8.2",
|
||||
"react": "19.0.0-rc-f38c22b244-20240704",
|
||||
"react-dom": "19.0.0-rc-f38c22b244-20240704",
|
||||
"tailwindcss": "3.4.17",
|
||||
"tailwindcss": "4.1.10",
|
||||
"typescript": "5.8.3",
|
||||
"use-debounce": "^10.0.1",
|
||||
"uuid": "11.1.0",
|
||||
@ -32,7 +32,7 @@
|
||||
"devDependencies": {
|
||||
"@playwright/test": "^1.52.0",
|
||||
"@types/bcrypt": "^5.0.2",
|
||||
"@types/node": "24.0.1",
|
||||
"@types/node": "24.0.3",
|
||||
"@types/react": "18.3.23",
|
||||
"@types/react-dom": "18.3.7",
|
||||
"wait-on": "^8.0.3"
|
||||
|
793
pnpm-lock.yaml
generated
793
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -52,6 +52,8 @@ test('should allow CRUD on groups', async ({ page }) => {
|
||||
await dialog.getByLabel('Name').fill("Pam's friends");
|
||||
await dialog.getByRole('button', { name: 'Create' }).click();
|
||||
|
||||
await expect(page.getByRole('row')).toHaveCount(4); // 1 header row + 3 data rows
|
||||
|
||||
await expect(dialog).not.toBeVisible();
|
||||
|
||||
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s friends');
|
||||
@ -62,4 +64,19 @@ test('should allow CRUD on groups', async ({ page }) => {
|
||||
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(6)).toHaveText('0');
|
||||
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(7)).toHaveText('0');
|
||||
await expect(page.getByRole('row').nth(1).locator('svg:visible')).toHaveCount(3);
|
||||
|
||||
// Modify the newly added group
|
||||
await page.getByRole('row').nth(1).locator('svg').nth(2).click(); // Click edit icon
|
||||
await expect(dialog).toBeVisible();
|
||||
await expect(dialog.getByLabel('Name')).toHaveValue("Pam's friends");
|
||||
await dialog.getByLabel('Name').fill('Pam\'s best friends');
|
||||
await dialog.getByRole('button', { name: 'Update' }).click();
|
||||
|
||||
await expect(page.getByRole('row').nth(1).getByRole('cell').nth(0)).toContainText('Pam\'s best friends');
|
||||
|
||||
// Delete the newly added group
|
||||
page.on('dialog', dialog => dialog.accept());
|
||||
|
||||
await page.getByRole('row').nth(1).locator('svg').nth(1).click(); // Click delete icon
|
||||
await expect(page.getByRole('row')).toHaveCount(3); // 1 header row + 2 data rows
|
||||
});
|
@ -57,4 +57,30 @@ export default async function mockGroupsAPI({ page }: { page: Page }): Promise<v
|
||||
await route.fulfill({ json })
|
||||
}
|
||||
})
|
||||
|
||||
page.route("*/**/api/default/groups/*", async route => {
|
||||
if (route.request().method() === 'PUT') {
|
||||
const json = {
|
||||
"id": "4d55bc34-6f42-4e2e-82a1-71ae32da2466",
|
||||
"name": "Pam's best friends",
|
||||
"icon": "pi pi-desktop",
|
||||
"parent_id": null,
|
||||
"color": "#0000ff",
|
||||
"attendance": {
|
||||
"total": 0,
|
||||
"considered": 0,
|
||||
"invited": 0,
|
||||
"confirmed": 0,
|
||||
"declined": 0,
|
||||
"tentative": 0
|
||||
}
|
||||
}
|
||||
|
||||
await route.fulfill({ json });
|
||||
} else if (route.request().method() === 'DELETE') {
|
||||
const json = {}
|
||||
|
||||
await route.fulfill({ json });
|
||||
}
|
||||
});
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user