Skip to content

Commit

Permalink
presence model tests: Remove one that expects fallback we don't need
Browse files Browse the repository at this point in the history
We removed the explicit fallback code this was testing in b945442.
As it turns out, the way we use Immutable.Map (new in that commit's
same PR) effectively handles the ancient-server behavior as well as
the explicit fallback was, and so this test still passes. But that's
incidental and not something we need to guarantee.
  • Loading branch information
chrisbobbe committed Mar 30, 2023
1 parent 4a22417 commit dbfe7fc
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/presence/__tests__/presenceModel-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,28 +224,6 @@ describe('presenceReducer', () => {
const expectedState = makePresenceState([[user, userPresence]]);
expect(presenceReducer(prevState, action)).toEqual(expectedState);
});

// TODO(#5102): Delete; see comment on implementation.
test('when no `presence` data is given reset state', () => {
const user = eg.otherUser;
const userPresence = {
aggregated: { client: 'website', status: 'active', timestamp: 123 },
website: { client: 'website', status: 'active', timestamp: 123 },
};
const prevState = makePresenceState([[user, userPresence]]);
const action = eg.mkActionRegisterComplete({
// Hmm, we should need a Flow suppression here. This property is
// marked required in InitialData, and this explicit undefined is
// meant to defy that; see TODO(#5102) above.
// mkActionRegisterComplete is designed to accept input with this or
// any property *omitted*… and I think, as a side effect of handling
// that, Flow mistakenly accepts an explicit undefined here, so it
// doesn't catch the resulting malformed InitialData.
presences: undefined,
});
const expectedState = makePresenceState([]);
expect(presenceReducer(prevState, action)).toEqual(expectedState);
});
});

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

0 comments on commit dbfe7fc

Please sign in to comment.