2021-03-31 02:53:47 +03:00
|
|
|
const {getNavigationLinks, getContentFrontmatter} = require('./utils/docs')
|
2021-03-30 20:01:19 +03:00
|
|
|
|
2021-03-31 02:53:47 +03:00
|
|
|
let navLinks, contentFM
|
2021-03-30 20:01:19 +03:00
|
|
|
|
2021-03-31 02:53:47 +03:00
|
|
|
beforeAll(async () => {
|
|
|
|
contentFM = await getContentFrontmatter()
|
|
|
|
navLinks = getNavigationLinks()
|
2021-03-30 20:01:19 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
describe('frontmatter', () => {
|
2021-03-31 02:53:47 +03:00
|
|
|
it('page title matches link title', () => {
|
|
|
|
navLinks.forEach(link => {
|
|
|
|
const content = contentFM[link['url']]
|
|
|
|
expect(content).not.toBeNull()
|
|
|
|
expect(content['title']).toBe(link['title'])
|
|
|
|
})
|
|
|
|
})
|
2021-03-30 20:01:19 +03:00
|
|
|
|
2021-03-31 02:53:47 +03:00
|
|
|
it('contains path attribute', () => {
|
|
|
|
Object.values(contentFM).forEach( v => {
|
|
|
|
expect(v['path']).not.toBeNull()
|
|
|
|
})
|
|
|
|
})
|
2021-03-30 20:01:19 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
describe('navigation', () => {
|
|
|
|
it('has a file for each nav item', () => {
|
2021-03-31 02:53:47 +03:00
|
|
|
navLinks.forEach(link => {
|
|
|
|
const content = contentFM[link['url']]
|
|
|
|
expect(content).not.toBeNull()
|
|
|
|
})
|
2021-03-30 20:01:19 +03:00
|
|
|
})
|
|
|
|
})
|