diff --git a/tests/_helpers/env.ts b/tests/_helpers/env.ts index 87ca147f..de620a83 100644 --- a/tests/_helpers/env.ts +++ b/tests/_helpers/env.ts @@ -4,14 +4,46 @@ */ export const test_base_url = 'http://demo.localhost:5173'; export const dev_api_base = 'https://dev-api.oneskyit.com'; -export const testing_account_id = '_XY7DXtc9MY'; -export const testing_event_id = 'pjrcghqwert'; + +// Core test/demo IDs (from tests/README.md) +export const testing_account_id = '_XY7DXtc9MY'; // (1) "One Sky IT Demo" +export const testing_site_id = '92vkYC4fVEl'; // (12) "One Sky IT Demo" +export const testing_site_domain_id = '_6jcTbnJk-o'; // (12) "demo.localhost:5173" +export const testing_fqdn = 'demo.localhost:5173'; + +// Events test/demo IDs +export const testing_event_id = 'pjrcghqwert'; // (1) "Demo One Sky IT Conference" +export const testing_person_id = 'QWODAPCNLQU'; // (49) "Osiris Idem" + +/** + * Mock site_domain object for Playwright tests. + * Matches the structure expected by +layout.ts lookup_site_domain_v3() + */ +export const mock_site_domain = { + id: testing_site_domain_id, + site_id: testing_site_id, + site_domain_id: testing_site_domain_id, + account_id: testing_account_id, + account_id_random: testing_account_id, + account_code: 'OSIT_DEMO', + account_name: 'One Sky IT Demo', + fqdn: testing_fqdn, + enable: '1', + cfg_json: {}, + style_href: '', + header_image_path: '' +}; export const TEST_ENV = { test_base_url, dev_api_base, testing_account_id, - testing_event_id + testing_site_id, + testing_site_domain_id, + testing_fqdn, + testing_event_id, + testing_person_id, + mock_site_domain }; export default TEST_ENV; diff --git a/tests/_helpers/minimal_v3_mocks.ts b/tests/_helpers/minimal_v3_mocks.ts index 7d305a29..41accff9 100644 --- a/tests/_helpers/minimal_v3_mocks.ts +++ b/tests/_helpers/minimal_v3_mocks.ts @@ -1,4 +1,5 @@ import { Page } from '@playwright/test'; +import { mock_site_domain } from './env'; export const minimal_event = (event_id: string) => ({ data: { @@ -36,7 +37,11 @@ export async function attach_minimal_v3_routes(page: Page, event_id: string) { const method = req.method(); if (url.includes('site_domain/search')) { - return route.fulfill({ status: 200, contentType: 'application/json', body: JSON.stringify({ data: [{ id: 'td', site_id: 'ts' }] }) }); + return route.fulfill({ + status: 200, + contentType: 'application/json', + body: JSON.stringify({ data: [mock_site_domain] }) + }); } if (url.includes(`/v3/crud/event/${event_id}`) && method === 'GET') {