Skip to content

Commit

Permalink
Fix tests, changes for new router mainly, others due to use the lates…
Browse files Browse the repository at this point in the history
…t semanticUI that removes cruft from tests on undefined props
  • Loading branch information
sneridagh authored and robgietema committed Oct 3, 2018
1 parent fc04bcb commit ffd6f99
Show file tree
Hide file tree
Showing 74 changed files with 269 additions and 577 deletions.
5 changes: 4 additions & 1 deletion src/components/manage/Actions/Actions.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
import MemoryRouter from 'react-router-dom/MemoryRouter';

import Actions from './Actions';

Expand Down Expand Up @@ -122,7 +123,9 @@ describe('Actions', () => {
});
const component = renderer.create(
<Provider store={store}>
<Actions pathname="/test" />
<MemoryRouter>
<Actions pathname="/test" />
</MemoryRouter>
</Provider>,
);
const json = component.toJSON();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

exports[`Actions renders an actions component 1`] = `
<div
aria-busy={undefined}
aria-disabled={undefined}
aria-expanded={false}
aria-multiselectable={undefined}
className="ui item dropdown"
id="toolbar-actions"
onBlur={[Function]}
Expand Down Expand Up @@ -35,9 +32,6 @@ exports[`Actions renders an actions component 1`] = `
className="menu transition"
>
<div
aria-checked={undefined}
aria-disabled={undefined}
aria-selected={undefined}
className="item"
onClick={[Function]}
role="option"
Expand All @@ -53,9 +47,6 @@ exports[`Actions renders an actions component 1`] = `
</span>
</div>
<div
aria-checked={undefined}
aria-disabled={undefined}
aria-selected={undefined}
className="item"
onClick={[Function]}
role="option"
Expand All @@ -72,8 +63,8 @@ exports[`Actions renders an actions component 1`] = `
</div>
<a
className="item"
href="/test/delete"
onClick={[Function]}
style={Object {}}
>
<i
aria-hidden="true"
Expand All @@ -82,9 +73,6 @@ exports[`Actions renders an actions component 1`] = `
Delete
</a>
<div
aria-checked={undefined}
aria-disabled={undefined}
aria-selected={undefined}
className="item"
onClick={[Function]}
role="option"
Expand Down
5 changes: 4 additions & 1 deletion src/components/manage/Contents/Contents.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
import MemoryRouter from 'react-router-dom/MemoryRouter';

import Contents from './Contents';

Expand Down Expand Up @@ -74,7 +75,9 @@ describe('Contents', () => {
});
const component = renderer.create(
<Provider store={store}>
<Contents location={{ pathname: '/blog' }} />
<MemoryRouter>
<Contents location={{ pathname: '/blog' }} />
</MemoryRouter>
</Provider>,
);
const json = component.toJSON();
Expand Down
57 changes: 30 additions & 27 deletions src/components/manage/Contents/ContentsItem.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
import MemoryRouter from 'react-router-dom/MemoryRouter';

import { ContentsItemComponent as ContentsItem } from './ContentsItem';

Expand All @@ -17,33 +18,35 @@ describe('ContentsItem', () => {
});
const component = renderer.create(
<Provider store={store}>
<ContentsItem
item={{
'@id': '/blog',
title: 'Blog',
is_folderish: false,
'@type': 'Document',
}}
selected={false}
onClick={() => {}}
indexes={[
{
id: 'title',
type: 'string',
},
]}
onCut={() => {}}
onCopy={() => {}}
onDelete={() => {}}
onMoveToTop={() => {}}
onMoveToBottom={() => {}}
onOrderItem={() => {}}
connectDragSource={x => x}
connectDragPreview={x => x}
connectDropTarget={x => x}
order={1}
isDragging={false}
/>
<MemoryRouter>
<ContentsItem
item={{
'@id': '/blog',
title: 'Blog',
is_folderish: false,
'@type': 'Document',
}}
selected={false}
onClick={() => {}}
indexes={[
{
id: 'title',
type: 'string',
},
]}
onCut={() => {}}
onCopy={() => {}}
onDelete={() => {}}
onMoveToTop={() => {}}
onMoveToBottom={() => {}}
onOrderItem={() => {}}
connectDragSource={x => x}
connectDragPreview={x => x}
connectDropTarget={x => x}
order={1}
isDragging={false}
/>
</MemoryRouter>
</Provider>,
);
const json = component.toJSON();
Expand Down
5 changes: 4 additions & 1 deletion src/components/manage/Contents/ContentsToolbar.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import renderer from 'react-test-renderer';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-intl-redux';
import MemoryRouter from 'react-router-dom/MemoryRouter';

import ContentsToolbar from './ContentsToolbar';

Expand All @@ -17,7 +18,9 @@ describe('ContentsToolbar', () => {
});
const component = renderer.create(
<Provider store={store}>
<ContentsToolbar location={{ pathname: '/blog' }} />
<MemoryRouter>
<ContentsToolbar location={{ pathname: '/blog' }} />
</MemoryRouter>
</Provider>,
);
const json = component.toJSON();
Expand Down
Loading

0 comments on commit ffd6f99

Please sign in to comment.