Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:mirador_crash #3927

Merged
merged 9 commits into from
Feb 4, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add tests for empty fetched manifest
Fabian Stoehr committed Aug 5, 2024
commit f5d8cf2ec427da836462311b81c81102b8960ac7
12 changes: 11 additions & 1 deletion __tests__/src/components/ManifestListItem.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render, screen } from 'test-utils';
import userEvent from '@testing-library/user-event';

import { getManifestoInstance } from '../../../src/state/selectors';
import { ManifestListItem } from '../../../src/components/ManifestListItem';

/** */
@@ -47,6 +47,16 @@ describe('ManifestListItem', () => {
expect(screen.getByText('manifestError')).toBeInTheDocument();
expect(screen.getByText('http://example.com')).toBeInTheDocument();
});
it('renders an error message when fetched manifest is empty', () => {
const state = { manifests: { x: { json: {} } } };
const manifesto = getManifestoInstance(state, { manifestId: 'x' });

createWrapper({ error: !manifesto });

expect(screen.getByText('manifestError')).toBeInTheDocument();
expect(screen.getByText('http://example.com')).toBeInTheDocument();
});

it('updates and adds window when button clicked', async () => {
const user = userEvent.setup();
const addWindow = jest.fn();