1
0

feat: 侧边栏默认亮色主题,暗黑主题下跟随切换

This commit is contained in:
2026-04-17 00:30:26 +08:00
parent ddd284c1ca
commit 49818ed4d8
5 changed files with 72 additions and 16 deletions

View File

@@ -46,20 +46,11 @@ test.describe('侧边栏导航', () => {
await expect(collapsedSider).toBeVisible();
});
test('应显示主题切换按钮', async ({ page }) => {
test('默认应显示亮色侧边栏', async ({ page }) => {
const sider = page.locator('.ant-layout-sider');
const themeButton = sider.getByRole('button').filter({ has: page.getByRole('img', { name: 'moon' }) });
await expect(themeButton).toBeVisible();
});
await expect(sider).toBeVisible();
test('应能通过主题切换按钮切换主题', async ({ page }) => {
const sider = page.locator('.ant-layout-sider');
const themeButton = sider.getByRole('button').filter({ has: page.getByRole('img', { name: 'moon' }) });
await themeButton.click();
await page.waitForTimeout(300);
const lightButton = sider.getByRole('button').filter({ has: page.getByRole('img', { name: 'sun' }) });
await expect(lightButton).toBeVisible();
const menu = page.locator('.ant-menu-light');
await expect(menu).toBeVisible();
});
});