Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/menu): fix theme switching icon #1121

Merged
merged 9 commits into from
Feb 26, 2024
2 changes: 1 addition & 1 deletion packages/core/src/components/menu/menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ export class Menu {
id="toggleTheme"
onClick={() => themeSwitcher.toggleMode()}
class="internal-tab bottom-tab"
icon={'bulb'}
icon={'light-dark'}
>
{this.i18nToggleTheme}
</ix-menu-item>
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/tests/menu/menu.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,21 @@ test.describe('menu', () => {
}
);

regressionTest('toggle - check icon & functionality', async ({ page }) => {
await page.setViewportSize(viewPorts.lg);
await page.goto('menu/toggle');

const category = page.locator('ix-menu-category');
await category.click();

const themeToggle = page.locator('#toggleTheme');
await themeToggle.click();

await page.waitForTimeout(10000);

await expect(page).toHaveScreenshot();
});

regressionTest(
'category open on expand when initially closed and activated',
async ({ page }) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions packages/core/src/tests/menu/toggle/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!--
SPDX-FileCopyrightText: 2023 Siemens AG

SPDX-License-Identifier: MIT
-->

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"
name="viewport"
/>
<title>Stencil Component Starter</title>
</head>
<body style="width: 100vw; height: 100vh">
<ix-basic-navigation>
<ix-menu enable-toggle-theme>
<ix-menu-item>Item 1</ix-menu-item>
<ix-menu-category label="Category with a long name">
<ix-menu-item icon="home">Sub 1</ix-menu-item>
<ix-menu-item>Sub 2</ix-menu-item>
<ix-menu-item icon="star">Sub 3</ix-menu-item>
<ix-menu-item>Sub 4</ix-menu-item>
</ix-menu-category>
</ix-menu>
</ix-basic-navigation>
<script src="http://127.0.0.1:8080/scripts/e2e/load-e2e-runtime.js"></script>
</body>
</html>
Loading