1
0
mirror of synced 2025-12-23 21:07:12 -05:00
This commit is contained in:
Sarah Schneider
2021-01-14 17:10:12 -05:00
parent affbc80a3c
commit 9809627129
11 changed files with 62 additions and 68 deletions

View File

@@ -118,7 +118,7 @@ describe('Page class', () => {
await page.render(context)
const $ = cheerio.load(page.intro)
expect($('a[href="/articles/about-pull-requests"]').length).toBe(0)
expect($(`a[href="/en/articles/about-pull-requests"]`).length).toBeGreaterThan(0)
expect($('a[href="/en/articles/about-pull-requests"]').length).toBeGreaterThan(0)
})
test('does not rewrite links that include deprecated enterprise release numbers', async () => {
@@ -235,7 +235,7 @@ describe('Page class', () => {
test('sets versioned values', async () => {
const page = await Page.init(opts)
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe(`/en/github/collaborating-with-issues-and-pull-requests/about-branches`)
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe('/en/github/collaborating-with-issues-and-pull-requests/about-branches')
expect(page.permalinks.find(permalink => permalink.pageVersion === `enterprise-server@${enterpriseServerReleases.oldestSupported}`).href).toBe(`/en/enterprise-server@${enterpriseServerReleases.oldestSupported}/github/collaborating-with-issues-and-pull-requests/about-branches`)
})
@@ -245,7 +245,7 @@ describe('Page class', () => {
basePath: path.join(__dirname, '../../content'),
languageCode: 'en'
})
expect(page.permalinks.find(permalink => permalink.pageVersion === 'homepage').href).toBe(`/en`)
expect(page.permalinks.find(permalink => permalink.pageVersion === 'homepage').href).toBe('/en')
expect(page.permalinks.find(permalink => permalink.pageVersion === `enterprise-server@${enterpriseServerReleases.oldestSupported}`).href).toBe(`/en/enterprise-server@${enterpriseServerReleases.oldestSupported}`)
})
@@ -255,7 +255,7 @@ describe('Page class', () => {
basePath: path.join(__dirname, '../../content'),
languageCode: 'en'
})
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe(`/en/github/getting-started-with-github/signing-up-for-a-new-github-account`)
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe('/en/github/getting-started-with-github/signing-up-for-a-new-github-account')
expect(page.permalinks.length).toBe(1)
})
@@ -277,7 +277,7 @@ describe('Page class', () => {
basePath: path.join(__dirname, '../fixtures'),
languageCode: 'en'
})
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe(`/en/products/actions/some-category/some-article`)
expect(page.permalinks.find(permalink => permalink.pageVersion === nonEnterpriseDefaultVersion).href).toBe('/en/products/actions/some-category/some-article')
expect(page.permalinks.length).toBe(1)
})