diff --git a/curriculum/utils.js b/curriculum/utils.js index f4532cd5d5b..c2eb12da97e 100644 --- a/curriculum/utils.js +++ b/curriculum/utils.js @@ -139,7 +139,7 @@ function getBlockOrder(blockName, superBlockStructure) { `The block "${blockName}" does not appear in the superblock structure.` ); - return index + 1; + return index; } exports.createSuperOrder = createSuperOrder; exports.getSuperOrder = getSuperOrder; diff --git a/curriculum/utils.test.ts b/curriculum/utils.test.ts index 6e44def8739..5d826d5d1ab 100644 --- a/curriculum/utils.test.ts +++ b/curriculum/utils.test.ts @@ -250,11 +250,11 @@ describe('getBlockOrder', () => { it('returns the correct order when the chapter only contains one module', () => { expect( getBlockOrder('welcome-to-freecodecamp', mockSuperBlockStructure) - ).toBe(1); + ).toBe(0); }); it('returns the correct order when the chapter contains multiple modules', () => { - expect(getBlockOrder('block-one-m2', mockSuperBlockStructure)).toBe(4); + expect(getBlockOrder('block-one-m2', mockSuperBlockStructure)).toBe(3); }); it('throws if a block does not exist', () => {