Adapt the guests table to use the new API format #105

Merged
bustikiller merged 4 commits from guests-api-changes into main 2024-11-17 10:43:38 +00:00
Showing only changes of commit 6fcf7d87a8 - Show all commits

View File

@ -2,32 +2,26 @@ import { test, expect, Page } from '@playwright/test'
const mockGuestsAPI = ({ page }: { page: Page }) => { const mockGuestsAPI = ({ page }: { page: Page }) => {
page.route('*/**/api/guests.json', async route => { page.route('*/**/api/guests.json', async route => {
const json = { const json = [
data: [
{ {
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6", "id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"type": "guest",
"attributes": {
"id": "f4a09c28-40ea-4553-90a5-96935a59cac6",
"group_id": "2fcb8b22-6b07-4c34-92e3-a2535dbc5b14",
"status": "Tentative", "status": "Tentative",
"name": "Kristofer Rohan DVM", "name": "Kristofer Rohan DVM",
"group_name": "Childhood friends" "group": {
"id": "2fcb8b22-6b07-4c34-92e3-a2535dbc5b14",
"name": "Childhood friends",
} }
}, },
{ {
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18", "id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"type": "guest",
"attributes": {
"id": "bd585c40-0937-4cde-960a-bb23acfd6f18",
"group_id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"status": "Invited", "status": "Invited",
"name": "Olevia Quigley Jr.", "name": "Olevia Quigley Jr.",
"group_name": "Work" "group": {
"id": "da8edf26-3e1e-4cbb-b985-450c49fffe01",
"name": "Work",
} }
}, },
] ];
};
await route.fulfill({ json }) await route.fulfill({ json })
}) })