You've already forked immich
mirror of
https://github.com/immich-app/immich.git
synced 2025-08-09 23:17:29 +02:00
fix(web): detail panel out of sync when reopening (#11713)
* fix(web): detail panel out of sync when reopening * extract event handler
This commit is contained in:
@@ -1,16 +1,23 @@
|
||||
import { AssetMediaResponseDto, LoginResponseDto, SharedLinkType } from '@immich/sdk';
|
||||
import { expect, test } from '@playwright/test';
|
||||
import type { Socket } from 'socket.io-client';
|
||||
import { utils } from 'src/utils';
|
||||
|
||||
test.describe('Detail Panel', () => {
|
||||
let admin: LoginResponseDto;
|
||||
let asset: AssetMediaResponseDto;
|
||||
let websocket: Socket;
|
||||
|
||||
test.beforeAll(async () => {
|
||||
utils.initSdk();
|
||||
await utils.resetDatabase();
|
||||
admin = await utils.adminSetup();
|
||||
asset = await utils.createAsset(admin.accessToken);
|
||||
websocket = await utils.connectWebsocket(admin.accessToken);
|
||||
});
|
||||
|
||||
test.afterAll(() => {
|
||||
utils.disconnectWebsocket(websocket);
|
||||
});
|
||||
|
||||
test('can be opened for shared links', async ({ page }) => {
|
||||
@@ -57,4 +64,23 @@ test.describe('Detail Panel', () => {
|
||||
await expect(textarea).toBeVisible();
|
||||
await expect(textarea).not.toBeDisabled();
|
||||
});
|
||||
|
||||
test('description changes are visible after reopening', async ({ context, page }) => {
|
||||
await utils.setAuthCookies(context, admin.accessToken);
|
||||
await page.goto(`/photos/${asset.id}`);
|
||||
await page.waitForSelector('#immich-asset-viewer');
|
||||
|
||||
await page.getByRole('button', { name: 'Info' }).click();
|
||||
const textarea = page.getByRole('textbox', { name: 'Add a description' });
|
||||
await textarea.fill('new description');
|
||||
await expect(textarea).toHaveValue('new description');
|
||||
|
||||
await page.getByRole('button', { name: 'Info' }).click();
|
||||
await expect(textarea).not.toBeVisible();
|
||||
await page.getByRole('button', { name: 'Info' }).click();
|
||||
await expect(textarea).toBeVisible();
|
||||
|
||||
await utils.waitForWebsocketEvent({ event: 'assetUpdate', id: asset.id });
|
||||
await expect(textarea).toHaveValue('new description');
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user