Fix flakey viewStory test

This commit is contained in:
Josh Perez 2022-10-25 18:23:24 -04:00 committed by GitHub
parent 3702a67975
commit 0308f208d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -758,10 +758,11 @@ describe('both/state/ducks/stories', () => {
describe('paging through collections of stories', () => {
function getViewedStoryData(
storyId: string,
conversationId?: UUIDStringType
conversationId?: UUIDStringType,
timestampDelta = 0
): StoryDataType {
return {
...getStoryData(storyId, conversationId),
...getStoryData(storyId, conversationId, timestampDelta),
readStatus: ReadStatus.Viewed,
};
}
@ -774,9 +775,9 @@ describe('both/state/ducks/stories', () => {
const conversationId1 = UUID.generate().toString();
const getState = getStateFunction(
[
getViewedStoryData(storyId1, conversationId1),
getViewedStoryData(storyId2, conversationId2),
getViewedStoryData(storyId3, conversationId2),
getViewedStoryData(storyId1, conversationId1, 0),
getViewedStoryData(storyId2, conversationId2, 1),
getViewedStoryData(storyId3, conversationId2, 2),
],
{
[conversationId1]: getMockConversation({ id: conversationId1 }),