-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core/event-list): event-list-items not selectabe in chrome (#1230)
Co-authored-by: Daniel Leroux <[email protected]>
- Loading branch information
1 parent
5eea8d1
commit 5b2df0c
Showing
5 changed files
with
103 additions
and
86 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/event-list): event-list-items not selectabe in chrome |
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 |
---|---|---|
|
@@ -28,6 +28,7 @@ const config: PlaywrightTestConfig = { | |
}, | ||
}, | ||
], | ||
retries: 2, | ||
}; | ||
|
||
export default config; |
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
70 changes: 70 additions & 0 deletions
70
packages/core/src/components/event-list/test/event-list.ct.ts
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,70 @@ | ||
/* | ||
* 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 'jest'; | ||
import { test } from '@utils/test'; | ||
import { expect } from '@playwright/test'; | ||
|
||
test('renders', async ({ mount, page }) => { | ||
await mount(` | ||
<ix-event-list> | ||
<ix-event-list-item color="color-primary">Text 1</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 2</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 3</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 4</ix-event-list-item> | ||
</ix-event-list> | ||
`); | ||
|
||
const eventList = page.locator('ix-event-list'); | ||
await expect(eventList).toHaveClass(/hydrated/); | ||
}); | ||
|
||
test('check if items still clickable', async ({ mount, page }) => { | ||
await mount(` | ||
<ix-event-list> | ||
<ix-event-list-item color="color-primary" selected>Text 1</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 2</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 3</ix-event-list-item> | ||
<ix-event-list-item color="color-primary">Text 4</ix-event-list-item> | ||
</ix-event-list> | ||
`); | ||
|
||
await page.waitForTimeout(500); | ||
const firstEventListItem = page.locator('ix-event-list-item').first(); | ||
const secondEventListItem = page.locator('ix-event-list-item').nth(1); | ||
const thirdEventListItem = page.locator('ix-event-list-item').last(); | ||
|
||
const clickCountHandle = await page.evaluateHandle(() => { | ||
return { count: 0 }; | ||
}); | ||
|
||
await firstEventListItem.evaluate((eventListItem, clickCountHandle) => { | ||
eventListItem.addEventListener('click', () => { | ||
clickCountHandle.count++; | ||
}); | ||
}, clickCountHandle); | ||
|
||
await firstEventListItem.click(); | ||
await secondEventListItem.click(); | ||
await thirdEventListItem.click(); | ||
|
||
//Check if still clickable | ||
await firstEventListItem.click(); | ||
expect((await clickCountHandle.jsonValue()).count).toBe(2); | ||
|
||
clickCountHandle.dispose(); | ||
}); |
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