22 lines
1.2 KiB
JavaScript
22 lines
1.2 KiB
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
import { classifyUnit, roleForPdf, isGradeThreeSource } from '../src/catalog.mjs';
|
|
|
|
test('keeps a Grade 3 unit from the verified source list', () => {
|
|
assert.equal(isGradeThreeSource({ title: 'Grade 3 CK Math: Unit 1', filename: 'CKMath_G3U1.zip' }), true);
|
|
assert.equal(isGradeThreeSource({ title: 'Grade 2 CK Math: Unit 1', filename: 'CKMath_G2U1.zip' }), false);
|
|
});
|
|
|
|
test('classifies major Grade 3 curriculum families', () => {
|
|
assert.equal(classifyUnit('CKMath_G3U1_IntroducingMultiplication.zip'), 'Math');
|
|
assert.equal(classifyUnit('CKSci_G3_U1_InvestigatingForces.zip'), 'Science');
|
|
assert.equal(classifyUnit('CKLA_G3_Unit-1.zip'), 'Language Arts');
|
|
assert.equal(classifyUnit('CKHG_G3_U1_WorldRivers.zip'), 'History & Geography');
|
|
});
|
|
|
|
test('labels teacher guides and student resources without exposing arbitrary paths', () => {
|
|
assert.equal(roleForPdf('CKMath_G3U1_IntroducingMultiplication_TG_W2.pdf'), 'Teacher Guide');
|
|
assert.equal(roleForPdf('CKMath_G3U1_IntroducingMultiplication_SR_W2.pdf'), 'Student Reader');
|
|
assert.equal(roleForPdf('CoreKnowledge_CurriculumSeries_CCL_TermsOfUse_2024_W1.pdf'), 'Reference');
|
|
});
|