Skip to content

Commit

Permalink
feat(jest): 100% coverage for utilities/chat (#4495)
Browse files Browse the repository at this point in the history
  • Loading branch information
drepram committed Aug 29, 2022
1 parent 1913e23 commit c202524
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions utilities/chat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,4 +211,38 @@ describe('chat.conversationMessageIsNotice', () => {
})
expect(result).toMatchSnapshot()
})

it('returns true for member_join type', () => {
const result: any = chat.conversationMessageIsNotice({
id: '',
conversationId: '',
from: '',
type: 'member_join',
at: NaN,
body: undefined,
glyph: undefined,
attachments: [],
reactions: { key0: [], key2: [], key1: [] },
replyToId: undefined,
members: undefined,
})
expect(result).toBeTruthy()
})

it('returns true for member_join type', () => {
const result: any = chat.conversationMessageIsNotice({
id: '',
conversationId: '',
from: '',
type: 'member_leave',
at: NaN,
body: undefined,
glyph: undefined,
attachments: [],
reactions: { key0: [], key2: [], key1: [] },
replyToId: undefined,
members: undefined,
})
expect(result).toBeTruthy()
})
})

0 comments on commit c202524

Please sign in to comment.