This repository was archived by the owner on Sep 9, 2022. It is now read-only.
forked from github/docs
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfooter.js
More file actions
57 lines (48 loc) · 2.29 KB
/
Copy pathfooter.js
File metadata and controls
57 lines (48 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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}/issues`)
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})
test('leads to support on 404 pages', async () => {
const $ = await getDOM('/delicious-snacks/donuts.php', { allow404: true })
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})
})
describe('"contact us" link with nextjs', () => {
test('leads to support from articles', async () => {
const $ = await getDOM(`/en/${nonEnterpriseDefaultVersion}/issues?nextjs=`)
expect($('a#contact-us').attr('href')).toBe('https://support.github.com/contact')
})
})
describe('test redirects for product landing community links pages', () => {
test('codespaces product landing page leads to codespaces discussions page', async () => {
const $ = await getDOM(`/en/codespaces`)
expect($('a#ask-community').attr('href')).toBe(
'https://github.com/community/community/discussions/categories/codespaces'
)
})
test('sponsors product landing page leads to sponsors discussions page', async () => {
const $ = await getDOM(`/en/sponsors`)
expect($('a#ask-community').attr('href')).toBe(
'https://github.com/community/community/discussions/categories/sponsors'
)
})
test('codespaces product landing page leads to discussions discussions page', async () => {
const $ = await getDOM(`/en/discussions`)
expect($('a#ask-community').attr('href')).toBe(
'https://github.com/community/community/discussions/categories/discussions'
)
})
})
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/github/authenticating-to-github`)
expect($('a#ask-community').attr('href')).toBe('https://github.community/')
})
})
})