dashy/tests/unit/error-handler.test.js
2026-01-13 12:55:02 +00:00

24 lines
1,007 B
JavaScript

import { describe, it, expect } from 'vitest';
describe('ErrorHandler', () => {
it('exports InfoKeys constants', async () => {
const { InfoKeys } = await import('@/utils/ErrorHandler');
expect(InfoKeys.AUTH).toBe('Authentication');
expect(InfoKeys.CLOUD_BACKUP).toBe('Cloud Backup & Restore');
expect(InfoKeys.EDITOR).toBe('Interactive Editor');
expect(InfoKeys.RAW_EDITOR).toBe('Raw Config Editor');
expect(InfoKeys.VISUAL).toBe('Layout & Styles');
});
it('exports handler functions', async () => {
const handlers = await import('@/utils/ErrorHandler');
expect(typeof handlers.ErrorHandler).toBe('function');
expect(typeof handlers.InfoHandler).toBe('function');
expect(typeof handlers.WarningInfoHandler).toBe('function');
});
it('ErrorHandler can be called without throwing', async () => {
const { ErrorHandler } = await import('@/utils/ErrorHandler');
expect(() => ErrorHandler('Test error')).not.toThrow();
});
});