Skip to content

Commit

Permalink
accountsReducer: Remove confusing test.
Browse files Browse the repository at this point in the history
With Flow v0.113.0, which we'll get in the RN v0.61 -> v0.62 upgrade
(zulip#3782), red flags are raised about this test. Strangely, the test
was allowed to expect the `zulipVersion` on an Account to be
undefined. In fact, the type for it is `ZulipVersion | null`.

The test is based on the false premise that a REALM_INIT action
might not have a `zulipVersion` property. `RealmInitAction` states
that it will always be there, as a ZulipVersion instance. So, delete
the test. If we ever find that there's a legitimate case where it is
missing, we'll fix the RealmInitAction type accordingly, and a new
test can proceed from there.
  • Loading branch information
chrisbobbe committed Jul 20, 2020
1 parent 52aa82f commit 7f5dcbd
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/account/__tests__/accountsReducer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,6 @@ describe('accountsReducer', () => {
expect(newState).toEqual(expectedState);
expect(newState).not.toBe(prevState);
});

test('records undefined for zulipVersion on active account if not present in action', () => {
const prevState = deepFreeze([account1, account2, account3]);
const action = deepFreeze({
...eg.action.realm_init,
zulipVersion: undefined,
});

const expectedState = [{ ...account1, zulipVersion: undefined }, account2, account3];

const newState = accountsReducer(prevState, action);

expect(newState).toEqual(expectedState);
expect(newState).not.toBe(prevState);
});
});

describe('ACCOUNT_SWITCH', () => {
Expand Down

0 comments on commit 7f5dcbd

Please sign in to comment.