Skip to content

Commit

Permalink
Merge pull request #731 from colonial-heritage/fix-unit-tests
Browse files Browse the repository at this point in the history
Fix unit tests
  • Loading branch information
barbarah authored Dec 13, 2024
2 parents d6fd092 + bfaccb0 commit 5fd6cd4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('filterLevel3Guides', () => {
},
],
},
{id: 'level1-2'},
{id: 'level1-2', seeAlso: [{id: 'level2-2'}]},
],
};

Expand All @@ -31,7 +31,7 @@ describe('filterLevel3Guides', () => {
},
],
},
{id: 'level1-2'},
{id: 'level1-2', seeAlso: [{id: 'level2-2', seeAlso: []}]},
],
};

Expand All @@ -48,7 +48,7 @@ describe('filterLevel3Guides', () => {
seeAlso: [
{
id: 'level2-1',
seeAlso: [{id: 'level1-2'}, {id: 'level2-2'}],
seeAlso: [{id: 'level1-2'}],
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ export function sortResearchGuide(topLevel: ResearchGuide): ResearchGuide {
const sortedSeeAlso =
guide.seeAlso?.sort((a, b) =>
(a.name || '').localeCompare(b.name || '')
) || [];
) || undefined;

return {
...guide,
seeAlso: sortedSeeAlso.map(sortGuides),
seeAlso: sortedSeeAlso?.map(sortGuides),
};
};

Expand Down

0 comments on commit 5fd6cd4

Please sign in to comment.