chore(deps): update vitest monorepo to v5 (#31912)

Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
renovate[bot]
2026-10-19 20:27:42 +03:00
committed by Codex
co-authored by Daniel Dietzler
parent f3db8d8b59
commit 0207d48035
26 changed files with 193 additions and 131 deletions
+2 -2
View File
@@ -93,7 +93,7 @@
"@types/luxon": "^3.4.2",
"@types/qrcode": "^1.5.5",
"@typescript/native": "npm:typescript@^7.0.2",
"@vitest/coverage-v8": "^4.0.0",
"@vitest/coverage-v8": "^5.0.0",
"dotenv": "^17.0.0",
"eslint": "^10.2.1",
"eslint-config-prettier": "^10.1.8",
@@ -116,6 +116,6 @@
"typescript": "npm:@typescript/typescript6@^6.0.2",
"typescript-eslint": "8.71.1",
"vite": "^8.0.0",
"vitest": "^4.0.0"
"vitest": "^5.0.0"
}
}
@@ -43,15 +43,21 @@ describe('AlbumCard component', () => {
const albumDetailsElement = sut.getByTestId('album-details');
const detailsText = `${count} items` + (shared ? ' . Shared' : '');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumImgElement).toHaveAttribute('src');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumImgElement).toHaveAttribute('alt', album.albumName);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
await waitFor(() => expect(albumImgElement).toHaveAttribute('src'));
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumImgElement).toHaveAttribute('alt', album.albumName);
expect(sdkMock.viewAsset).not.toHaveBeenCalled();
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumNameElement).toHaveTextContent(album.albumName);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumDetailsElement).toHaveTextContent(new RegExp(detailsText));
});
@@ -66,10 +72,14 @@ describe('AlbumCard component', () => {
const albumNameElement = sut.getByTestId('album-name');
const albumDetailsElement = sut.getByTestId('album-details');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumImgElement).toHaveAttribute('alt', album.albumName);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumImgElement).toHaveAttribute('src');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumNameElement).toHaveTextContent('some album name');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(albumDetailsElement).toHaveTextContent(`${album.assetCount} item`);
});
@@ -78,6 +88,7 @@ describe('AlbumCard component', () => {
sut = render(AlbumCard, { album });
const contextButtonParent = sut.queryByTestId('context-button-parent');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(contextButtonParent).not.toBeInTheDocument();
});
});
@@ -23,12 +23,15 @@ describe('AlbumSummary component', () => {
assetCount: 3,
});
const { rerender } = render(AlbumSummary, { album });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByTestId('album-details')).toHaveTextContent('Jun 10');
await rerender({ album: { ...album, startDate: '2026-06-15T12:00:00.000Z', assetCount: 2 } });
const details = screen.getByTestId('album-details');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(details).toHaveTextContent('Jun 15');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(details).not.toHaveTextContent('Jun 10');
});
});
@@ -66,6 +66,7 @@ describe('AssetViewer', () => {
showNavigation: false,
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(getByLabelText('to_favorite')).toBeInTheDocument();
expect(queryByLabelText('unfavorite')).toBeNull();
@@ -74,6 +75,7 @@ describe('AssetViewer', () => {
await waitFor(() =>
expect(updateAsset).toHaveBeenCalledWith({ id: asset.id, updateAssetDto: { isFavorite: true } }),
);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
await waitFor(() => expect(getByLabelText('unfavorite')).toBeInTheDocument());
});
});
@@ -50,6 +50,7 @@ describe('AssetViewerNavBar component', () => {
const asset = assetFactory.build({ isTrashed: false });
const { getByLabelText } = renderWithTooltips(AssetViewerNavBar, { asset, ...additionalProps });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(getByLabelText('go_back')).toBeInTheDocument();
});
@@ -64,6 +65,7 @@ describe('AssetViewerNavBar component', () => {
authManager.setPreferences(preferences);
const { getByLabelText } = renderWithTooltips(AssetViewerNavBar, { asset, ...additionalProps });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(getByLabelText('delete')).toBeInTheDocument();
});
});
@@ -26,6 +26,7 @@ describe('DetailPanelDescription', () => {
const textarea = screen.getByTestId('autogrow-textarea') as HTMLTextAreaElement;
await user.type(textarea, 'unsaved draft');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(textarea).toHaveValue('unsaved draft');
await rerender({
@@ -33,6 +34,7 @@ describe('DetailPanelDescription', () => {
isOwner: true,
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByTestId('autogrow-textarea')).toHaveValue('');
});
@@ -53,6 +55,7 @@ describe('DetailPanelDescription', () => {
},
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByTestId('autogrow-textarea')).toHaveValue('first description');
await rerender({
@@ -60,6 +63,7 @@ describe('DetailPanelDescription', () => {
isOwner: true,
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByTestId('autogrow-textarea')).toHaveValue('second description');
});
});
@@ -23,6 +23,7 @@ describe('DeleteAction component', () => {
onAction: vi.fn(),
preAction: vi.fn(),
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(getByLabelText('delete')).toBeInTheDocument();
expect(queryByTitle('deletePermanently')).toBeNull();
});
@@ -39,6 +40,7 @@ describe('DeleteAction component', () => {
onAction: vi.fn(),
preAction: vi.fn(),
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(getByLabelText('permanently_delete')).toBeInTheDocument();
expect(queryByTitle('delete')).toBeNull();
});
@@ -49,6 +49,7 @@ describe('MaintenanceBackupEntry', () => {
timezone: 'Asia/Tokyo',
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText(expectedRelativeTime!)).toBeInTheDocument();
});
});
@@ -40,6 +40,7 @@ describe('SearchTagsSection component', () => {
await user.click(await screen.findByRole('button', { name: 'holiday' }));
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByRole('button', { name: 'holiday' })).not.toBeInTheDocument();
expect([...(searchManager.filter.tagIds ?? [])]).toEqual(['tag-2']);
});
@@ -24,8 +24,11 @@ describe('RecentAlbums component', () => {
const links = screen.getAllByRole('link');
expect(links).toHaveLength(3);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(links[0]).toHaveAttribute('href', `/albums/${albums[2].id}`);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(links[1]).toHaveAttribute('href', `/albums/${albums[1].id}`);
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(links[2]).toHaveAttribute('href', `/albums/${albums[3].id}`);
});
});
@@ -30,6 +30,7 @@ describe('FormatMessage component', () => {
key: 'hello' as Translations,
values: { name: 'test' },
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText('Hello test')).toBeInTheDocument();
});
@@ -43,6 +44,7 @@ describe('FormatMessage component', () => {
render(FormatMessage, {
key: 'hello' as Translations,
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText('Hello {name}')).toBeInTheDocument();
});
@@ -51,6 +53,7 @@ describe('FormatMessage component', () => {
key: 'html' as Translations,
values: { name: 'test' },
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText('Hello test')).toBeInTheDocument();
});
@@ -74,11 +77,13 @@ describe('FormatMessage component', () => {
render(FormatMessage, {
key: 'xss' as Translations,
});
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText('<image/src/onerror=prompt(8)>')).toBeInTheDocument();
});
it('displays the message key when not found', () => {
render(FormatMessage, { key: 'invalid.key' as Translations });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.getByText('invalid.key')).toBeInTheDocument();
});
@@ -19,6 +19,7 @@ describe('StarRating component', () => {
const labelText = component.getAllByText('rating_count') as HTMLSpanElement[];
expect(labelText.length).toBe(3);
const clearButton = component.getByRole('button') as HTMLButtonElement;
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(clearButton).toBeInTheDocument();
// Check the clear button content
@@ -34,7 +34,9 @@ describe('AlbumPickerModal component', () => {
render(AlbumPickerModal, { props: { onClose, selectedItemsCount: 1 } });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(await screen.findByText('Add 1 item to album')).toBeInTheDocument();
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByText('Select albums')).not.toBeInTheDocument();
});
@@ -43,7 +45,9 @@ describe('AlbumPickerModal component', () => {
render(AlbumPickerModal, { props: { onClose, selectedItemsCount: 3 } });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(await screen.findByText('Add 3 items to album')).toBeInTheDocument();
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByText('Select albums')).not.toBeInTheDocument();
});
@@ -52,7 +56,9 @@ describe('AlbumPickerModal component', () => {
render(AlbumPickerModal, { props: { onClose } });
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(await screen.findByText('Select albums')).toBeInTheDocument();
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByText('Add 1 item to album')).not.toBeInTheDocument();
});
});
@@ -86,6 +86,7 @@ describe('DateSelectionModal component', () => {
expect(getTimeZoneInput().value).toBe('Europe/Berlin (+01:00)');
await fireEvent.focus(getTimeZoneInput());
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByText('no_results')).not.toBeInTheDocument();
});
@@ -100,6 +101,7 @@ describe('DateSelectionModal component', () => {
expect(getTimeZoneInput().value).toBe('Europe/Berlin (+01:00)');
await fireEvent.focus(getTimeZoneInput());
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(screen.queryByText('no_results')).not.toBeInTheDocument();
});
@@ -7,12 +7,14 @@ describe('AlbumDescription component', () => {
it('shows an AutogrowTextarea component when isOwned is true', () => {
render(AlbumDescription, { isEditor: true, id: '', description: '' });
const autogrowTextarea = screen.getByTestId('autogrow-textarea');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(autogrowTextarea).toBeInTheDocument();
});
it('does not show an AutogrowTextarea component when isOwned is false', () => {
render(AlbumDescription, { isEditor: false, id: '', description: '' });
const autogrowTextarea = screen.queryByTestId('autogrow-textarea');
// @ts-expect-error pending a type fix: https://github.com/testing-library/jest-dom/pull/742/changes
expect(autogrowTextarea).not.toBeInTheDocument();
});
});