feat/40-reroll-on-disinterest #54

Merged
kenobi merged 73 commits from feat/40-reroll-on-disinterest into master 2023-11-19 20:24:36 +01:00
Showing only changes of commit a2adef808f - Show all commits

View File

@ -3,7 +3,7 @@ import VoteController, { Vote, VoteMessageInfo } from "../../server/helper/vote.
import { JellyfinHandler } from "../../server/jellyfin/handler"
import { ExtendedClient } from "../../server/structures/client"
import { VoteMessage } from "../../server/helper/messageIdentifiers"
test('parse votes from vote message', () => {
test('parse votes from vote message', async () => {
const testMovies = [
'Movie1',
'Movie2',
@ -33,6 +33,17 @@ test('parse votes from vote message', () => {
const msg: VoteMessage = <VoteMessage><unknown>{
cleanContent: testMessage,
guild:{
id:testGuildId,
scheduledEvents:{
fetch: jest.fn().mockImplementation((input:any)=>{
if(input === testEventId)
return {
scheduledStartAt: testEventDate
}
})
}
},
reactions: {
cache: {
get: jest.fn().mockImplementation((input: any) => {
@ -46,7 +57,7 @@ test('parse votes from vote message', () => {
}
}
const result = voteController.parseVotesFromVoteMessage(msg, 'requestId')
const result = await voteController.parseVoteInfoFromVoteMessage(msg, 'requestId')
console.log(JSON.stringify(result))
expect(Array.isArray(result)).toBe(false)
expect(result.eventId).toEqual(testEventId)