1
0
mirror of synced 2025-12-23 21:07:12 -05:00

Header notification updates (#16425)

* remove middleware that sets notification flags

* move all notification handling into includes/header-notification.html

* update tests
This commit is contained in:
Sarah Schneider
2020-11-12 16:27:29 -05:00
committed by GitHub
parent 8788ab7fc4
commit 5705d334ca
5 changed files with 34 additions and 67 deletions

View File

@@ -42,15 +42,13 @@ describe('header', () => {
describe('notices', () => {
test('displays a "localization in progress" notice for WIP languages', async () => {
const $ = await getDOM('/de')
expect($('.header-notifications.localization_in_progress').length).toBe(1)
expect($('.localization_complete').length).toBe(0)
expect($('.header-notifications.translation_notice').length).toBe(1)
expect($('.header-notifications a[href="/en"]').length).toBe(1)
})
test('displays "complete" notice for non-WIP non-English languages', async () => {
const $ = await getDOM('/ja')
expect($('.header-notifications.localization_complete').length).toBe(1)
expect($('.localization_in_progress').length).toBe(0)
expect($('.header-notifications.translation_notice').length).toBe(1)
expect($('.header-notifications a[href="/en"]').length).toBe(1)
expect($('.header-notifications a[href*="github.com/contact"]').length).toBe(1)
})
@@ -62,7 +60,7 @@ describe('header', () => {
test('displays translation disclaimer notice on localized site-policy pages', async () => {
const $ = await getDOM('/ja/github/site-policy/github-logo-policy')
expect($('.header-notifications.translation_policy a[href="https://github.com/github/site-policy/issues"]').length).toBe(1)
expect($('.header-notifications.translation_notice a[href="https://github.com/github/site-policy/issues"]').length).toBe(1)
})
})