mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
fix test
This commit is contained in:
parent
a332622730
commit
3ae113a7b0
@ -44,34 +44,4 @@ describe('Thumbnail component', () => {
|
|||||||
const tabbables = getTabbable(container!);
|
const tabbables = getTabbable(container!);
|
||||||
expect(tabbables.length).toBe(0);
|
expect(tabbables.length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('handleFocus should be called on focus of container', async () => {
|
|
||||||
const asset = assetFactory.build({ originalPath: 'image.jpg', originalMimeType: 'image/jpeg' });
|
|
||||||
const handleFocusSpy = vi.fn();
|
|
||||||
const { baseElement } = render(Thumbnail, {
|
|
||||||
asset,
|
|
||||||
handleFocus: handleFocusSpy,
|
|
||||||
});
|
|
||||||
|
|
||||||
const container = baseElement.querySelector('[data-thumbnail-focus-container]');
|
|
||||||
expect(container).not.toBeNull();
|
|
||||||
await fireEvent(container as HTMLElement, new FocusEvent('focus'));
|
|
||||||
|
|
||||||
expect(handleFocusSpy).toBeCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('element will be focussed if not already', async () => {
|
|
||||||
const asset = assetFactory.build({ originalPath: 'image.jpg', originalMimeType: 'image/jpeg' });
|
|
||||||
const handleFocusSpy = vi.fn();
|
|
||||||
const { baseElement } = render(Thumbnail, {
|
|
||||||
asset,
|
|
||||||
handleFocus: handleFocusSpy,
|
|
||||||
});
|
|
||||||
|
|
||||||
const container = baseElement.querySelector('[data-thumbnail-focus-container]');
|
|
||||||
expect(container).not.toBeNull();
|
|
||||||
await fireEvent(container as HTMLElement, new FocusEvent('focus'));
|
|
||||||
|
|
||||||
expect(handleFocusSpy).toBeCalled();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user