* Deprecate 3.0 * 3.0 deprecation: remove 3.0 markup (#25647) * Remove liquid conditionals and content for 3.0 deprecation * Remove manually, no longer versioned in a supported version * Remove translations manually, no longer versioned in a supported version * Remove 'if', now in all supported versions * Remove dangling 'elseif', now in all supported versions * Remove dangling 'elseif' and 3.0 screenshot reference, now in all supported versions * Nudge to latest supported GHES version * Nudge to latest supported release GHES version * Bump all the version for the liquid tests * Bump first deprecated version for linting tests * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Prefer double quotes Co-authored-by: Laura Coursen <lecoursen@github.com> * Remove extra newline Co-authored-by: Laura Coursen <lecoursen@github.com> * Remove extra newline Co-authored-by: Laura Coursen <lecoursen@github.com> * Remove extra newline Co-authored-by: Laura Coursen <lecoursen@github.com> * One reusable per line Co-authored-by: Laura Coursen <lecoursen@github.com> * One reusable per line Co-authored-by: Laura Coursen <lecoursen@github.com> * One reusable per line Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Stray whitespace ✂️ Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Version check not needed anymore Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Just 'ghes' since we're deprecating 3.0 Co-authored-by: Laura Coursen <lecoursen@github.com> * Don't depend on hardcoded versions Co-authored-by: Laura Coursen <lecoursen@github.com> * Remove static files for 3.0 deprecation (#25649) Co-authored-by: Laura Coursen <lecoursen@github.com>
82 lines
2.7 KiB
JavaScript
82 lines
2.7 KiB
JavaScript
import { jest } from '@jest/globals'
|
|
import nock from 'nock'
|
|
|
|
import { get, getDOM } from '../helpers/supertest.js'
|
|
import enterpriseServerReleases from '../../lib/enterprise-server-releases.js'
|
|
|
|
jest.useFakeTimers('legacy')
|
|
|
|
describe('release notes', () => {
|
|
jest.setTimeout(60 * 1000)
|
|
|
|
beforeAll(async () => {
|
|
// The first page load takes a long time so let's get it out of the way in
|
|
// advance to call out that problem specifically rather than misleadingly
|
|
// attributing it to the first test
|
|
await get('/')
|
|
|
|
nock('https://github.github.com')
|
|
.get(
|
|
'/help-docs-archived-enterprise-versions/2.19/en/enterprise-server@2.19/admin/release-notes'
|
|
)
|
|
.reply(404)
|
|
nock('https://github.github.com')
|
|
.get('/help-docs-archived-enterprise-versions/2.19/redirects.json')
|
|
.reply(200, {
|
|
emp: 'ty',
|
|
})
|
|
})
|
|
|
|
afterAll(() => nock.cleanAll())
|
|
|
|
it('redirects to the release notes on enterprise.github.com if none are present for this version here', async () => {
|
|
const res = await get('/en/enterprise-server@2.19/admin/release-notes')
|
|
expect(res.statusCode).toBe(302)
|
|
expect(res.headers.location).toBe('https://enterprise.github.com/releases/2.19.0/notes')
|
|
})
|
|
|
|
it("renders the release-notes layout if this version's release notes are in this repo", async () => {
|
|
const oldestSupportedGhes = enterpriseServerReleases.oldestSupported
|
|
const res = await get(`/en/enterprise-server@${oldestSupportedGhes}/admin/release-notes`)
|
|
expect(res.statusCode).toBe(200)
|
|
const $ = await getDOM(`/en/enterprise-server@${oldestSupportedGhes}/admin/release-notes`)
|
|
expect($('h1').text()).toBe(`Enterprise Server ${oldestSupportedGhes} release notes`)
|
|
expect(
|
|
$('h2').first().text().trim().startsWith(`Enterprise Server ${oldestSupportedGhes}`)
|
|
).toBe(true)
|
|
})
|
|
|
|
it('renders the release-notes layout for GitHub AE', async () => {
|
|
const res = await get('/en/github-ae@latest/admin/release-notes')
|
|
expect(res.statusCode).toBe(200)
|
|
const $ = await getDOM('/en/github-ae@latest/admin/release-notes')
|
|
expect($('h1').text()).toBe('GitHub AE release notes')
|
|
|
|
const monthNames = [
|
|
'January',
|
|
'February',
|
|
'March',
|
|
'April',
|
|
'May',
|
|
'June',
|
|
'July',
|
|
'August',
|
|
'September',
|
|
'October',
|
|
'November',
|
|
'December',
|
|
]
|
|
const releaseNotesH2 = $('h2').first().text().trim()
|
|
const monthMatch = monthNames.some((month) => {
|
|
return releaseNotesH2.startsWith(month)
|
|
})
|
|
|
|
expect(monthMatch).toBe(true)
|
|
})
|
|
|
|
it('sends a 404 if a bogus version is requested', async () => {
|
|
const res = await get('/en/enterprise-server@12345/admin/release-notes')
|
|
expect(res.statusCode).toBe(404)
|
|
})
|
|
})
|