More code clean up
This commit is contained in:
@@ -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