More code clean up

This commit is contained in:
Scott Idem
2026-03-24 10:56:31 -04:00
parent 42358efe7d
commit d27ec58fe9
43 changed files with 106 additions and 106 deletions

View File

@@ -3,8 +3,8 @@ import { describe, it, expect, vi } from 'vitest';
// Use hoist-safe factories for vi.mock
vi.mock('$lib/api/api', () => ({
api: {
create_nested_obj_v3: vi.fn(),
update_nested_obj_v3: vi.fn(),
create_nested_obj: vi.fn(),
update_nested_obj: vi.fn(),
delete_nested_ae_obj: vi.fn(),
search_ae_obj: vi.fn()
}
@@ -16,9 +16,9 @@ vi.mock('$lib/ae_events/ae_events__event_badge_template', () => ({ load_ae_obj_i
import { create_ae_obj__event_badge } from './ae_events__event_badge';
describe('create_ae_obj__event_badge', () => {
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 mocked = await import('$lib/api/api');
const mockCreateNested = mocked.api.create_nested_obj_v3 as any;
const mockCreateNested = mocked.api.create_nested_obj as any;
const fakeResult = { event_badge_id: 'eb123', full_name: 'Test User' };
mockCreateNested.mockResolvedValue(fakeResult);
@@ -45,9 +45,9 @@ describe('create_ae_obj__event_badge', () => {
});
describe('update_ae_obj__event_badge', () => {
it('calls api.update_nested_obj_v3 with correct params and returns result', async () => {
it('calls api.update_nested_obj with correct params and returns result', async () => {
const mocked = await import('$lib/api/api');
const mockUpdate = mocked.api.update_nested_obj_v3 as any;
const mockUpdate = mocked.api.update_nested_obj as any;
const fakeResult = { event_badge_id: 'eb999', full_name: 'Updated' };
mockUpdate.mockResolvedValue(fakeResult);