0a35e63897
* update deps * add guilds page * improve karma conf, add tests for actions
17 lines
473 B
JavaScript
17 lines
473 B
JavaScript
import { fetchAll as fetchAllGuilds } from 'client/store/actions/guilds';
|
|
import axios from 'axios';
|
|
import store from 'client/store';
|
|
|
|
describe('guilds actions', () => {
|
|
it('fetchAll', async () => {
|
|
const guilds = [{_id: 1}];
|
|
sandbox
|
|
.stub(axios, 'get')
|
|
.withArgs('/api/v3/groups?type=publicGuilds')
|
|
.returns(Promise.resolve({data: {data: guilds}}));
|
|
|
|
await fetchAllGuilds(store);
|
|
|
|
expect(store.state.guilds).to.equal(guilds);
|
|
});
|
|
}); |