mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(mobile): remove a2 spanish superblock (#60440)
Co-authored-by: Huyen Nguyen <25715018+huyenltnguyen@users.noreply.github.com>
This commit is contained in:
@@ -3,7 +3,11 @@ import fs, { readFileSync } from 'fs';
|
|||||||
|
|
||||||
import readdirp from 'readdirp';
|
import readdirp from 'readdirp';
|
||||||
|
|
||||||
import { SuperBlocks } from '../../../shared/config/curriculum';
|
import {
|
||||||
|
SuperBlocks,
|
||||||
|
SuperBlockStage,
|
||||||
|
superBlockStages
|
||||||
|
} from '../../../shared/config/curriculum';
|
||||||
import {
|
import {
|
||||||
superblockSchemaValidator,
|
superblockSchemaValidator,
|
||||||
availableSuperBlocksValidator
|
availableSuperBlocksValidator
|
||||||
@@ -133,7 +137,14 @@ ${result.error.message}`);
|
|||||||
({ dashedName }) => dashedName
|
({ 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(dashedNames).toEqual(expect.arrayContaining(publicSuperBlockNames));
|
||||||
expect(Object.keys(orderedSuperBlockInfo)).toHaveLength(
|
expect(Object.keys(orderedSuperBlockInfo)).toHaveLength(
|
||||||
|
|||||||
@@ -44,7 +44,6 @@ export const orderedSuperBlockInfo = [
|
|||||||
{ dashedName: SuperBlocks.CollegeAlgebraPy, public: true },
|
{ dashedName: SuperBlocks.CollegeAlgebraPy, public: true },
|
||||||
{ dashedName: SuperBlocks.A2English, public: true },
|
{ dashedName: SuperBlocks.A2English, public: true },
|
||||||
{ dashedName: SuperBlocks.B1English, public: true },
|
{ dashedName: SuperBlocks.B1English, public: true },
|
||||||
{ dashedName: SuperBlocks.A2Spanish, public: true },
|
|
||||||
{ dashedName: SuperBlocks.TheOdinProject, public: true },
|
{ dashedName: SuperBlocks.TheOdinProject, public: true },
|
||||||
{ dashedName: SuperBlocks.RespWebDesign, public: true },
|
{ dashedName: SuperBlocks.RespWebDesign, public: true },
|
||||||
{ dashedName: SuperBlocks.PythonForEverybody, public: true },
|
{ dashedName: SuperBlocks.PythonForEverybody, public: true },
|
||||||
|
|||||||
@@ -5,7 +5,9 @@ import readdirp from 'readdirp';
|
|||||||
|
|
||||||
import {
|
import {
|
||||||
chapterBasedSuperBlocks,
|
chapterBasedSuperBlocks,
|
||||||
SuperBlocks
|
SuperBlocks,
|
||||||
|
SuperBlockStage,
|
||||||
|
superBlockStages
|
||||||
} from '../../../shared/config/curriculum';
|
} from '../../../shared/config/curriculum';
|
||||||
import {
|
import {
|
||||||
superblockSchemaValidator,
|
superblockSchemaValidator,
|
||||||
@@ -201,24 +203,25 @@ ${result.error.message}`);
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('All public SuperBlocks should be present in the SuperBlock object', () => {
|
test('All public SuperBlocks should be present in the SuperBlock object', () => {
|
||||||
const publicSuperBlockNames = Object.values(SuperBlocks);
|
const stages = Object.keys(orderedSuperBlockInfo).map(
|
||||||
|
key => Number(key) as SuperBlockStage
|
||||||
const superBlockDashedNames = Object.keys(orderedSuperBlockInfo).reduce(
|
|
||||||
(acc, superBlockStage) => {
|
|
||||||
const dashedNames = orderedSuperBlockInfo[superBlockStage].map(
|
|
||||||
superBlock => superBlock.dashedName
|
|
||||||
);
|
|
||||||
acc.push(...dashedNames);
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
[] as SuperBlocks[]
|
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(superBlockDashedNames).toEqual(
|
expect(stages).not.toContain(SuperBlockStage.Next);
|
||||||
expect.arrayContaining(publicSuperBlockNames)
|
expect(stages).not.toContain(SuperBlockStage.Upcoming);
|
||||||
);
|
|
||||||
expect(superBlockDashedNames).toHaveLength(publicSuperBlockNames.length);
|
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', () => {
|
test('challenge files should be created and in the correct directory', () => {
|
||||||
|
|||||||
@@ -103,11 +103,6 @@ export const orderedSuperBlockInfo: Record<
|
|||||||
dashedName: SuperBlocks.B1English,
|
dashedName: SuperBlocks.B1English,
|
||||||
public: true,
|
public: true,
|
||||||
title: intros[SuperBlocks.B1English].title
|
title: intros[SuperBlocks.B1English].title
|
||||||
},
|
|
||||||
{
|
|
||||||
dashedName: SuperBlocks.A2Spanish,
|
|
||||||
public: true,
|
|
||||||
title: intros[SuperBlocks.A2Spanish].title
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user