From 9306ba7ca52f84d84c025f0b0e84a2d98e2d8f46 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 4 Apr 2023 01:39:37 +0000 Subject: [PATCH] :v: --- packages/frontend/test/note.test.ts | 21 +++++++++++++++++++-- packages/frontend/test/url-preview.test.ts | 3 ++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/packages/frontend/test/note.test.ts b/packages/frontend/test/note.test.ts index f7c47ec100..bdb1a8281a 100644 --- a/packages/frontend/test/note.test.ts +++ b/packages/frontend/test/note.test.ts @@ -2,14 +2,31 @@ import { describe, test, assert, afterEach } from 'vitest'; import { render, cleanup, type RenderResult } from '@testing-library/vue'; import './init'; import type { DriveFile } from 'misskey-js/built/entities'; +import { components } from '@/components'; import { directives } from '@/directives'; import MkMediaImage from '@/components/MkMediaImage.vue'; describe('MkMediaImage', () => { const renderMediaImage = (image: Partial): RenderResult => { return render(MkMediaImage, { - props: { image }, - global: { directives }, + props: { + image: { + id: 'xxxxxxxx', + createdAt: (new Date()).toJSON(), + isSensitive: false, + name: 'example.png', + thumbnailUrl: null, + url: '', + type: 'application/octet-stream', + size: 1, + md5: '15eca7fba0480996e2245f5185bf39f2', + blurhash: null, + comment: null, + properties: {}, + ...image, + } as DriveFile, + }, + global: { directives, components }, }); }; diff --git a/packages/frontend/test/url-preview.test.ts b/packages/frontend/test/url-preview.test.ts index 205982a40a..4cb37e6584 100644 --- a/packages/frontend/test/url-preview.test.ts +++ b/packages/frontend/test/url-preview.test.ts @@ -2,6 +2,7 @@ import { describe, test, assert, afterEach } from 'vitest'; import { render, cleanup, type RenderResult } from '@testing-library/vue'; import './init'; import type { summaly } from 'summaly'; +import { components } from '@/components'; import { directives } from '@/directives'; import MkUrlPreview from '@/components/MkUrlPreview.vue'; @@ -27,7 +28,7 @@ describe('MkMediaImage', () => { const result = render(MkUrlPreview, { props: { url: summary.url }, - global: { directives }, + global: { directives, components }, }); await new Promise(resolve => {