Skip to content

Commit

Permalink
fix: sidebar collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
awesthouse committed Jun 25, 2024
1 parent f1776cc commit 04c594a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions e2e/tests/plugin-view_selector-car_garage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test('View selector - car garage', async ({ page }) => {

await test.step('Collapse and expand sidebar', async () => {
await page.getByRole('tab', { name: 'Self' }).click()
await page.getByRole('button', { name: 'Collapse' }).click()
await page.getByRole('button', { name: 'Collapse sidebar' }).click()
await expect(page.getByRole('tab', { name: 'Self' })).not.toBeVisible()
await expect(page.getByRole('tab', { name: 'Audi' })).not.toBeVisible()
await expect(page.getByRole('tab', { name: 'Volvo' })).not.toBeVisible()
Expand All @@ -23,7 +23,7 @@ test('View selector - car garage', async ({ page }) => {
)
await page.getByRole('tab').first().click()
await expect(page.getByLabel('Name')).toHaveValue('CarGarage')
await page.getByRole('button', { name: 'Expand' }).click()
await page.getByRole('button', { name: 'Expand sidebar' }).click()
await expect(page.getByRole('tab', { name: 'Self' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Audi' })).toBeVisible()
await expect(page.getByRole('tab', { name: 'Volvo' })).toBeVisible()
Expand Down
1 change: 1 addition & 0 deletions packages/dm-core-plugins/src/view_selector/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ export const Sidebar = (props: {
<SideBar.Footer style={{ display: 'flex', justifyContent: 'flex-end' }}>
<CustomToggle expanded={isOpen}>
<Button
aria-label={isOpen ? 'Collapse sidebar' : 'Expand sidebar'}
onClick={() => setIsOpen(!isOpen)}
variant='ghost_icon'
color='secondary'
Expand Down

0 comments on commit 04c594a

Please sign in to comment.