mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: svelte 5 🎉 (#13738)
chore: svelte 5 Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
This commit is contained in:
parent
fed882a28a
commit
eadcbd52fb
61 changed files with 287 additions and 217 deletions
|
|
@ -79,6 +79,8 @@ describe('NotificationCard component', () => {
|
|||
});
|
||||
|
||||
expect(sut.getByTestId('title')).toHaveTextContent('info');
|
||||
expect(sut.getByTestId('message').innerHTML).toEqual('Notification <b>message</b> with <a href="link">link</a>');
|
||||
expect(sut.getByTestId('message').innerHTML.replaceAll('<!---->', '')).toEqual(
|
||||
'Notification <b>message</b> with <a href="link">link</a>',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import { getAnimateMock } from '$lib/__mocks__/animate.mock';
|
||||
import '@testing-library/jest-dom';
|
||||
import { render, waitFor, type RenderResult } from '@testing-library/svelte';
|
||||
import { get } from 'svelte/store';
|
||||
|
|
@ -10,10 +11,7 @@ function _getNotificationListElement(sut: RenderResult<NotificationList>): HTMLA
|
|||
|
||||
describe('NotificationList component', () => {
|
||||
beforeAll(() => {
|
||||
// https://testing-library.com/docs/svelte-testing-library/faq#why-arent-transition-events-running
|
||||
vi.stubGlobal('requestAnimationFrame', (fn: FrameRequestCallback) => {
|
||||
setTimeout(() => fn(Date.now()), 16);
|
||||
});
|
||||
Element.prototype.animate = getAnimateMock();
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
|
|
@ -21,7 +19,7 @@ describe('NotificationList component', () => {
|
|||
});
|
||||
|
||||
it('shows a notification when added and closes it automatically after the delay timeout', async () => {
|
||||
const sut: RenderResult<NotificationList> = render(NotificationList);
|
||||
const sut: RenderResult<NotificationList> = render(NotificationList, { intro: false });
|
||||
const status = await sut.findAllByRole('status');
|
||||
|
||||
expect(status).toHaveLength(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue