フォームのバリデーションとニコ連携の画面変更 (#090) (#355)

Reviewed-on: #355
Co-authored-by: miteruzo <miteruzo@naver.com>
Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #355 でマージされました.
このコミットが含まれているのは:
2026-06-05 01:59:46 +09:00
committed by みてるぞ
コミット 750aa40e8e
66個のファイルの変更2624行の追加802行の削除
+20
ファイルの表示
@@ -0,0 +1,20 @@
import { describe, expect, it } from 'vitest'
import { canEditContent } from '@/lib/users'
import type { UserRole } from '@/types'
const userWithRole = (role: UserRole) => ({ role })
describe ('user permission helpers', () => {
it ('allows admins and members to edit content', () => {
expect (canEditContent (userWithRole ('admin'))).toBe (true)
expect (canEditContent (userWithRole ('member'))).toBe (true)
})
it ('does not allow guests or missing users to edit content', () => {
expect (canEditContent (userWithRole ('guest'))).toBe (false)
expect (canEditContent (null)).toBe (false)
expect (canEditContent (undefined)).toBe (false)
})
})