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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

fix:mirador_crash #3927

wants to merge 6 commits into from

Conversation

fstoe
Copy link

@fstoe fstoe commented Jul 30, 2024

I found out that adding something through the add button in the catalog view which is json but not a manifest makes the viewer crash.
steps to reproduce:

@codecov-commenter
Copy link

codecov-commenter commented Jul 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.52%. Comparing base (05194d8) to head (13c7a4a).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3927   +/-   ##
=======================================
  Coverage   94.52%   94.52%           
=======================================
  Files         313      313           
  Lines       14767    14770    +3     
  Branches     2496     2495    -1     
=======================================
+ Hits        13958    13962    +4     
+ Misses        804      803    -1     
  Partials        5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lutzhelm
Copy link
Contributor

lutzhelm commented Aug 2, 2024

Hi @fstoe, could you add a test case for that patch? createManifestoInstance itself is not exported, but getManifestoInstance calls it directly, so this would be a good place to add a test:

https://github.com/ProjectMirador/mirador/blob/master/__tests__/src/selectors/manifests.test.js#L56-L68

Something like

it('does not crash if json is not a manifest', () => {
  const state = { manifests: { x: { json: {} } } };
  const received = getManifestoInstance(state, { manifestId: 'x' });
  expect(received).toBe(undefined);
});

@fstoe
Copy link
Author

fstoe commented Aug 5, 2024

Hey @lutzhelm,
thanks for the comment. I just added a small test case

@gerdesque gerdesque requested a review from lutzhelm December 19, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants