actions/accounts: remove n/a test
This commit is contained in:
parent
1aef2eaf22
commit
53cb5f723b
|
@ -148,34 +148,24 @@ describe('fetchAccountByUsername()', () => {
|
||||||
const username = 'tiger';
|
const username = 'tiger';
|
||||||
let state, account;
|
let state, account;
|
||||||
|
|
||||||
describe('when the account has already been cached in redux', () => {
|
beforeEach(() => {
|
||||||
beforeEach(() => {
|
account = normalizeAccount({
|
||||||
account = normalizeAccount({
|
id,
|
||||||
id,
|
acct: username,
|
||||||
acct: username,
|
display_name: 'Tiger',
|
||||||
display_name: 'Tiger',
|
avatar: 'test.jpg',
|
||||||
avatar: 'test.jpg',
|
birthday: undefined,
|
||||||
birthday: undefined,
|
|
||||||
});
|
|
||||||
|
|
||||||
state = rootReducer(undefined, {})
|
|
||||||
.set('accounts', ImmutableMap({
|
|
||||||
[id]: account,
|
|
||||||
}));
|
|
||||||
|
|
||||||
store = mockStore(state);
|
|
||||||
|
|
||||||
__stub((mock) => {
|
|
||||||
mock.onGet(`/api/v1/accounts/${id}`).reply(200, account);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return null', async() => {
|
state = rootReducer(undefined, {})
|
||||||
const result = await store.dispatch(fetchAccountByUsername(username));
|
.set('accounts', ImmutableMap({
|
||||||
const actions = store.getActions();
|
[id]: account,
|
||||||
|
}));
|
||||||
|
|
||||||
expect(actions).toEqual([]);
|
store = mockStore(state);
|
||||||
expect(result).toBeNull();
|
|
||||||
|
__stub((mock) => {
|
||||||
|
mock.onGet(`/api/v1/accounts/${id}`).reply(200, account);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue