forked from immich-app/immich
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(web): hide detail panel for shared links with hidden metadata (im…
- Loading branch information
1 parent
e7aa504
commit 8bfa676
Showing
2 changed files
with
49 additions
and
3 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,46 @@ | ||
import { AssetFileUploadResponseDto, LoginResponseDto, SharedLinkType } from '@immich/sdk'; | ||
import { expect, test } from '@playwright/test'; | ||
import { utils } from 'src/utils'; | ||
|
||
test.describe('Detail Panel', () => { | ||
let admin: LoginResponseDto; | ||
let asset: AssetFileUploadResponseDto; | ||
|
||
test.beforeAll(async () => { | ||
utils.initSdk(); | ||
await utils.resetDatabase(); | ||
admin = await utils.adminSetup(); | ||
asset = await utils.createAsset(admin.accessToken); | ||
}); | ||
|
||
test('can be opened for shared links', async ({ page }) => { | ||
const sharedLink = await utils.createSharedLink(admin.accessToken, { | ||
type: SharedLinkType.Individual, | ||
assetIds: [asset.id], | ||
}); | ||
await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); | ||
await page.waitForSelector('#immich-asset-viewer'); | ||
|
||
await expect(page.getByRole('button', { name: 'Info' })).toBeVisible(); | ||
await page.keyboard.press('i'); | ||
await expect(page.locator('#detail-panel')).toBeVisible(); | ||
await page.keyboard.press('i'); | ||
await expect(page.locator('#detail-panel')).toHaveCount(0); | ||
}); | ||
|
||
test('cannot be opened for shared links with hidden metadata', async ({ page }) => { | ||
const sharedLink = await utils.createSharedLink(admin.accessToken, { | ||
type: SharedLinkType.Individual, | ||
assetIds: [asset.id], | ||
showMetadata: false, | ||
}); | ||
await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`); | ||
await page.waitForSelector('#immich-asset-viewer'); | ||
|
||
await expect(page.getByRole('button', { name: 'Info' })).toHaveCount(0); | ||
await page.keyboard.press('i'); | ||
await expect(page.locator('#detail-panel')).toHaveCount(0); | ||
await page.keyboard.press('i'); | ||
await expect(page.locator('#detail-panel')).toHaveCount(0); | ||
}); | ||
}); |
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