Saving more code clean up and removal

This commit is contained in:
Scott Idem
2026-03-24 11:15:01 -04:00
parent d27ec58fe9
commit 512e5ef87c
25 changed files with 130 additions and 153 deletions

View File

@@ -17,7 +17,7 @@ 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()
* Matches the structure expected by +layout.ts lookup_site_domain()
*/
export const mock_site_domain = {
id: testing_site_domain_id,

View File

@@ -29,7 +29,7 @@ export const minimal_badge = (overrides: Record<string, any> = {}) => ({
* - Responds to event GET, badge search/create/update/delete, and a simple site_domain/search.
* - Keeps created badge state in-memory for the page session.
*/
export async function attach_minimal_v3_routes(page: Page, event_id: string) {
export async function attach_minimal_routes(page: Page, event_id: string) {
let created_badge: any = null;
await page.route('**/v3/**', async (route) => {
@@ -112,13 +112,13 @@ export async function seed_trusted_session(
*
* Wires:
* - page.on('pageerror') stderr
* - attach_minimal_v3_routes() mock all /v3/ API calls
* - attach_minimal_routes() mock all /v3/ API calls
* - seed_trusted_session() seed ae_loc localStorage with trusted auth
*/
export async function setup_badge_test_page(page: Page, event_id: string): Promise<void> {
page.on('pageerror', (err) => console.error(`BROWSER ERROR: ${err.message}`));
await attach_minimal_v3_routes(page, event_id);
await attach_minimal_routes(page, event_id);
await seed_trusted_session(page, event_id);
}
export default { minimal_event, minimal_badge, attach_minimal_v3_routes, seed_trusted_session, setup_badge_test_page };
export default { minimal_event, minimal_badge, attach_minimal_routes, seed_trusted_session, setup_badge_test_page };