Skip to content

Commit 57760d6

Browse files
committed
Fix SubdomainNavBar review findings
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: ed05986d-edce-42e8-8d89-da23c403edda
1 parent b60a21b commit 57760d6

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

packages/e2e/scripts/playwright/playwright.generate-tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const beforeScreenshotLookup: Partial<Record<string, string>> = {
154154
if ((await moreButton.getAttribute('aria-expanded')) !== 'true') {
155155
await moreButton.click()
156156
}
157-
const overflowMenu = page.locator('[id="' + (await moreButton.getAttribute('aria-controls')) + '"]')
157+
const overflowMenu = page.locator(\`[id="\${await moreButton.getAttribute('aria-controls')}"]\`)
158158
await expect(moreButton).toHaveAttribute('aria-expanded', 'true')
159159
await expect(overflowMenu).toBeVisible()
160160
await expect(overflowMenu.getByRole('link', {name: 'Books'})).toBeVisible()

packages/react/src/SubdomainNavBar/SubdomainNavBar.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@
288288
align-items: center;
289289
flex: 0 0 auto;
290290
position: absolute;
291-
right: 0;
291+
inset-inline-end: 0;
292292
visibility: hidden;
293293
pointer-events: none;
294294
}

packages/react/src/SubdomainNavBar/SubdomainNavBar.test.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,12 @@ describe('SubdomainNavBar', () => {
152152
expect(getByRole('banner')).toHaveAttribute('id', 'docs-navigation')
153153
})
154154

155+
it('forwards custom styles to the root element', () => {
156+
const {getByRole} = render(<SubdomainNavBar style={{opacity: 0.5}} title="Docs" />)
157+
158+
expect(getByRole('banner')).toHaveStyle({opacity: '0.5'})
159+
})
160+
155161
it('has no a11y violations by default', async () => {
156162
const {container} = render(<Component />)
157163

packages/react/src/SubdomainNavBar/SubdomainNavBar.visual.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test.describe('Visual Comparison: SubdomainNavBar', () => {
8484
if ((await moreButton.getAttribute('aria-expanded')) !== 'true') {
8585
await moreButton.click()
8686
}
87-
const overflowMenu = page.locator('[id="' + (await moreButton.getAttribute('aria-controls')) + '"]')
87+
const overflowMenu = page.locator(`[id="${await moreButton.getAttribute('aria-controls')}"]`)
8888
await expect(moreButton).toHaveAttribute('aria-expanded', 'true')
8989
await expect(overflowMenu).toBeVisible()
9090
await expect(overflowMenu.getByRole('link', {name: 'Books'})).toBeVisible()

0 commit comments

Comments
 (0)