feat: 侧边栏默认亮色主题,暗黑主题下跟随切换
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user