569d887d1e
Renaming the package so any further PRs directed to the website are targeted to the reworked code instead of diverging. Once merged, I will start preparing this for deployment to dev to test before releasing to prod. Any improvements will also be applied to this package. I avoided making significant changes to API routes so nothing breaks, but will test it thoroughly today to confirm. That said, everything is ported - double checked. Big diff PR, impossible to review, but last one! No more rebuilds.
26 lines
886 B
TypeScript
26 lines
886 B
TypeScript
import { CASE_STUDY_CATALOG } from './case-study-catalog';
|
|
import { CASE_STUDY_STORIES } from './case-study-stories';
|
|
|
|
describe('CASE_STUDY_STORIES', () => {
|
|
const catalogSlugs = CASE_STUDY_CATALOG.map((entry) => entry.slug);
|
|
const storySlugs = Object.keys(CASE_STUDY_STORIES);
|
|
|
|
it('has a story for every catalog entry and vice versa', () => {
|
|
expect(storySlugs.toSorted()).toEqual(catalogSlugs.toSorted());
|
|
});
|
|
|
|
it('gives each section one table-of-contents label', () => {
|
|
for (const story of Object.values(CASE_STUDY_STORIES)) {
|
|
expect(story.tableOfContents).toHaveLength(story.sections.length);
|
|
}
|
|
});
|
|
|
|
it('gives each section at least one paragraph', () => {
|
|
for (const story of Object.values(CASE_STUDY_STORIES)) {
|
|
for (const section of story.sections) {
|
|
expect(section.paragraphs.length).toBeGreaterThan(0);
|
|
}
|
|
}
|
|
});
|
|
});
|