Skip to content

Commit

Permalink
fix errors and warnings when running unit tests (mattermost#2909)
Browse files Browse the repository at this point in the history
  • Loading branch information
saturninoabril committed Jun 6, 2019
1 parent 5dd2b25 commit 76601d4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ describe('components/ChannelSelectorModal', () => {
onChannelsSelected: jest.fn(),
groupID: '',
actions: {
loadChannels: jest.fn(() => Promise.resolve()),
loadChannels: jest.fn(() => Promise.resolve({})),
setModalSearchTerm: jest.fn(() => Promise.resolve()),
searchChannels: jest.fn(() => Promise.resolve()),
searchChannels: jest.fn(() => Promise.resolve({})),
},
};

Expand Down
2 changes: 1 addition & 1 deletion components/integrations/bots/bots.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Bots from './bots.jsx';
describe('components/integrations/bots/Bots', () => {
const team = TestHelper.fakeTeam();
const actions = {
loadBots: jest.fn().mockReturnValue(Promise.resolve()),
loadBots: jest.fn().mockReturnValue(Promise.resolve({})),
getUserAccessTokensForUser: jest.fn(),
createUserAccessToken: jest.fn(),
revokeUserAccessToken: jest.fn(),
Expand Down
6 changes: 3 additions & 3 deletions components/list_modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export default class ListModal extends React.PureComponent {

onPageChange = async (page) => {
this.setState({loading: true});
const items = await this.props.loadItems(page, this.state.searchTerm);
this.setState({page, items, loading: false});
const result = await this.props.loadItems(page, this.state.searchTerm);
this.setState({page, items: result.items, loading: false});
}

onSearchInput = async (event) => {
Expand Down Expand Up @@ -245,4 +245,4 @@ export default class ListModal extends React.PureComponent {
</div >
);
}
}
}
2 changes: 1 addition & 1 deletion components/permalink_view/permalink_view.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('components/PermalinkView', () => {
},
};

describe('focusPost', async () => {
describe('focusPost', () => {
test('should focus post in already loaded channel', async () => {
const testStore = await mockStore(initialState);
await testStore.dispatch(focusPost('postid1'));
Expand Down

0 comments on commit 76601d4

Please sign in to comment.