Skip to content

Commit

Permalink
Merge pull request #239 from labzero/bugfix/fix-test-warnings
Browse files Browse the repository at this point in the history
Fix test warnings
  • Loading branch information
JeffreyATW authored Mar 1, 2019
2 parents a84f12b + 71b1d61 commit ec39a44
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
21 changes: 18 additions & 3 deletions src/components/AddUserForm/AddUserForm.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,31 @@
import React from 'react';
import { expect } from 'chai';
import { shallow } from 'enzyme';
import AddUserForm from './AddUserForm';
import proxyquire from 'proxyquire';
import PropTypes from 'prop-types';

const proxyquireStrict = proxyquire.noCallThru();

const AddUserForm = proxyquireStrict('./AddUserForm', {
'react-intl': {
intlShape: {
isRequired: PropTypes.shape().isRequired,
},
}
}).default;

describe('AddUserForm', () => {
let props;

beforeEach(() => {
props = {
addUserToTeam: () => {},
hasGuestRole: false,
hasMemberRole: false,
hasOwnerRole: false,
intl: {
formatMessage: () => {}
}
formatMessage: () => {},
},
};
});

Expand Down
6 changes: 3 additions & 3 deletions src/components/Layout/Layout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ describe('Layout', () => {

beforeEach(() => {
props = {
children: <div className="child" />,
confirmShown: false,
shouldScrollToTop: false,
scrolledToTop: () => {}
};
});

it('renders children correctly', () => {
const wrapper = shallow(
<Layout {...props}>
<div className="child" />
</Layout>,
<Layout {...props} />,
{ context }
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ describe('RestaurantAddTagForm', () => {

beforeEach(() => {
props = {
addedTags: [],
addNewTagToRestaurant: sinon.mock(),
handleSuggestionSelected: sinon.mock(),
autosuggestValue: '',
addTagToRestaurant: () => {},
hideAddTagForm: () => {},
tags: []
};
});
Expand Down
1 change: 1 addition & 0 deletions src/routes/team/home/Home.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ describe('Home', () => {
invalidateTags,
invalidateUsers,
messageReceived: () => {},
pastDecisionsShown: false,
user: {},
wsPort: 3000
};
Expand Down

0 comments on commit ec39a44

Please sign in to comment.