mirror of
https://github.com/cloud-shuttle/leptos-shadcn-ui.git
synced 2025-12-22 22:00:00 +00:00
fix: Improve sidebar toggle test logic to handle initial state
- Check initial sidebar visibility state before toggling - Test that sidebar state actually changes after toggle click - Handle both cases: sidebar initially visible or hidden - This should fix the remaining sidebar toggle test failure
This commit is contained in:
@@ -210,12 +210,19 @@ test.describe('Comprehensive Dashboard Demo E2E Tests', () => {
|
||||
const sidebarToggle = page.locator('button:has-text("☰")');
|
||||
await expect(sidebarToggle).toBeVisible();
|
||||
|
||||
// Check initial sidebar state
|
||||
const sidebar = page.locator('div.w-64.bg-card.border-r.border-border');
|
||||
const isInitiallyVisible = await sidebar.isVisible();
|
||||
|
||||
// Click sidebar toggle
|
||||
await sidebarToggle.click();
|
||||
|
||||
// Check that sidebar is hidden/shown
|
||||
const sidebar = page.locator('div.w-64.bg-card.border-r.border-border');
|
||||
await expect(sidebar).toBeVisible();
|
||||
// Check that sidebar state changed
|
||||
if (isInitiallyVisible) {
|
||||
await expect(sidebar).not.toBeVisible();
|
||||
} else {
|
||||
await expect(sidebar).toBeVisible();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user