1
0
mirror of synced 2026-01-07 18:01:41 -05:00
Files
docs/tests/rendering-fixtures/footer.js
2023-05-05 00:22:59 +00:00

48 lines
1.8 KiB
JavaScript

import { jest } from '@jest/globals'
import { getDOM } from '../helpers/e2etest.js'
import nonEnterpriseDefaultVersion from '../../lib/non-enterprise-default-version.js'
describe('footer', () => {
jest.setTimeout(10 * 60 * 1000)
describe('"contact us" link', () => {
test('leads to support from articles', async () => {
const $ = await getDOM(
`/en/${nonEnterpriseDefaultVersion}/get-started/quickstart/hello-world`
)
expect($('a#support').attr('href')).toBe('https://support.github.com')
})
test('leads to support on 404 pages', async () => {
const $ = await getDOM('/delicious-snacks/donuts.php', { allow404: true })
expect($('a#support').attr('href')).toBe('https://support.github.com')
})
})
describe('"support" link with nextjs', () => {
test('leads to support from articles', async () => {
const $ = await getDOM(`/en/${nonEnterpriseDefaultVersion}/get-started?nextjs=`)
expect($('a#support').attr('href')).toBe('https://support.github.com')
})
})
describe('test redirects for product landing community links pages', () => {
test('codespaces product landing page leads to discussions page', async () => {
const $ = await getDOM('/en/get-started')
expect($('a#ask-community').attr('href')).toBe(
'https://hubgit.com/orgs/community/discussions/categories/get-started'
)
})
})
describe('test redirects for non-product landing community links pages', () => {
test('leads to https://github.community/ when clicking on the community link', async () => {
const $ = await getDOM(`/en/get-started/quickstart/hello-world`)
expect($('a#ask-community').attr('href')).toBe(
'https://github.com/orgs/community/discussions'
)
})
})
})