mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:36:44 -04:00
* refactor: asset media endpoints * refactor: mobile upload livePhoto as separate request * refactor: change mobile backup flow to use new asset upload endpoints * chore: format and analyze dart code * feat: mark motion as hidden when linked * feat: upload video portion of live photo before image portion * fix: incorrect assetApi calls in mobile code * fix: download asset --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> Co-authored-by: Zack Pollard <zackpollard@ymail.com>
53 lines
1.9 KiB
TypeScript
53 lines
1.9 KiB
TypeScript
import { AssetMediaResponseDto, LoginResponseDto, SharedLinkType } from '@immich/sdk';
|
|
import { expect, test } from '@playwright/test';
|
|
import { utils } from 'src/utils';
|
|
|
|
test.describe('Asset Viewer Navbar', () => {
|
|
let admin: LoginResponseDto;
|
|
let asset: AssetMediaResponseDto;
|
|
|
|
test.beforeAll(async () => {
|
|
utils.initSdk();
|
|
await utils.resetDatabase();
|
|
admin = await utils.adminSetup();
|
|
asset = await utils.createAsset(admin.accessToken);
|
|
});
|
|
|
|
test.describe('shared link without metadata', () => {
|
|
test('visible guest actions', 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');
|
|
|
|
const expected = ['Zoom Image', 'Copy Image', 'Download'];
|
|
const buttons = await page.getByTestId('asset-viewer-navbar-actions').getByRole('button').all();
|
|
|
|
for (const [i, button] of buttons.entries()) {
|
|
await expect(button).toHaveAccessibleName(expected[i]);
|
|
}
|
|
});
|
|
|
|
test('visible owner actions', async ({ context, page }) => {
|
|
const sharedLink = await utils.createSharedLink(admin.accessToken, {
|
|
type: SharedLinkType.Individual,
|
|
assetIds: [asset.id],
|
|
showMetadata: false,
|
|
});
|
|
await utils.setAuthCookies(context, admin.accessToken);
|
|
await page.goto(`/share/${sharedLink.key}/photos/${asset.id}`);
|
|
await page.waitForSelector('#immich-asset-viewer');
|
|
|
|
const expected = ['Share', 'Zoom Image', 'Copy Image', 'Download'];
|
|
const buttons = await page.getByTestId('asset-viewer-navbar-actions').getByRole('button').all();
|
|
|
|
for (const [i, button] of buttons.entries()) {
|
|
await expect(button).toHaveAccessibleName(expected[i]);
|
|
}
|
|
});
|
|
});
|
|
});
|