Files
habitica/test/client/unit/specs/store/actions/user.js
T
Matteo Pagliazzi 0a35e63897 Client: Guild page and mix changes (#8533)
* update deps

* add guilds page

* improve karma conf, add tests for actions
2017-03-05 19:07:48 +01:00

14 lines
402 B
JavaScript

import { fetch as fetchUser } from 'client/store/actions/user';
import axios from 'axios';
import store from 'client/store';
describe('user actions', () => {
it('fetch', async () => {
const user = {_id: 1};
sandbox.stub(axios, 'get').withArgs('/api/v3/user').returns(Promise.resolve({data: {data: user}}));
await fetchUser(store);
expect(store.state.user).to.equal(user);
});
});