34 lines
864 B
TypeScript
34 lines
864 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import {
|
|
DEFAULT_MODULE_ACCESS,
|
|
MODULE_ACCESS_KEYS,
|
|
normalizeModuleAccess,
|
|
} from '../../shared/module-access';
|
|
|
|
describe('module access projection', () => {
|
|
it('contains only the three supported product modules', () => {
|
|
expect(MODULE_ACCESS_KEYS).toEqual(['programming', 'design', 'robot']);
|
|
expect(DEFAULT_MODULE_ACCESS).toEqual({
|
|
programming: true,
|
|
design: true,
|
|
robot: true,
|
|
});
|
|
});
|
|
|
|
it('drops the retired Learning key from legacy or upstream policy data', () => {
|
|
const access = normalizeModuleAccess({
|
|
programming: false,
|
|
design: true,
|
|
learning: false,
|
|
robot: false,
|
|
});
|
|
|
|
expect(access).toEqual({
|
|
programming: false,
|
|
design: true,
|
|
robot: false,
|
|
});
|
|
expect(access).not.toHaveProperty('learning');
|
|
});
|
|
});
|