mirror of
https://github.com/saltbo/zpan.git
synced 2026-08-30 17:50:07 +08:00
364cbc2aee
Enforce signup gating via auth_signup_mode system option (open/invite_only/closed). Invite codes are atomically redeemed during signup. Email verification is conditionally enabled when an email provider is configured. Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f Co-authored-by: Bob <aibob@mails.agent-kanban.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
43 lines
1.2 KiB
TypeScript
43 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { DirType, ObjectStatus, SignupMode, StorageMode, UserRole } from './constants.js'
|
|
|
|
describe('constants', () => {
|
|
it('StorageMode values', () => {
|
|
expect(StorageMode.PRIVATE).toBe('private')
|
|
expect(StorageMode.PUBLIC).toBe('public')
|
|
})
|
|
|
|
it('UserRole values', () => {
|
|
expect(UserRole.ADMIN).toBe('admin')
|
|
expect(UserRole.MEMBER).toBe('member')
|
|
})
|
|
|
|
it('DirType values', () => {
|
|
expect(DirType.FILE).toBe(0)
|
|
expect(DirType.USER_FOLDER).toBe(1)
|
|
expect(DirType.SYSTEM_FOLDER).toBe(2)
|
|
})
|
|
|
|
it('ObjectStatus values', () => {
|
|
expect(ObjectStatus.DRAFT).toBe('draft')
|
|
expect(ObjectStatus.ACTIVE).toBe('active')
|
|
expect(ObjectStatus.TRASHED).toBe('trashed')
|
|
})
|
|
|
|
it('SignupMode.OPEN equals "open"', () => {
|
|
expect(SignupMode.OPEN).toBe('open')
|
|
})
|
|
|
|
it('SignupMode.INVITE_ONLY equals "invite_only"', () => {
|
|
expect(SignupMode.INVITE_ONLY).toBe('invite_only')
|
|
})
|
|
|
|
it('SignupMode.CLOSED equals "closed"', () => {
|
|
expect(SignupMode.CLOSED).toBe('closed')
|
|
})
|
|
|
|
it('SignupMode has exactly three members', () => {
|
|
expect(Object.keys(SignupMode)).toHaveLength(3)
|
|
})
|
|
})
|