add none of that as expected value to test
Some checks failed
Compile the repository / compile (pull_request) Successful in 13s
Run unit tests / test (pull_request) Failing after 31s

This commit is contained in:
kenobi 2023-07-17 21:29:47 +02:00
parent e54f03292e
commit 146848b759

View File

@ -1,4 +1,4 @@
import { Emoji } from "../../server/constants" import { Emoji, NONE_OF_THAT } from "../../server/constants"
import VoteController, { Vote, VoteMessageInfo } from "../../server/helper/vote.controller" import VoteController, { Vote, VoteMessageInfo } from "../../server/helper/vote.controller"
import { JellyfinHandler } from "../../server/jellyfin/handler" import { JellyfinHandler } from "../../server/jellyfin/handler"
import { ExtendedClient } from "../../server/structures/client" import { ExtendedClient } from "../../server/structures/client"
@ -9,7 +9,7 @@ test('parse votes from vote message', () => {
'Movie2', 'Movie2',
'Movie3', 'Movie3',
'Movie4', 'Movie4',
'Movie5' 'Movie5',
] ]
const testEventId = '1234321' const testEventId = '1234321'
const testEventDate = new Date('2023-01-01') const testEventDate = new Date('2023-01-01')
@ -26,6 +26,7 @@ test('parse votes from vote message', () => {
{ emote: Emoji.three, count: 3, movie: testMovies[2] }, { emote: Emoji.three, count: 3, movie: testMovies[2] },
{ emote: Emoji.four, count: 1, movie: testMovies[3] }, { emote: Emoji.four, count: 1, movie: testMovies[3] },
{ emote: Emoji.five, count: 1, movie: testMovies[4] }, { emote: Emoji.five, count: 1, movie: testMovies[4] },
{ emote: NONE_OF_THAT, count: 1, movie: NONE_OF_THAT },
] ]
} }
@ -49,6 +50,6 @@ test('parse votes from vote message', () => {
expect(Array.isArray(result)).toBe(false) expect(Array.isArray(result)).toBe(false)
expect(result.eventId).toEqual(testEventId) expect(result.eventId).toEqual(testEventId)
expect(result.eventDate).toEqual(testEventDate) expect(result.eventDate).toEqual(testEventDate)
expect(result.votes.length).toEqual(testMovies.length) expect(result.votes.length).toEqual(expectedResult.votes.length)
expect(result).toEqual(expectedResult) expect(result).toEqual(expectedResult)
}) })