1
0
mirror of synced 2025-12-25 02:17:36 -05:00

simplify learning tracks rendering testing (#34188)

This commit is contained in:
Peter Bengtsson
2023-01-25 17:54:59 -05:00
committed by GitHub
parent 96442f076c
commit 6b7a53edbf
2 changed files with 1 additions and 24 deletions

View File

@@ -1,6 +1,6 @@
import { expect, jest } from '@jest/globals'
import { getDOM } from '../helpers/e2etest.js'
import { getDOMCached as getDOM } from '../helpers/e2etest.js'
jest.setTimeout(3 * 60 * 1000)

View File

@@ -1,23 +0,0 @@
import { jest, expect } from '@jest/globals'
import { getDOM } from '../helpers/e2etest.js'
import { loadPages } from '../../lib/page-data.js'
describe('process learning tracks', () => {
// Because calling `loadPages` will trigger a warmup, this can potentially
// be very slow in CI. So we need a timeout.
jest.setTimeout(60 * 1000)
test('pages with learningTracks ', async () => {
const pageList = await loadPages(undefined, ['en'])
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)
}
}
}
})
})