Skip to content
Snippets Groups Projects
Commit 023b563f authored by Andrew Winget (Standard)'s avatar Andrew Winget (Standard)
Browse files

start fixing existing tests

parent 9e2405ff
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,10 @@ describe('window actions', () => { ...@@ -18,7 +18,10 @@ describe('window actions', () => {
manifestId: null, manifestId: null,
rangeId: null, rangeId: null,
thumbnailNavigationPosition: 'bottom', thumbnailNavigationPosition: 'bottom',
xywh: [0, 0, 400, 400], x: 2700,
y: 2700,
width: 400,
height: 400,
rotation: null, rotation: null,
view: 'single', view: 'single',
}, },
......
...@@ -6,7 +6,13 @@ import WindowMiddleContent from '../../../src/containers/WindowMiddleContent'; ...@@ -6,7 +6,13 @@ import WindowMiddleContent from '../../../src/containers/WindowMiddleContent';
describe('Window', () => { describe('Window', () => {
let wrapper; let wrapper;
const window = { id: 123, xywh: [0, 0, 400, 500] }; const window = {
id: 123,
x: 2700,
y: 2700,
width: 400,
height: 400,
};
it('should render outer element', () => { it('should render outer element', () => {
wrapper = shallow(<Window window={window} />); wrapper = shallow(<Window window={window} />);
expect(wrapper.find('.mirador-window')).toHaveLength(1); expect(wrapper.find('.mirador-window')).toHaveLength(1);
......
...@@ -27,7 +27,7 @@ describe('Workspace', () => { ...@@ -27,7 +27,7 @@ describe('Workspace', () => {
const wrapper = createWrapper(); const wrapper = createWrapper();
expect(wrapper.matchesElement( expect(wrapper.matchesElement(
<div className="mirador-workspace mirador-workspace-with-control-panel"> <div className="mirador-workspace-viewport mirador-workspace-with-control-panel">
<WorkspaceMosaic windows={windows} /> <WorkspaceMosaic windows={windows} />
</div>, </div>,
)).toBe(true); )).toBe(true);
...@@ -38,7 +38,7 @@ describe('Workspace', () => { ...@@ -38,7 +38,7 @@ describe('Workspace', () => {
const wrapper = createWrapper({ workspaceType: 'bubu' }); const wrapper = createWrapper({ workspaceType: 'bubu' });
expect(wrapper.matchesElement( expect(wrapper.matchesElement(
<div className="mirador-workspace mirador-workspace-with-control-panel"> <div className="mirador-workspace-viewport mirador-workspace-with-control-panel">
<Window window={{ id: 1 }} /> <Window window={{ id: 1 }} />
<Window window={{ id: 2 }} /> <Window window={{ id: 2 }} />
</div>, </div>,
......
...@@ -88,13 +88,16 @@ class Window extends Component { ...@@ -88,13 +88,16 @@ class Window extends Component {
Window.propTypes = { Window.propTypes = {
window: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types window: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
manifest: PropTypes.object, // eslint-disable-line react/forbid-prop-types manifest: PropTypes.object, // eslint-disable-line react/forbid-prop-types
updateWindowPosition: PropTypes.func.isRequired, updateWindowPosition: PropTypes.func,
setWindowSize: PropTypes.func.isRequired, setWindowSize: PropTypes.func,
workspaceType: PropTypes.string.isRequired, workspaceType: PropTypes.string,
}; };
Window.defaultProps = { Window.defaultProps = {
manifest: null, manifest: null,
updateWindowPosition: () => {},
setWindowSize: () => {},
workspaceType: '',
}; };
export default Window; export default Window;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment