refs #665 Add tests for new notification type

This commit is contained in:
AkiraFukushima 2021-03-01 22:16:39 +09:00
parent d155ed5783
commit 58b0c1ffb2
2 changed files with 17 additions and 0 deletions

View file

@ -106,6 +106,14 @@ const followRequest: MastodonEntity.Notification = {
type: MastodonNotificationType.FollowRequest
}
const toot: MastodonEntity.Notification = {
account: account,
created_at: '2021-01-31T23:33:26',
id: '7',
status: status,
type: MastodonNotificationType.Status
}
;(axios.CancelToken.source as any).mockImplementation(() => {
return {
token: 'cancelToken'
@ -144,6 +152,11 @@ describe('getNotifications', () => {
event: followRequest,
expected: MegalodonNotificationType.FollowRequest,
title: 'followRequest'
},
{
event: toot,
expected: MegalodonNotificationType.Status,
title: 'status'
}
]
cases.forEach(c => {

View file

@ -32,6 +32,10 @@ describe('api_client', () => {
{
src: MegalodonNotificationType.FollowRequest,
dist: MastodonNotificationType.FollowRequest
},
{
src: MegalodonNotificationType.Status,
dist: MastodonNotificationType.Status
}
]
cases.forEach(c => {