More code clean up
This commit is contained in:
@@ -854,7 +854,7 @@ test.describe('IDAA Recovery Meetings — Field Save Payload Verification', () =
|
||||
|
||||
const body = await capture_patch_body(page);
|
||||
|
||||
// _json fields are auto-serialized to JSON strings by update_ae_obj_v3 before
|
||||
// _json fields are auto-serialized to JSON strings by update_ae_obj before
|
||||
// the PATCH is sent (Standard Aether Pattern: any key ending in _json is
|
||||
// JSON.stringify'd so the backend receives a string, not an object).
|
||||
const addr = JSON.parse(body.location_address_json);
|
||||
@@ -891,7 +891,7 @@ test.describe('IDAA Recovery Meetings — Field Save Payload Verification', () =
|
||||
|
||||
const body = await capture_patch_body(page);
|
||||
|
||||
// attend_json is auto-serialized to a JSON string by update_ae_obj_v3.
|
||||
// attend_json is auto-serialized to a JSON string by update_ae_obj.
|
||||
const attend = JSON.parse(body.attend_json);
|
||||
expect(attend?.zoom, 'attend_json.zoom is present').toBeTruthy();
|
||||
expect(body.attend_url_code, 'Zoom meeting ID').toBe('82345678901');
|
||||
@@ -988,7 +988,7 @@ test.describe('IDAA Recovery Meetings — Field Save Payload Verification', () =
|
||||
|
||||
const body = await capture_patch_body(page);
|
||||
|
||||
// contact_li_json is auto-serialized to a JSON string by update_ae_obj_v3.
|
||||
// contact_li_json is auto-serialized to a JSON string by update_ae_obj.
|
||||
const contacts = JSON.parse(body.contact_li_json);
|
||||
expect(Array.isArray(contacts), 'contact_li_json is an array').toBe(true);
|
||||
expect(contacts[0]?.full_name, 'contact 1 name').toBe('Dr. Alice Carter');
|
||||
|
||||
@@ -7,7 +7,7 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
|
||||
// Mock the api module used by the ae_events file
|
||||
const mockCreateNested = vi.fn();
|
||||
vi.mock('$lib/api/api', () => ({ api: { create_nested_obj_v3: mockCreateNested } }));
|
||||
vi.mock('$lib/api/api', () => ({ api: { create_nested_obj: mockCreateNested } }));
|
||||
|
||||
// Avoid touching IndexedDB caching in this unit test
|
||||
vi.mock('$lib/ae_core/core__idb_dexie', () => ({ db_save_ae_obj_li__ae_obj: vi.fn() }));
|
||||
@@ -20,7 +20,7 @@ describe('create_ae_obj__event_badge', () => {
|
||||
mockCreateNested.mockReset();
|
||||
});
|
||||
|
||||
it('calls api.create_nested_obj_v3 with the correct params and returns the result', async () => {
|
||||
it('calls api.create_nested_obj with the correct params and returns the result', async () => {
|
||||
const fakeResult = { event_badge_id: 'eb123', full_name: 'Test User' };
|
||||
mockCreateNested.mockResolvedValue(fakeResult);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user