1
1
mirror of https://github.com/primer/css.git synced 2024-11-23 03:10:10 +03:00
css/__tests__/docs.test.js
dependabot[bot] f27faef3eb
Bump globby from 11.0.4 to 12.0.0 (#1515)
* Bump globby from 11.0.4 to 12.0.0

Bumps [globby](https://github.com/sindresorhus/globby) from 11.0.4 to 12.0.0.
- [Release notes](https://github.com/sindresorhus/globby/releases)
- [Commits](https://github.com/sindresorhus/globby/compare/v11.0.4...v12.0.0)

---
updated-dependencies:
- dependency-name: globby
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* Import globby

* Converting tests

* Ignore docs test

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
2021-08-11 17:11:35 -07:00

34 lines
810 B
JavaScript

import {getNavigationLinks, getContentFrontmatter} from './utils/docs'
let navLinks, contentFM
beforeAll(async () => {
contentFM = await getContentFrontmatter()
navLinks = getNavigationLinks()
})
describe('frontmatter', () => {
it('page title matches link title', () => {
for (const link of navLinks) {
const content = contentFM[link['url']]
expect(content).not.toBeNull()
expect(content['title']).toBe(link['title'])
}
})
it('contains path attribute', () => {
for (const v of Object.values(contentFM)) {
expect(v['path']).not.toBeNull()
}
})
})
describe('navigation', () => {
it('has a file for each nav item', () => {
for (const link of navLinks) {
const content = contentFM[link['url']]
expect(content).not.toBeNull()
}
})
})