-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/drawer): start show true (#652)
Co-authored-by: Daniel Leroux <daniel.leroux@siemens.com>
- Loading branch information
1 parent
5ac2ecb
commit 56c730b
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
/* | ||
* SPDX-FileCopyrightText: 2023 Siemens AG | ||
* | ||
* SPDX-License-Identifier: MIT | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
import { expect } from '@playwright/test'; | ||
import { test } from '@utils/test'; | ||
|
||
test('renders', async ({ mount, page }) => { | ||
await mount(`<ix-drawer>Content</ix-drawer>`); | ||
const drawer = page.locator('ix-drawer'); | ||
await expect(drawer).toHaveClass(/hydrated/); | ||
await expect(drawer).not.toBeVisible(); | ||
}); | ||
|
||
test('show by property (initial)', async ({ mount, page }) => { | ||
await mount(`<ix-drawer show>Content</ix-drawer>`); | ||
const drawer = page.locator('ix-drawer'); | ||
await expect(drawer).toHaveClass(/hydrated/); | ||
await expect(drawer).toBeVisible(); | ||
}); | ||
|
||
test('show by property', async ({ mount, page }) => { | ||
await mount(`<ix-drawer show>Content</ix-drawer>`); | ||
const drawer = page.locator('ix-drawer'); | ||
|
||
await drawer.evaluate( | ||
(drawerElement: HTMLIxDrawerElement) => (drawerElement.show = true) | ||
); | ||
|
||
await expect(drawer).toHaveClass(/hydrated/); | ||
await expect(drawer).toBeVisible(); | ||
}); | ||
|
||
test('toggle by property', async ({ mount, page }) => { | ||
await mount(`<ix-drawer show>Content</ix-drawer>`); | ||
const drawer = page.locator('ix-drawer'); | ||
|
||
await drawer.evaluate( | ||
(drawerElement: HTMLIxDrawerElement) => (drawerElement.show = true) | ||
); | ||
|
||
await expect(drawer).toHaveClass(/hydrated/); | ||
await expect(drawer).toBeVisible(); | ||
|
||
await drawer.evaluate( | ||
(drawerElement: HTMLIxDrawerElement) => (drawerElement.show = false) | ||
); | ||
|
||
await expect(drawer).not.toBeVisible(); | ||
}); |