mirror of
https://github.com/immich-app/immich.git
synced 2026-02-28 01:29:04 +03:00
test: thumbnail selector (#26383)
* test: face ordering issue/flakiness * test: thumbnail selector
This commit is contained in:
@@ -65,7 +65,7 @@ export const thumbnailUtils = {
|
|||||||
return page.locator(`[data-thumbnail-focus-container][data-asset="${assetId}"] button`);
|
return page.locator(`[data-thumbnail-focus-container][data-asset="${assetId}"] button`);
|
||||||
},
|
},
|
||||||
selectedAsset(page: Page) {
|
selectedAsset(page: Page) {
|
||||||
return page.locator('[data-thumbnail-focus-container]:has(button[aria-checked])');
|
return page.locator('[data-thumbnail-focus-container][data-selected]');
|
||||||
},
|
},
|
||||||
async clickAssetId(page: Page, assetId: string) {
|
async clickAssetId(page: Page, assetId: string) {
|
||||||
await thumbnailUtils.withAssetId(page, assetId).click();
|
await thumbnailUtils.withAssetId(page, assetId).click();
|
||||||
@@ -103,11 +103,8 @@ export const thumbnailUtils = {
|
|||||||
await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-archive]')).toHaveCount(0);
|
await expect(thumbnailUtils.withAssetId(page, assetId).locator('[data-icon-archive]')).toHaveCount(0);
|
||||||
},
|
},
|
||||||
async expectSelectedReadonly(page: Page, assetId: string) {
|
async expectSelectedReadonly(page: Page, assetId: string) {
|
||||||
// todo - need a data attribute for selected
|
|
||||||
await expect(
|
await expect(
|
||||||
page.locator(
|
page.locator(`[data-thumbnail-focus-container][data-asset="${assetId}"][data-selected]`),
|
||||||
`[data-thumbnail-focus-container][data-asset="${assetId}"] > .group.cursor-not-allowed > .rounded-xl`,
|
|
||||||
),
|
|
||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
},
|
},
|
||||||
async expectTimelineHasOnScreenAssets(page: Page) {
|
async expectTimelineHasOnScreenAssets(page: Page) {
|
||||||
|
|||||||
@@ -223,6 +223,7 @@
|
|||||||
bind:this={element}
|
bind:this={element}
|
||||||
data-asset={asset.id}
|
data-asset={asset.id}
|
||||||
data-thumbnail-focus-container
|
data-thumbnail-focus-container
|
||||||
|
data-selected={selected ? true : undefined}
|
||||||
tabindex={0}
|
tabindex={0}
|
||||||
role="link"
|
role="link"
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user