Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MikuroXina committed Feb 3, 2023
1 parent 42f5a4f commit 71c482f
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/service/emoji-log.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { expect, it, vi } from 'vitest';

import type { Snowflake } from '../model/id.js';
import { EmojiLog } from './emoji-log.js';

it('create emoji', async () => {
const sendEmbed = vi.fn(() => Promise.resolve());
const responder = new EmojiLog({ sendEmbed });
await responder.on('CREATE', {
emoji: '<:kawaehand:903283802443501618>',
emojiAuthorId: '586824421470109716'
emojiAuthorId: '586824421470109716' as Snowflake
});

expect(sendEmbed).toHaveBeenCalledWith({
Expand All @@ -16,17 +17,3 @@ it('create emoji', async () => {
'<@586824421470109716> が <:kawaehand:903283802443501618> を作成しました'
});
});

it('create emoji(author undefined)', async () => {
const sendEmbed = vi.fn(() => Promise.resolve());
const responder = new EmojiLog({ sendEmbed });
await responder.on('CREATE', {
emoji: '<:kawaehand:903283802443501618>',
emojiAuthorId: undefined
});

expect(sendEmbed).toHaveBeenCalledWith({
title: '絵文字警察',
description: '誰かが <:kawaehand:903283802443501618> を作成しました'
});
});

0 comments on commit 71c482f

Please sign in to comment.