-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/group): show expand-collapse icon (#1260)
- Loading branch information
1 parent
9f8c0b5
commit 90a7b71
Showing
3 changed files
with
91 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@siemens/ix': patch | ||
--- | ||
|
||
fix(core/group): show expand-collapse icon |
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,56 @@ | ||
/* | ||
* 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-group></ix-group>`); | ||
const group = page.locator('ix-group'); | ||
await expect(group).toHaveClass(/hydrated/); | ||
}); | ||
|
||
test('hide expand icon initial', async ({ mount, page }) => { | ||
await mount(` | ||
<ix-group> | ||
</ix-group> | ||
`); | ||
const group = page.locator('ix-group'); | ||
await expect(group).toHaveClass(/hydrated/); | ||
|
||
const expandIcon = group.getByTestId('expand-collapsed-icon'); | ||
await expect(expandIcon).not.toBeVisible(); | ||
|
||
await group.evaluate((group) => { | ||
const item = document.createElement('ix-group-item'); | ||
group.appendChild(item); | ||
}); | ||
|
||
await expect(expandIcon).toBeVisible(); | ||
}); | ||
|
||
test('show expand icon initial', async ({ mount, page }) => { | ||
await mount(` | ||
<ix-group> | ||
<ix-group-item>Item 1</ix-group-item> | ||
</ix-group> | ||
`); | ||
const group = page.locator('ix-group'); | ||
await expect(group).toHaveClass(/hydrated/); | ||
|
||
const expandIcon = group.getByTestId('expand-collapsed-icon'); | ||
await expect(expandIcon).toBeVisible(); | ||
|
||
await group.evaluate((group) => { | ||
const item = group.querySelector('ix-group-item'); | ||
item.remove(); | ||
}); | ||
|
||
await expect(expandIcon).not.toBeVisible(); | ||
}); |