fix(convivo): consistent service cards, in-place pick details, no duplicated slot time
- groupAgenda drops orphan service slots (no session row), so every Service Session card consistently shows header + session row; list, slot count and Home Now/Next agree - Extract the session detail bottom sheet into shared components/SessionDetail.tsx; Home's My-picks chips now open it in place instead of routing to the Agenda (App passes openFeedback so Give-feedback works there too) - Sheet subtitle shows the slot name only when it adds information: auto-named 'Slot 10:15-11:00' no longer repeats the time range, and service names equal to the session title are skipped - e2e: orphan-slot test + Home session picks test (exact subtitle assertion) in convivo-admin-entry.spec.ts, 41/41 green; speaker-portal 19/19; docs + release record 2026-10-16.md
This commit is contained in:
1 parent
3d4dc207ff
commit
ef0446dcdf
10 files changed
+442
-177
No files matched your search
@@ -66,6 +66,74 @@ test.describe('Service agenda', () => {
|
||||
await expect(talkBlock.getByText('Different end room', { exact: false })).toHaveCount(0);
|
||||
await expect(talkBlock.getByText('Lunch room', { exact: false })).toHaveCount(0);
|
||||
});
|
||||
test('hides an orphan service slot that has no session behind it', async ({ page }) => {
|
||||
const { session } = await mockApi(page, { registered: true, checkedIn: true });
|
||||
// get_agenda LEFT JOINs sessions onto slots, so an orphan service slot
|
||||
// arrives as a row with the slot fields set but a null session. It must not
|
||||
// render a header-only card (the inconsistency), while real service slots
|
||||
// and talk slots stay.
|
||||
const rows = [
|
||||
{ slot_id: 1, slot_name: 'Arrival & Coffee', start_time: '08:30:00', end_time: '09:00:00', slot_type: 'service_session', session_id: 'session-1', title: 'Arrival & Coffee', room: 'Main', speakers: 'Staff' },
|
||||
{ slot_id: 2, slot_name: 'Slot 10:15–11:00', start_time: '10:15:00', end_time: '11:00:00', slot_type: 'session', session_id: 'session-2', title: 'A Talk', room: 'Main', speakers: 'Speaker' },
|
||||
{ slot_id: 67, slot_name: 'Service Session', start_time: '11:15:00', end_time: '12:00:00', slot_type: 'service_session', session_id: null, title: null, room: null, speakers: null },
|
||||
{ slot_id: 3, slot_name: 'Lunch', start_time: '12:00:00', end_time: '13:00:00', slot_type: 'service_session', session_id: 'session-3', title: 'Lunch', room: 'Main', speakers: 'Staff' },
|
||||
].map(row => ({ ...row, slot_date: '2026-02-20', description: '', material_path: null, capacity: null,
|
||||
average_feedback: null, ai_generated_feedback: null, level: null, area: null }));
|
||||
await page.route('**/rest/v1/rpc/get_agenda', route => route.fulfill({ json: rows }));
|
||||
await page.goto(`${appUrl}/auth/callback#access_token=${session.access_token}&refresh_token=${session.refresh_token}&type=magiclink`);
|
||||
await page.getByTestId('tab-agenda').click();
|
||||
await expect(page.locator('.slot-card')).toHaveCount(3);
|
||||
await expect(page.getByText('3 slots', { exact: true })).toBeVisible();
|
||||
await expect(page.locator('.slot-card').filter({ hasText: '11:15' })).toHaveCount(0);
|
||||
await expect(page.locator('.sess .title')).toHaveText(['Arrival & Coffee', 'A Talk', 'Lunch']);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Home session picks', () => {
|
||||
test('tapping a pick opens its session detail in place instead of routing to the Agenda', async ({ page }) => {
|
||||
const { session } = await mockApi(page, {
|
||||
registered: true, checkedIn: true,
|
||||
picks: [{ slot_id: 1, session_id: 'session-1' }],
|
||||
});
|
||||
const rows = [
|
||||
{ slot_id: 1, slot_name: 'Slot 10:15–11:00', start_time: '10:15:00', end_time: '11:00:00', slot_type: 'session',
|
||||
session_id: 'session-1', title: 'My Picked Talk', room: 'Room A', speakers: 'Ada Lovelace',
|
||||
description: 'Deep dive into picks.', level: 'Beginner', area: 'Power Apps' },
|
||||
{ slot_id: 2, slot_name: 'Slot 11:15–12:00', start_time: '11:15:00', end_time: '12:00:00', slot_type: 'session',
|
||||
session_id: 'session-2', title: 'Other Talk', room: 'Room B', speakers: 'Grace Hopper',
|
||||
description: '', level: null, area: null },
|
||||
].map(row => ({ ...row, slot_date: '2026-02-20', material_path: null, capacity: null,
|
||||
average_feedback: null, ai_generated_feedback: null }));
|
||||
await page.route('**/rest/v1/rpc/get_agenda', route => route.fulfill({ json: rows }));
|
||||
await page.goto(`${appUrl}/auth/callback#access_token=${session.access_token}&refresh_token=${session.refresh_token}&type=magiclink`);
|
||||
|
||||
await expect(page.getByTestId('tab-home')).toHaveClass(/active/);
|
||||
const chip = page.getByTestId('home-pick');
|
||||
await expect(chip).toHaveCount(1);
|
||||
await expect(chip).toContainText('My Picked Talk');
|
||||
|
||||
await chip.click();
|
||||
// The same detail sheet the Agenda shows, opened over Home.
|
||||
await expect(page.locator('.sheet h3')).toHaveText('My Picked Talk');
|
||||
await expect(page.locator('#sd-desc')).toHaveText('Deep dive into picks.');
|
||||
// The auto slot name ("Slot 10:15–11:00") only repeats the time range, so
|
||||
// the subtitle must not show it twice.
|
||||
await expect(page.locator('.sheet .sub')).toHaveText('10:15–11:00 · Room A');
|
||||
await expect(page.locator('.sheet')).toContainText('10:15–11:00');
|
||||
await expect(page.locator('.sheet')).toContainText('Room A');
|
||||
await expect(page.locator('.sheet')).toContainText('Ada Lovelace');
|
||||
await expect(page.locator('.sheet')).toContainText('📶 Beginner');
|
||||
// It is the user's pick, so the sheet offers to remove it.
|
||||
await expect(page.getByRole('button', { name: 'Remove my pick', exact: true })).toBeVisible();
|
||||
await expect(page.getByRole('button', { name: 'Pick this session', exact: true })).toHaveCount(0);
|
||||
// Still on Home — no round trip to the Agenda tab.
|
||||
await expect(page.getByTestId('tab-home')).toHaveClass(/active/);
|
||||
await expect(page.getByTestId('tab-agenda')).not.toHaveClass(/active/);
|
||||
|
||||
await page.locator('.sheet').getByRole('button', { name: '✕', exact: true }).click();
|
||||
await expect(page.locator('.sheet')).toHaveCount(0);
|
||||
await expect(page.getByTestId('home-pick')).toHaveCount(1);
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Event demo clock', () => {
|
||||
@@ -146,7 +214,7 @@ function mockSession(email: string) {
|
||||
return { user, access_token: `eyJhbGciOiJIUzI1NiJ9.${payload}.test-signature`, refresh_token: 'mock-refresh-token', token_type: 'bearer', expires_in: 3600 };
|
||||
}
|
||||
|
||||
async function mockApi(page: Page, options: { email?: string; admin?: boolean; registered?: boolean; checkedIn?: boolean; staff?: boolean; eventDate?: string; realtimeClock?: boolean } = {}) {
|
||||
async function mockApi(page: Page, options: { email?: string; admin?: boolean; registered?: boolean; checkedIn?: boolean; staff?: boolean; eventDate?: string; realtimeClock?: boolean; picks?: { slot_id: number; session_id: string }[] } = {}) {
|
||||
const email = options.email || '[email protected]';
|
||||
const session = mockSession(email);
|
||||
const calls = { users: 0, exchanges: 0, passwords: 0, logouts: 0, otp: 0, lanyards: 0, mutations: [] as string[] };
|
||||
@@ -177,6 +245,12 @@ async function mockApi(page: Page, options: { email?: string; admin?: boolean; r
|
||||
await route.fulfill({ json: options.admin !== false });
|
||||
}
|
||||
else if (pathname.endsWith('/rpc/is_admin')) await route.fulfill({ json: options.admin !== false });
|
||||
else if (pathname.endsWith('/preferences')) {
|
||||
await route.fulfill({ json: (options.picks ?? []).map((p, index) => ({
|
||||
id: `pref-${index}`, event_id: '33333333-3333-4333-8333-333333333333',
|
||||
contact_email: email, session_id: p.session_id, slot_id: p.slot_id,
|
||||
})) });
|
||||
}
|
||||
else if (pathname.endsWith('/contacts')) await route.fulfill({ json: { email, full_name: 'Test Member', is_admin: false, show_email: false, show_linkedin: false } });
|
||||
else if (pathname.endsWith('/registrations')) {
|
||||
expect(new URL(request.url()).searchParams.get('event_id')).toBe('eq.33333333-3333-4333-8333-333333333333');
|
||||
|
||||
Reference in new issue
Block a user