mirror of
https://github.com/immich-app/immich.git
synced 2025-05-24 02:13:51 -04:00
* Squashed * Change strategy - now pre-measure buckets offscreen, so don't need to worry about sub-bucket scroll preservation * Reduce jank on scroll, delay DOM updates until after scroll * css opt, log measure time * Trickle out queue while scrolling, flush when stopped * yay * Cleanup cleanup... * everybody... * everywhere... * Clean up cleanup! * Everybody do their share * CLEANUP! * package-lock ? * dynamic measure, todo * Fix web test * type lint * fix e2e * e2e test * Better scrollbar * Tuning, and more tunables * Tunable tweaks, more tunables * Scrollbar dots and viewport events * lint * Tweaked tunnables, use requestIdleCallback for garbage tasks, bug fixes * New tunables, and don't update url by default * Bug fixes * Bug fix, with debug * Fix flickr, fix graybox bug, reduced debug * Refactor/cleanup * Fix * naming * Final cleanup * review comment * Forgot to update this after naming change * scrubber works, with debug * cleanup * Rename scrollbar to scrubber * rename to * left over rename and change to previous album bar * bugfix addassets, comments * missing destroy(), cleanup --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
73 lines
2.4 KiB
TypeScript
73 lines
2.4 KiB
TypeScript
import {
|
|
AlbumResponseDto,
|
|
AssetMediaResponseDto,
|
|
LoginResponseDto,
|
|
SharedLinkResponseDto,
|
|
SharedLinkType,
|
|
createAlbum,
|
|
} from '@immich/sdk';
|
|
import { test } from '@playwright/test';
|
|
import { asBearerAuth, utils } from 'src/utils';
|
|
|
|
test.describe('Shared Links', () => {
|
|
let admin: LoginResponseDto;
|
|
let asset: AssetMediaResponseDto;
|
|
let album: AlbumResponseDto;
|
|
let sharedLink: SharedLinkResponseDto;
|
|
let sharedLinkPassword: SharedLinkResponseDto;
|
|
|
|
test.beforeAll(async () => {
|
|
utils.initSdk();
|
|
await utils.resetDatabase();
|
|
admin = await utils.adminSetup();
|
|
asset = await utils.createAsset(admin.accessToken);
|
|
album = await createAlbum(
|
|
{
|
|
createAlbumDto: {
|
|
albumName: 'Test Album',
|
|
assetIds: [asset.id],
|
|
},
|
|
},
|
|
{ headers: asBearerAuth(admin.accessToken) },
|
|
);
|
|
sharedLink = await utils.createSharedLink(admin.accessToken, {
|
|
type: SharedLinkType.Album,
|
|
albumId: album.id,
|
|
});
|
|
sharedLinkPassword = await utils.createSharedLink(admin.accessToken, {
|
|
type: SharedLinkType.Album,
|
|
albumId: album.id,
|
|
password: 'test-password',
|
|
});
|
|
});
|
|
|
|
test('download from a shared link', async ({ page }) => {
|
|
await page.goto(`/share/${sharedLink.key}`);
|
|
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
|
await page.locator('.group').first().hover();
|
|
await page.waitForSelector('#asset-group-by-date svg');
|
|
await page.getByRole('checkbox').click();
|
|
await page.getByRole('button', { name: 'Download' }).click();
|
|
await page.getByText('DOWNLOADING', { exact: true }).waitFor();
|
|
});
|
|
|
|
test('download all from shared link', async ({ page }) => {
|
|
await page.goto(`/share/${sharedLink.key}`);
|
|
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
|
await page.getByRole('button', { name: 'Download' }).click();
|
|
await page.getByText('DOWNLOADING', { exact: true }).waitFor();
|
|
});
|
|
|
|
test('enter password for a shared link', async ({ page }) => {
|
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
|
await page.getByPlaceholder('Password').fill('test-password');
|
|
await page.getByRole('button', { name: 'Submit' }).click();
|
|
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
|
});
|
|
|
|
test('show error for invalid shared link', async ({ page }) => {
|
|
await page.goto('/share/invalid');
|
|
await page.getByRole('heading', { name: 'Invalid share key' }).waitFor();
|
|
});
|
|
});
|