Skip to content

Commit bcb11fe

Browse files
authored
Merge pull request #46325 from github/repo-sync
Repo sync
2 parents b020771 + 8fdd340 commit bcb11fe

21 files changed

Lines changed: 2214 additions & 814 deletions

‎data/ui.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ search:
5454
beta_tag: Beta
5555
return_to_search: Return to search
5656
clear_search_query: Clear
57+
close_search: Close search
5758
view_all_search_results: View more results
59+
view_all_search_results_with_count: View all {{n}} results
5860
no_results_found: No results found
5961
no_results_found_announcement: 'Search Docs: No results found'
62+
loading_results_announcement: Loading search results
6063
search_docs_with_query: Search docs for "{{query}}"
6164
privacy_disclaimer: For product and service improvement purposes, GitHub will retain questions and answers generated in the Docs search function. Please see the <a href="https://docs.github.com/privacy"><u>GitHub Privacy Statement</u></a> to review how GitHub collects and uses your data.
6265
ai:

‎src/fixtures/fixtures/data/ui.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ search:
5454
beta_tag: Beta
5555
return_to_search: Return to search
5656
clear_search_query: Clear
57+
close_search: Close search
5758
view_all_search_results: View more results
59+
view_all_search_results_with_count: View all {{n}} results
5860
no_results_found: No results found
5961
no_results_found_announcement: 'Search Docs: No results found'
62+
loading_results_announcement: Loading search results
6063
search_docs_with_query: Search docs for "{{query}}"
6164
privacy_disclaimer: For product and service improvement purposes, GitHub will retain questions and answers generated in the Docs search function. Please see the <a href="https://docs.github.com/privacy"><u>GitHub Privacy Statement</u></a> to review how GitHub collects and uses your data.
6265
ai:

‎src/fixtures/tests/playwright-a11y.spec.ts‎

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,48 @@ test.describe('search filters (narrow viewport)', () => {
7979
expect(accessibilityScanResults.violations).toEqual([])
8080
})
8181
})
82+
83+
// The search overlay has never been axe-scanned: the `search` entry above covers the
84+
// results page, and nothing opened the dialog. It is now a hand-rolled listbox with
85+
// virtual focus, so its ARIA is worth asserting rather than assuming.
86+
test.describe('search overlay', () => {
87+
test.skip(!SEARCH_TESTS, 'No local Elasticsearch, no tests involving search')
88+
89+
test('open suggestions listbox passes axe', async ({ page }) => {
90+
await page.goto('/')
91+
await turnOffExperimentsInPage(page)
92+
93+
await page.getByTestId('toggle-search').click()
94+
await page.getByTestId('overlay-search-input').fill('serve playwright')
95+
await expect(page.getByTestId('view-all-results')).toBeVisible()
96+
97+
// Scoped to the dialog: the page behind the scrim has its own entry, and scanning
98+
// both would attribute unrelated violations to this component.
99+
const accessibilityScanResults = await new AxeBuilder({ page })
100+
.include('[role="dialog"]')
101+
.analyze()
102+
103+
expect(accessibilityScanResults.violations).toEqual([])
104+
})
105+
106+
test('listbox with an option selected passes axe', async ({ page }) => {
107+
await page.goto('/')
108+
await turnOffExperimentsInPage(page)
109+
110+
await page.getByTestId('toggle-search').click()
111+
const input = page.getByTestId('overlay-search-input')
112+
await input.fill('serve playwright')
113+
await expect(page.getByTestId('view-all-results')).toBeVisible()
114+
115+
// aria-activedescendant only points at something once a row is selected, so the
116+
// unselected scan above cannot catch a broken reference.
117+
await page.keyboard.press('ArrowDown')
118+
await expect(input).toHaveAttribute('aria-activedescendant', /search-option-/)
119+
120+
const accessibilityScanResults = await new AxeBuilder({ page })
121+
.include('[role="dialog"]')
122+
.analyze()
123+
124+
expect(accessibilityScanResults.violations).toEqual([])
125+
})
126+
})

0 commit comments

Comments
 (0)