chore: establish learning module baseline
This commit is contained in:
commit
2d04197f3f
2409 files changed
+533050
No files matched your search
@@ -0,0 +1,47 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
|
||||
import { applyOutlineFallbacks } from '@openmaic/generation';
|
||||
import type { SceneOutline } from '@openmaic/generation';
|
||||
|
||||
describe('procedural-skill content gates', () => {
|
||||
test('applyOutlineFallbacks strips procedural-skill when vocational mode is not active', () => {
|
||||
const outline = createProceduralSkillOutline();
|
||||
const safeOutline = applyOutlineFallbacks(outline, true);
|
||||
|
||||
expect(safeOutline.widgetType).toBe('diagram');
|
||||
expect(safeOutline.widgetOutline?.procedureType).toBeUndefined();
|
||||
expect(safeOutline.widgetOutline?.task).toBeUndefined();
|
||||
expect(safeOutline.widgetOutline?.errorConsequences).toBeUndefined();
|
||||
});
|
||||
|
||||
test('applyOutlineFallbacks retains procedural-skill only when explicitly allowed', () => {
|
||||
const outline = createProceduralSkillOutline();
|
||||
const safeOutline = applyOutlineFallbacks(outline, true, { allowProceduralSkill: true });
|
||||
|
||||
expect(safeOutline.widgetType).toBe('procedural-skill');
|
||||
expect(safeOutline.widgetOutline?.errorConsequences).toEqual([
|
||||
'Unsafe readings require stopping and rechecking',
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
function createProceduralSkillOutline(): SceneOutline {
|
||||
return {
|
||||
id: 'scene-procedural-skill',
|
||||
type: 'interactive',
|
||||
title: 'Device Calibration Practice',
|
||||
description: 'Practice a generic calibration procedure with step feedback.',
|
||||
keyPoints: ['Follow steps in order', 'Check each success criterion'],
|
||||
order: 1,
|
||||
widgetType: 'procedural-skill',
|
||||
widgetOutline: {
|
||||
concept: 'calibration procedure',
|
||||
procedureType: 'operation',
|
||||
task: 'Calibrate a training device',
|
||||
tools: ['multimeter', 'checklist'],
|
||||
steps: ['Inspect the device', 'Connect the tool', 'Confirm the reading'],
|
||||
successCriteria: ['No visible damage', 'Reading is within range'],
|
||||
errorConsequences: ['Unsafe readings require stopping and rechecking'],
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user