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
a928a94a
Commit
a928a94a
authored
Sep 26, 2018
by
Shaun Ellis
Committed by
Jack Reed
Oct 3, 2018
Browse files
Options
Downloads
Patches
Plain Diff
WIP - begins to add tests for issue #41
parent
606d7033
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
__tests__/src/components/Workspace.test.js
+20
-0
20 additions, 0 deletions
__tests__/src/components/Workspace.test.js
src/components/App.js
+2
-0
2 additions, 0 deletions
src/components/App.js
src/components/Workspace.js
+45
-0
45 additions, 0 deletions
src/components/Workspace.js
with
67 additions
and
0 deletions
__tests__/src/components/Workspace.test.js
0 → 100644
+
20
−
0
View file @
a928a94a
import
React
from
'
react
'
;
import
{
shallow
}
from
'
enzyme
'
;
import
{
store
}
from
'
../../../src/store
'
;
import
Workspace
from
'
../../../src/components/Workspace
'
;
describe
(
'
Workspace
'
,
()
=>
{
it
(
'
renders without an error
'
,
()
=>
{
const
wrapper
=
shallow
(
<
Workspace
store
=
{
store
}
/>
)
.dive
()
;
expect
(
wrapper
.
find
(
'
div.mirador-workspace
'
).
length
).
toBe
(
1
);
expect
(
wrapper
.
find
(
'
div.window
'
).
length
).
toBe
(
0
);
// expect(wrapper.find('button').length).toBe(1);
// expect(wrapper.find('button').text()).toEqual('http://example.com');
});
// it('updates and adds window div when window is added to store', () => {
// const wrapper = shallow(<Workspace store={store} />).dive();
// expect(store.getState().windows.length).toEqual(0);
// wrapper.find('button').simulate('click');
// expect(store.getState().windows.length).toEqual(1);
// });
});
This diff is collapsed.
Click to expand it.
src/components/App.js
+
2
−
0
View file @
a928a94a
...
@@ -5,6 +5,7 @@ import { actions } from '../store';
...
@@ -5,6 +5,7 @@ import { actions } from '../store';
import
Display
from
'
./Display
'
;
import
Display
from
'
./Display
'
;
import
ManifestForm
from
'
./ManifestForm
'
;
import
ManifestForm
from
'
./ManifestForm
'
;
import
ManifestListItem
from
'
./ManifestListItem
'
;
import
ManifestListItem
from
'
./ManifestListItem
'
;
import
Workspace
from
'
./Workspace
'
;
/**
/**
* This is the top level Mirador component.
* This is the top level Mirador component.
...
@@ -72,6 +73,7 @@ class App extends Component {
...
@@ -72,6 +73,7 @@ class App extends Component {
<
Display
<
Display
manifest
=
{
this
.
props
.
manifests
[
this
.
state
.
lastRequested
]}
manifest
=
{
this
.
props
.
manifests
[
this
.
state
.
lastRequested
]}
/
>
/
>
<
Workspace
/>
<
/div
>
<
/div
>
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/components/Workspace.js
0 → 100644
+
45
−
0
View file @
a928a94a
import
React
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
PropTypes
from
'
prop-types
'
;
// import { actions } from '../store';
// import Window from './Window';
/**
* Represents a work area that contains any number of windows
* @memberof Workspace
* @private
*/
const
Workspace
=
({
windows
})
=>
(
// const Workspace = ({ windows, manifests }) => (
<
div
className
=
"
mirador-workspace
"
>
{
windows
.
map
(
window
=>
(
<
div
className
=
"
window
"
key
=
{
window
.
id
}
>
{
window
.
id
}
<
/div
>
// <Window
// key={window.id}
// windowId={window.id}
// manifest={manifests[window.manifestId]}
// />
))
}
<
/div
>
);
Workspace
.
propTypes
=
{
windows
:
PropTypes
.
instanceOf
(
Array
).
isRequired
,
// manifests: PropTypes.instanceOf(Array),
};
/**
* mapStateToProps - to hook up connect
* @memberof Workspace
* @private
*/
const
mapStateToProps
=
state
=>
(
{
windows
:
state
.
windows
,
// manifests: state.manifests
}
);
// const mapDispatchToProps = dispatch => ({});
export
default
connect
(
mapStateToProps
)(
Workspace
);
// mapDispatchToProps,
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