actions/accounts: remove n/a test

This commit is contained in:
Alex Gleason 2022-06-08 16:18:51 -05:00
parent 1aef2eaf22
commit 53cb5f723b
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 15 additions and 25 deletions

View File

@ -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);
}); });
}); });