fix(mobile): remove a2 spanish superblock (#60440)

Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
Tom
2025-05-19 16:22:12 -05:00
committed by GitHub
parent 1f71111fea
commit 8c1610a1ed
4 changed files with 33 additions and 25 deletions
@@ -3,7 +3,11 @@ import fs, { readFileSync } from 'fs';
import readdirp from 'readdirp';
import { SuperBlocks } from '../../../shared/config/curriculum';
import {
SuperBlocks,
SuperBlockStage,
superBlockStages
} from '../../../shared/config/curriculum';
import {
superblockSchemaValidator,
availableSuperBlocksValidator
@@ -133,7 +137,14 @@ ${result.error.message}`);
({ dashedName }) => dashedName
);
const publicSuperBlockNames = Object.values(SuperBlocks);
const publicSuperBlockNames = Object.entries(superBlockStages)
.filter(([key]) => {
const stage = Number(key) as SuperBlockStage;
return (
stage !== SuperBlockStage.Next && stage !== SuperBlockStage.Upcoming
);
})
.flatMap(([, superBlocks]) => superBlocks);
expect(dashedNames).toEqual(expect.arrayContaining(publicSuperBlockNames));
expect(Object.keys(orderedSuperBlockInfo)).toHaveLength(
@@ -44,7 +44,6 @@ export const orderedSuperBlockInfo = [
{ dashedName: SuperBlocks.CollegeAlgebraPy, public: true },
{ dashedName: SuperBlocks.A2English, public: true },
{ dashedName: SuperBlocks.B1English, public: true },
{ dashedName: SuperBlocks.A2Spanish, public: true },
{ dashedName: SuperBlocks.TheOdinProject, public: true },
{ dashedName: SuperBlocks.RespWebDesign, public: true },
{ dashedName: SuperBlocks.PythonForEverybody, public: true },
@@ -5,7 +5,9 @@ import readdirp from 'readdirp';
import {
chapterBasedSuperBlocks,
SuperBlocks
SuperBlocks,
SuperBlockStage,
superBlockStages
} from '../../../shared/config/curriculum';
import {
superblockSchemaValidator,
@@ -201,24 +203,25 @@ ${result.error.message}`);
});
test('All public SuperBlocks should be present in the SuperBlock object', () => {
const publicSuperBlockNames = Object.values(SuperBlocks);
const superBlockDashedNames = Object.keys(orderedSuperBlockInfo).reduce(
(acc, superBlockStage) => {
const dashedNames = orderedSuperBlockInfo[superBlockStage].map(
superBlock => superBlock.dashedName
);
acc.push(...dashedNames);
return acc;
},
[] as SuperBlocks[]
const stages = Object.keys(orderedSuperBlockInfo).map(
key => Number(key) as SuperBlockStage
);
expect(superBlockDashedNames).toEqual(
expect.arrayContaining(publicSuperBlockNames)
);
expect(superBlockDashedNames).toHaveLength(publicSuperBlockNames.length);
expect(stages).not.toContain(SuperBlockStage.Next);
expect(stages).not.toContain(SuperBlockStage.Upcoming);
for (const stage of stages) {
const superBlockDashedNames = orderedSuperBlockInfo[stage].map(
superBlock => superBlock.dashedName
);
expect(superBlockDashedNames).toEqual(
expect.arrayContaining(superBlockStages[stage])
);
expect(superBlockDashedNames).toHaveLength(
superBlockStages[stage].length
);
}
});
test('challenge files should be created and in the correct directory', () => {
@@ -103,11 +103,6 @@ export const orderedSuperBlockInfo: Record<
dashedName: SuperBlocks.B1English,
public: true,
title: intros[SuperBlocks.B1English].title
},
{
dashedName: SuperBlocks.A2Spanish,
public: true,
title: intros[SuperBlocks.A2Spanish].title
}
],