docs/tests/routing/release-notes.js

40 строки
1.7 KiB
JavaScript
Исходник Обычный вид История

const { get, getDOM } = require('../helpers/supertest')
Render Enterprise release notes on docs.github.com (#16367) * Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2020-11-20 21:33:11 +03:00
2021-03-02 01:04:27 +03:00
describe('release notes', () => {
Render Enterprise release notes on docs.github.com (#16367) * Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2020-11-20 21:33:11 +03:00
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('/')
})
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')
Render Enterprise release notes on docs.github.com (#16367) * Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2020-11-20 21:33:11 +03:00
expect(res.statusCode).toBe(302)
expect(res.headers.location).toBe('https://enterprise.github.com/releases/2.19.0/notes')
Render Enterprise release notes on docs.github.com (#16367) * Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2020-11-20 21:33:11 +03:00
})
it('renders the release-notes layout if this version\'s release notes are in this repo', async () => {
2021-06-17 23:06:43 +03:00
const res = await get('/en/enterprise-server@2.22/admin/release-notes')
expect(res.statusCode).toBe(200)
const $ = await getDOM('/en/enterprise-server@2.22/admin/release-notes')
expect($('h1').text()).toBe('Enterprise Server 2.22 release notes')
expect($('h2').first().text().trim().startsWith('Enterprise Server 2.22.')).toBe(true)
})
2021-03-02 03:18:39 +03:00
it('renders the release-notes layout for GitHub AE', async () => {
2021-06-17 23:06:43 +03:00
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')
expect($('h2').first().text().trim().startsWith('Week of')).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)
2021-03-02 03:18:39 +03:00
})
Render Enterprise release notes on docs.github.com (#16367) * Create basic layout * Create stubbed out release note YAML * Get a real implementation going * Simplify using site-data * Add a real page to send from render-page.js * Use array of patches * Render patches * Add sidebar and breadcrumbs * Reverse order * Add date * Tweak labels * Redirect to entweb for missing versions * Render patch.intro * Move to separate files for patches * Show support for RC versions * Improve some comments * Sticky headers! * Remove a console log * Improve example formatting * Add a link on /admin * Add a schema and test * Move to /index.md, add version_num filter * Improve layout * Use <details> * Placeholder more realistic notes * Don't require links in index pages * Remove admin/index link for now * Remove unused frontmatter field * Add a test for middleware * Fix remaining YAML file to test CI * Update 2-rc.yml * Don't call it RC * Just push * Make a main a div * Fix a borked class * Lint YAML files * Improve Download link Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Improve check order * Move to contextualizers * Use alternative version thing Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Move back to `release-notes.md` * Use version for anchor IDs * Undo category-pages test change * Fix borked details layout in Chrome * Improve mobile setup * Render markdown in note tags * Use allVersions[currentVersion] again Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com> * Undo change to extended-markdown * Add whitespace so it renders markdown bits * Remove 2-22 files * Add check for any release notes * Fix the failing tests Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com> Co-authored-by: Sarah Schneider <sarahs@users.noreply.github.com>
2020-11-20 21:33:11 +03:00
})