Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mirador Video
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
IIIF
Mirador
Mirador Video
Commits
9587281b
Commit
9587281b
authored
Jul 24, 2020
by
Jack Reed
Browse files
Options
Downloads
Patches
Plain Diff
Backfill CollectionDialog tests
parent
9cf0d605
Loading
Loading
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/fixtures/version-2/collection.json
+292
-0
292 additions, 0 deletions
__tests__/fixtures/version-2/collection.json
__tests__/src/components/CollectionDialog.test.js
+44
-0
44 additions, 0 deletions
__tests__/src/components/CollectionDialog.test.js
with
336 additions
and
0 deletions
__tests__/fixtures/version-2/collection.json
0 → 100644
+
292
−
0
View file @
9587281b
{
"@context"
:
"http://iiif.io/api/presentation/2/context.json"
,
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/collection.json"
,
"@type"
:
"sc:Collection"
,
"label"
:
"Collection of Test Cases"
,
"manifests"
:
[
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/1/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 1 Manifest: Minimum Required Fields"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/2/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 2 Manifest: Metadata Pairs"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/3/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 3 Manifest: Metadata Pairs with Languages"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/4/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 4 Manifest: Metadata Pairs with Multiple Values in same Language"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/5/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 5 Manifest: Description field"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/6/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 6 Manifest: Multiple Descriptions"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/7/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 7 Manifest: Rights Metadata"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/8/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 8 Manifest: SeeAlso link / Manifest"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/9/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 9 Manifest: Service link / Manifest"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/10/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 10 Manifest: Service link as Object"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/11/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 11 Manifest: ViewingDirection: l-t-r"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/12/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 12 Manifest: ViewingDirection: r-t-l"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/13/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 13 Manifest: ViewingDirection: t-t-b"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/14/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 14 Manifest: ViewingDirection: b-t-t"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/15/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 15 Manifest: ViewingHint: paged"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/16/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 16 Manifest: ViewingHint: continuous"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/17/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 17 Manifest: ViewingHint: individuals"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/18/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 18 Manifest: Non Standard Keys"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/19/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 19 Manifest: Multiple Canvases"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/20/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 20 Manifest: Multiple Sequences"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/21/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 21 Manifest: Sequence with Metadata"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/22/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 22 Manifest: /Sequence/ with non l-t-r viewingDirection"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/23/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 23 Manifest: /Sequence/ with non paged viewingHint"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/24/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 24 Manifest: Image with IIIF Service"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/25/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 25 Manifest: Image with IIIF Service, embedded info"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/26/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 26 Manifest: Image different size to Canvas"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/27/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 27 Manifest: No Image"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/28/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 28 Manifest: Choice of Image"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/29/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 29 Manifest: Choice of Image with IIIF Service"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/30/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 30 Manifest: Main + Detail Image"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/31/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 31 Manifest: Detail with IIIF Service"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/32/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 32 Manifest: Multiple Detail Images"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/33/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 33 Manifest: Detail Image with Choice"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/34/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 34 Manifest: Detail Image with Choice, and 'no image' as option"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/35/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 35 Manifest: Partial Image as Main Image"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/36/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 36 Manifest: Partial Image as Main Image with IIIF Service"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/37/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 37 Manifest: Partial Image as Detail Image"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/38/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 38 Manifest: Partial Image as Detail Image with IIIF Service"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/39/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 39 Manifest: Image with CSS Rotation"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/40/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 40 Manifest: Multiple Languages for Metadata Labels"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/41/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 41 Manifest: Main Image with Server side Rotation"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/43/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 43 Manifest: Embedded Transcription on Canvas"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/44/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 44 Manifest: Embedded Transcription on Fragment Segment"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/45/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 45 Manifest: External text/plain Transcription on Canvas"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/46/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 46 Manifest: External text/plain Transcription on Segment"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/47/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 47 Manifest: Embedded HTML Transcription on Canvas"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/48/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 48 Manifest: Embedded HTML Transcription on Segment"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/51/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 51 Manifest: Embedded Comment on a Canvas"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/52/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 52 Manifest: Embedded Comment on a Segment"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/54/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 54 Manifest: Comment in HTML"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/61/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 61 Manifest: Embedded Transcription on Selector Segment"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/62/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
[
{
"@value"
:
"62: quelque titre"
,
"@language"
:
"fr"
},
{
"@value"
:
"62: some title"
,
"@language"
:
"en"
}
]
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/63/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 63 Manifest: Description in Multiple Languages"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/64/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 64 Manifest: Description in HTML"
},
{
"@id"
:
"http://iiif.io/api/presentation/2.1/example/fixtures/65/manifest.json"
,
"@type"
:
"sc:Manifest"
,
"label"
:
"Test 65 Manifest: Sequence with startCanvas"
}
]
}
This diff is collapsed.
Click to expand it.
__tests__/src/components/CollectionDialog.test.js
0 → 100644
+
44
−
0
View file @
9587281b
import
React
from
'
react
'
;
import
{
shallow
}
from
'
enzyme
'
;
import
Dialog
from
'
@material-ui/core/Dialog
'
;
import
DialogActions
from
'
@material-ui/core/DialogActions
'
;
import
Button
from
'
@material-ui/core/Button
'
;
import
MenuItem
from
'
@material-ui/core/MenuItem
'
;
import
Skeleton
from
'
@material-ui/lab/Skeleton
'
;
import
{
Utils
}
from
'
manifesto.js/dist-esmodule/Utils
'
;
import
{
CollectionDialog
}
from
'
../../../src/components/CollectionDialog
'
;
import
collection
from
'
../../fixtures/version-2/collection.json
'
;
/** */
function
createWrapper
(
props
)
{
const
manifest
=
Utils
.
parseManifest
(
props
.
manifest
?
props
.
manifest
:
collection
);
return
shallow
(
<
CollectionDialog
addWindow
=
{()
=>
{}}
classes
=
{{}}
ready
manifest
=
{
manifest
}
t
=
{(
key
)
=>
key
}
{...
props
}
/>
,
);
}
describe
(
'
CollectionDialog
'
,
()
=>
{
it
(
'
renders a dialog with collection menu items
'
,
()
=>
{
const
wrapper
=
createWrapper
({});
expect
(
wrapper
.
find
(
Dialog
).
length
).
toEqual
(
1
);
expect
(
wrapper
.
find
(
MenuItem
).
length
).
toEqual
(
55
);
expect
(
wrapper
.
find
(
MenuItem
).
first
().
text
()).
toEqual
(
'
Test 1 Manifest: Minimum Required Fields
'
);
});
it
(
'
when not ready returns placeholder skeleton
'
,
()
=>
{
const
wrapper
=
createWrapper
({
ready
:
false
});
expect
(
wrapper
.
find
(
Skeleton
).
length
).
toEqual
(
3
);
});
it
(
'
clicking the hide button fires hideCollectionDialog
'
,
()
=>
{
const
hideCollectionDialog
=
jest
.
fn
();
const
wrapper
=
createWrapper
({
hideCollectionDialog
});
expect
(
wrapper
.
find
(
DialogActions
).
find
(
Button
).
first
().
simulate
(
'
click
'
));
expect
(
hideCollectionDialog
).
toHaveBeenCalled
();
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment