Skip to content

Commit

Permalink
Test configuration error
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Dec 18, 2023
1 parent 876617e commit 09d34d4
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .hass/config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ lovelace:
mode: yaml
title: Override after
filename: ui-lovelace-override-after.yaml
lovelace-config-with-error:
mode: yaml
title: Config with error
filename: ui-lovelace-config-with-error.yaml

# Load frontend themes from the themes folder
frontend:
Expand Down
10 changes: 10 additions & 0 deletions .hass/config/ui-lovelace-config-with-error.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
keep_texts_in_tabs:
enabled: true
include:
- Muziek
- Alarmen
exclude:
- Windy
- Planten
title: Config with error
views: !include views.yaml
10 changes: 10 additions & 0 deletions tests/main-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ test('Should be the same after a window resize', async ({ page }) => {
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('01-enabled.png');
});

test('Config with error', async ({ page }) => {
page.on('pageerror', error => {
expect(error.message).toBe('keep-texts-in-tabs: Configuration cannot have "include" and "exclude" properties at the same time');
});
await page.goto(
getLovelaceUrl('config-with-error')
);
await expect(page.locator(HEADER_SELECTOR)).toBeVisible();
});

test.describe('Small viewport', () => {

test.use({ viewport: { width: 400, height: 600 } });
Expand Down

0 comments on commit 09d34d4

Please sign in to comment.