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
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
ff4b29f4
Commit
ff4b29f4
authored
6 years ago
by
Jack Reed
Browse files
Options
Downloads
Patches
Plain Diff
fixes a bug where nextCanvas button wasnt getting disabled appropriately
parent
5a615f1b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
__tests__/src/components/ViewerNavigation.test.js
+13
-1
13 additions, 1 deletion
__tests__/src/components/ViewerNavigation.test.js
src/components/ViewerNavigation.js
+1
-1
1 addition, 1 deletion
src/components/ViewerNavigation.js
with
14 additions
and
2 deletions
__tests__/src/components/ViewerNavigation.test.js
+
13
−
1
View file @
ff4b29f4
...
...
@@ -27,6 +27,18 @@ describe('ViewerNavigation', () => {
expect
(
setCanvas
).
toHaveBeenCalledWith
(
'
foo
'
,
1
);
});
});
describe
(
'
when next canvases are not present
'
,
()
=>
{
it
(
'
nextCanvas button is disabled
'
,
()
=>
{
const
endWrapper
=
shallow
(
<
ViewerNavigation
canvases
=
{[
1
,
2
]}
setCanvas
=
{()
=>
{}}
window
=
{{
id
:
'
foo
'
,
canvasIndex
:
1
}}
/>
,
);
expect
(
endWrapper
.
find
(
'
.mirador-next-canvas-button
'
).
prop
(
'
disabled
'
)).
toBe
(
true
);
});
});
describe
(
'
when previous canvases are not present
'
,
()
=>
{
it
(
'
disabled on previousCanvas button
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.mirador-previous-canvas-button
'
).
prop
(
'
disabled
'
)).
toBe
(
true
);
...
...
@@ -40,7 +52,7 @@ describe('ViewerNavigation', () => {
it
(
'
setCanvas function is called after click for next
'
,
()
=>
{
wrapper
=
shallow
(
<
ViewerNavigation
canvases
=
{[
1
,
2
]}
canvases
=
{[
1
,
2
,
3
]}
setCanvas
=
{
setCanvas
}
window
=
{{
id
:
'
foo
'
,
canvasIndex
:
0
,
view
:
'
book
'
}}
/>
,
...
...
This diff is collapsed.
Click to expand it.
src/components/ViewerNavigation.js
+
1
−
1
View file @
ff4b29f4
...
...
@@ -29,7 +29,7 @@ export class ViewerNavigation extends Component {
*/
hasNextCanvas
()
{
const
{
window
,
canvases
}
=
this
.
props
;
return
window
.
canvasIndex
<
=
canvases
.
length
-
this
.
canvasIncrementor
();
return
window
.
canvasIndex
<
canvases
.
length
-
this
.
canvasIncrementor
();
}
/**
...
...
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