Reviewed-on: #357 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #357 でマージされました.
このコミットが含まれているのは:
@@ -1,4 +1,13 @@
|
||||
import type { Material, Post, Tag, User, WikiPage } from '@/types'
|
||||
import type { Material,
|
||||
Post,
|
||||
Tag,
|
||||
Theatre,
|
||||
TheatreComment,
|
||||
TheatreInfo,
|
||||
TheatrePostSelectionWeights,
|
||||
TheatreProgramme,
|
||||
User,
|
||||
WikiPage } from '@/types'
|
||||
|
||||
export const buildTag = (overrides: Partial<Tag> = {}): Tag => ({
|
||||
id: 1,
|
||||
@@ -72,3 +81,62 @@ export const buildMaterial = (overrides: Partial<Material> = {}): Material => ({
|
||||
updatedByUser: { id: 2, name: 'updater' },
|
||||
...overrides,
|
||||
})
|
||||
|
||||
export const buildTheatre = (overrides: Partial<Theatre> = {}): Theatre => ({
|
||||
id: 1,
|
||||
name: 'テスト劇場',
|
||||
opensAt: '2026-01-02T03:04:05.000Z',
|
||||
closesAt: null,
|
||||
createdByUser: { id: 1, name: 'creator' },
|
||||
createdAt: '2026-01-02T03:04:05.000Z',
|
||||
updatedAt: '2026-01-03T03:04:05.000Z',
|
||||
...overrides,
|
||||
})
|
||||
|
||||
export const buildTheatreInfo = (
|
||||
overrides: Partial<TheatreInfo> = {},
|
||||
): TheatreInfo => ({
|
||||
hostFlg: false,
|
||||
postId: null,
|
||||
postStartedAt: null,
|
||||
postElapsedMs: null,
|
||||
watchingUsers: [],
|
||||
skipVote: {
|
||||
votesCount: 0,
|
||||
requiredCount: 1,
|
||||
watchingUsersCount: 0,
|
||||
voted: false,
|
||||
},
|
||||
...overrides,
|
||||
})
|
||||
|
||||
export const buildTheatreComment = (
|
||||
overrides: Partial<TheatreComment> = {},
|
||||
): TheatreComment => ({
|
||||
theatreId: 1,
|
||||
no: 1,
|
||||
deleted: false,
|
||||
user: { id: 1, name: 'tester' },
|
||||
content: 'テストコメント',
|
||||
createdAt: '2026-01-02T03:04:05.000Z',
|
||||
...overrides,
|
||||
} as TheatreComment)
|
||||
|
||||
export const buildTheatreProgramme = (
|
||||
overrides: Partial<TheatreProgramme> = {},
|
||||
): TheatreProgramme => ({
|
||||
theatreId: 1,
|
||||
position: 1,
|
||||
post: buildPost (),
|
||||
createdAt: '2026-01-02T03:04:05.000Z',
|
||||
...overrides,
|
||||
})
|
||||
|
||||
export const buildTheatrePostSelectionWeights = (
|
||||
overrides: Partial<TheatrePostSelectionWeights> = {},
|
||||
): TheatrePostSelectionWeights => ({
|
||||
tagPenalties: [],
|
||||
lightestPosts: [],
|
||||
heaviestPosts: [],
|
||||
...overrides,
|
||||
})
|
||||
|
||||
新しい課題から参照
ユーザをブロックする