Skip to content

Commit

Permalink
Create two override tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elchininet committed Dec 18, 2023
1 parent a8cac00 commit 544797c
Show file tree
Hide file tree
Showing 17 changed files with 70 additions and 169 deletions.
10 changes: 7 additions & 3 deletions .hass/config/configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ lovelace:
mode: yaml
title: Exclude
filename: ui-lovelace-exclude.yaml
lovelace-override:
lovelace-override-before:
mode: yaml
title: Override
filename: ui-lovelace-override.yaml
title: Override before
filename: ui-lovelace-override-before.yaml
lovelace-override-after:
mode: yaml
title: Override after
filename: ui-lovelace-override-after.yaml

# Load frontend themes from the themes folder
frontend:
Expand Down
32 changes: 1 addition & 31 deletions .hass/config/ui-lovelace-exclude.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,4 @@ keep_texts_in_tabs:
- Windy
- Planten
title: Exclude
views:
- theme: Backend-selected
title: Home
icon: mdi:home
path: home
badges: []
cards: []
- theme: Backend-selected
title: Muziek
icon: mdi:music
path: muziek
badges: []
cards: []
- theme: Backend-selected
title: Windy
icon: mdi:weather-windy
path: windy
badges: []
cards: []
- theme: Backend-selected
title: Alarmen
icon: mdi:alarm
path: alarmen
badges: []
cards: []
- theme: Backend-selected
title: Planten
icon: mdi:flower
path: planten
badges: []
cards: []
views: !include views.yaml
32 changes: 1 addition & 31 deletions .hass/config/ui-lovelace-include.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,4 @@ keep_texts_in_tabs:
- Muziek
- Alarmen
title: Include
views:
- theme: Backend-selected
title: Home
icon: mdi:home
path: home
badges: []
cards: []
- theme: Backend-selected
title: Muziek
icon: mdi:music
path: muziek
badges: []
cards: []
- theme: Backend-selected
title: Windy
icon: mdi:weather-windy
path: windy
badges: []
cards: []
- theme: Backend-selected
title: Alarmen
icon: mdi:alarm
path: alarmen
badges: []
cards: []
- theme: Backend-selected
title: Planten
icon: mdi:flower
path: planten
badges: []
cards: []
views: !include views.yaml
8 changes: 8 additions & 0 deletions .hass/config/ui-lovelace-override-after.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
keep_texts_in_tabs:
enabled: true
position: after
override:
- Muziek
- Planten
title: Override After
views: !include views.yaml
8 changes: 8 additions & 0 deletions .hass/config/ui-lovelace-override-before.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
keep_texts_in_tabs:
enabled: true
position: before
override:
- Muziek
- Planten
title: Override Before
views: !include views.yaml
38 changes: 0 additions & 38 deletions .hass/config/ui-lovelace-override.yaml

This file was deleted.

32 changes: 1 addition & 31 deletions .hass/config/ui-lovelace-position.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,4 @@ keep_texts_in_tabs:
enabled: true
position: before
title: Position
views:
- theme: Backend-selected
title: Home
icon: mdi:home
path: home
badges: []
cards: []
- theme: Backend-selected
title: Muziek
icon: mdi:music
path: muziek
badges: []
cards: []
- theme: Backend-selected
title: Windy
icon: mdi:weather-windy
path: windy
badges: []
cards: []
- theme: Backend-selected
title: Alarmen
icon: mdi:alarm
path: alarmen
badges: []
cards: []
- theme: Backend-selected
title: Planten
icon: mdi:flower
path: planten
badges: []
cards: []
views: !include views.yaml
32 changes: 1 addition & 31 deletions .hass/config/ui-lovelace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,4 @@ keep_texts_in_tabs:
enabled: true
position: before
title: Keep Text in Tabs
views:
- theme: Backend-selected
title: Home
icon: mdi:home
path: home
badges: []
cards: []
- theme: Backend-selected
title: Muziek
icon: mdi:music
path: muziek
badges: []
cards: []
- theme: Backend-selected
title: Windy
icon: mdi:weather-windy
path: windy
badges: []
cards: []
- theme: Backend-selected
title: Alarmen
icon: mdi:alarm
path: alarmen
badges: []
cards: []
- theme: Backend-selected
title: Planten
icon: mdi:flower
path: planten
badges: []
cards: []
views: !include views.yaml
30 changes: 30 additions & 0 deletions .hass/config/views.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- theme: Backend-selected
title: Home
icon: mdi:home
path: home
badges: []
cards: []
- theme: Backend-selected
title: Muziek
icon: mdi:music
path: muziek
badges: []
cards: []
- theme: Backend-selected
title: Windy
icon: mdi:weather-windy
path: windy
badges: []
cards: []
- theme: Backend-selected
title: Alarmen
icon: mdi:alarm
path: alarmen
badges: []
cards: []
- theme: Backend-selected
title: Planten
icon: mdi:flower
path: planten
badges: []
cards: []
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"license": "Apache-2.0",
"private": false,
"scripts": {
"build": "rollup --config rollup.config.js --bundleConfigAsCjs",
"build": "yarn test:clean && rollup --config rollup.config.js --bundleConfigAsCjs",
"test:clean": "rm -rf dist .nyc_output coverage || true",
"test:all": "yarn test:ts && yarn test:ci",
"test:ci": "yarn demo && yarn start:playwright && yarn stop:ha",
"test:run": "dotenv playwright test",
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 11 additions & 3 deletions tests/main-options.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,20 @@ test('Option: exclude', async ({ page }) => {
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('04-exclude.png');
});

test('Option: override', async ({ page }) => {
test('Option: override before', async ({ page }) => {
await page.goto(
getLovelaceUrl('override')
getLovelaceUrl('override-before')
);
await expect(page.locator(HEADER_SELECTOR)).toBeVisible();
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('05-override.png');
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('05-override-before.png');
});

test('Option: override after', async ({ page }) => {
await page.goto(
getLovelaceUrl('override-after')
);
await expect(page.locator(HEADER_SELECTOR)).toBeVisible();
await expect(page.locator(TABS_CONTENT_SELECTOR)).toHaveScreenshot('06-override-after.png');
});

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

0 comments on commit 544797c

Please sign in to comment.