зеркало из https://github.com/github/docs.git
add tests
This commit is contained in:
Родитель
cd2a217a77
Коммит
5006cdaff2
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Page versioned for next GitHub AE release
|
||||
versions:
|
||||
github-ae: 'next'
|
||||
---
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Page versioned for next Enterprise release
|
||||
versions:
|
||||
enterprise-server: '>=3.1'
|
||||
---
|
|
@ -190,6 +190,36 @@ describe('Page class', () => {
|
|||
expect($.text()).not.toBe('This text should render on any actively supported version of Enterprise Server')
|
||||
expect($.text()).toBe('This text should only render on non-Enterprise')
|
||||
})
|
||||
|
||||
test('support next to-be-released Enterprise Server version in frontmatter', async () => {
|
||||
// This fixture has `enterprise-server: '>=3.1'` hardcoded in the frontmatter
|
||||
const page = await Page.init({
|
||||
relativePath: 'page-versioned-for-next-enterprise-release.md',
|
||||
basePath: path.join(__dirname, '../fixtures'),
|
||||
languageCode: 'en'
|
||||
})
|
||||
// set version to 3.0
|
||||
const context = {
|
||||
currentVersion: 'enterprise-server@3.0',
|
||||
currentLanguage: 'en'
|
||||
}
|
||||
await expect(() => { return page.render(context) }).not.toThrow()
|
||||
})
|
||||
|
||||
test('support next GitHub AE version in frontmatter', async () => {
|
||||
// This fixture has `github-ae: 'next'` hardcoded in the frontmatter
|
||||
const page = await Page.init({
|
||||
relativePath: 'page-versioned-for-ghae-next.md',
|
||||
basePath: path.join(__dirname, '../fixtures'),
|
||||
languageCode: 'en'
|
||||
})
|
||||
// set version to @latest
|
||||
const context = {
|
||||
currentVersion: 'github-ae@latest',
|
||||
currentLanguage: 'en'
|
||||
}
|
||||
await expect(() => { return page.render(context) }).not.toThrow()
|
||||
})
|
||||
})
|
||||
|
||||
test('preserves `languageCode`', async () => {
|
||||
|
|
Загрузка…
Ссылка в новой задаче