forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
be loud about failed learning track processing (github#25370)
* be loud about failed learning track processing * rendering test * undo whitespace cleanup
- Loading branch information
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
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
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,28 @@ | ||
import { jest, beforeAll, expect } from '@jest/globals' | ||
|
||
import { getDOM } from '../helpers/supertest.js' | ||
import { loadPages } from '../../lib/page-data.js' | ||
|
||
describe('process learning tracks', () => { | ||
let pageList | ||
|
||
// Because calling `loadPages` will trigger a warmup, this can potentially | ||
// be very slow in CI. So we need a timeout. | ||
jest.setTimeout(60 * 1000) | ||
|
||
beforeAll(async () => { | ||
// Only doing English because they're the only files we do PRs for. | ||
pageList = (await loadPages()).filter((page) => page.languageCode === 'en') | ||
}) | ||
|
||
test('pages with learningTracks ', async () => { | ||
for (const page of pageList) { | ||
if (page.learningTracks && page.learningTracks.length > 0) { | ||
for (const permalink of page.permalinks) { | ||
const $ = await getDOM(permalink.href) | ||
expect($('[data-testid="learning-track"]').length).toBeGreaterThanOrEqual(1) | ||
} | ||
} | ||
} | ||
}) | ||
}) |