17 lines
605 B
TypeScript
17 lines
605 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { API_ERROR_CODES, PERMISSION_CODES, ROLE_CODES } from './index.js';
|
|
|
|
describe('authentication contracts', () => {
|
|
it('keeps approved role and permission codes centralized', () => {
|
|
expect(ROLE_CODES).toContain('VOLUNTEER');
|
|
expect(ROLE_CODES).toContain('SUPER_ADMIN');
|
|
expect(PERMISSION_CODES.ADMIN_ACCESS).toBe('admin:access');
|
|
});
|
|
|
|
it('uses stable public error codes', () => {
|
|
expect(API_ERROR_CODES.AUTH_REQUIRED).toBe('AUTH_REQUIRED');
|
|
expect(API_ERROR_CODES.INVALID_CREDENTIALS).toBe('INVALID_CREDENTIALS');
|
|
});
|
|
});
|