-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: more test cases for getTutorial
- Loading branch information
1 parent
f682622
commit cba3be5
Showing
3 changed files
with
499 additions
and
8 deletions.
There are no files selected for viewing
189 changes: 189 additions & 0 deletions
189
packages/astro/src/default/utils/__snapshots__/multiple-parts.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
{ | ||
"parts": { | ||
"1-part": { | ||
"id": "1-part", | ||
"order": 0, | ||
"data": { | ||
"type": "part", | ||
"title": "Basics" | ||
}, | ||
"slug": "part-slug", | ||
"chapters": { | ||
"1-chapter": { | ||
"id": "1-chapter", | ||
"order": 0, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-first": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-first", | ||
"filepath": "1-part/1-chapter/1-first/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "1-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "1-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"1-part-1-chapter-1-first-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"1-part-1-chapter-1-first-solution.json", | ||
[] | ||
], | ||
"next": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-first" | ||
} | ||
}, | ||
"firstChapterId": "1-chapter" | ||
}, | ||
"2-part": { | ||
"id": "2-part", | ||
"order": 1, | ||
"data": { | ||
"type": "part", | ||
"title": "Basics" | ||
}, | ||
"slug": "part-slug", | ||
"chapters": { | ||
"2-chapter": { | ||
"id": "2-chapter", | ||
"order": 0, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-second": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-second", | ||
"filepath": "2-part/2-chapter/1-second/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "2-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "2-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"2-part-2-chapter-1-second-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"2-part-2-chapter-1-second-solution.json", | ||
[] | ||
], | ||
"prev": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
}, | ||
"next": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-second" | ||
} | ||
}, | ||
"firstChapterId": "2-chapter" | ||
}, | ||
"3-part": { | ||
"id": "3-part", | ||
"order": 2, | ||
"data": { | ||
"type": "part", | ||
"title": "Basics" | ||
}, | ||
"slug": "part-slug", | ||
"chapters": { | ||
"3-chapter": { | ||
"id": "3-chapter", | ||
"order": 0, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-third": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-third", | ||
"filepath": "3-part/3-chapter/1-third/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "3-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "3-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"3-part-3-chapter-1-third-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"3-part-3-chapter-1-third-solution.json", | ||
[] | ||
], | ||
"prev": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-third" | ||
} | ||
}, | ||
"firstChapterId": "3-chapter" | ||
} | ||
}, | ||
"firstPartId": "1-part" | ||
} |
165 changes: 165 additions & 0 deletions
165
packages/astro/src/default/utils/__snapshots__/single-part-multiple-chapters.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
{ | ||
"parts": { | ||
"1-part": { | ||
"id": "1-part", | ||
"order": 0, | ||
"data": { | ||
"type": "part", | ||
"title": "Basics" | ||
}, | ||
"slug": "part-slug", | ||
"chapters": { | ||
"1-chapter": { | ||
"id": "1-chapter", | ||
"order": 0, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-first": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-first", | ||
"filepath": "1-part/1-chapter/1-first/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "1-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "1-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"1-part-1-chapter-1-first-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"1-part-1-chapter-1-first-solution.json", | ||
[] | ||
], | ||
"next": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-first" | ||
}, | ||
"2-chapter": { | ||
"id": "2-chapter", | ||
"order": 1, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-second": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-second", | ||
"filepath": "1-part/2-chapter/1-second/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "1-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "2-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"1-part-2-chapter-1-second-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"1-part-2-chapter-1-second-solution.json", | ||
[] | ||
], | ||
"prev": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
}, | ||
"next": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-second" | ||
}, | ||
"3-chapter": { | ||
"id": "3-chapter", | ||
"order": 2, | ||
"data": { | ||
"title": "The first chapter in part 1", | ||
"type": "chapter" | ||
}, | ||
"slug": "chapter-slug", | ||
"lessons": { | ||
"1-third": { | ||
"data": { | ||
"type": "lesson", | ||
"title": "Welcome to TutorialKit", | ||
"template": "default", | ||
"i18n": { | ||
"mocked": "default localization" | ||
}, | ||
"openInStackBlitz": true | ||
}, | ||
"id": "1-third", | ||
"filepath": "1-part/3-chapter/1-third/content.md", | ||
"order": 0, | ||
"part": { | ||
"id": "1-part", | ||
"title": "Basics" | ||
}, | ||
"chapter": { | ||
"id": "3-chapter", | ||
"title": "The first chapter in part 1" | ||
}, | ||
"Markdown": "Markdown for tutorial", | ||
"slug": "lesson-slug", | ||
"files": [ | ||
"1-part-3-chapter-1-third-files.json", | ||
[] | ||
], | ||
"solution": [ | ||
"1-part-3-chapter-1-third-solution.json", | ||
[] | ||
], | ||
"prev": { | ||
"title": "Welcome to TutorialKit", | ||
"href": "/part-slug/chapter-slug/lesson-slug" | ||
} | ||
} | ||
}, | ||
"firstLessonId": "1-third" | ||
} | ||
}, | ||
"firstChapterId": "1-chapter" | ||
} | ||
}, | ||
"firstPartId": "1-part" | ||
} |
Oops, something went wrong.