Skip to content

Commit f5e18d1

Browse files
CopilotStarefossen
andcommitted
Add tests for prerequisites field validation
Co-authored-by: Starefossen <968267+Starefossen@users.noreply.github.com>
1 parent ef979cb commit f5e18d1

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

__tests__/lib/proposal/schemas.test.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,25 @@ describe('ProposalInputSchema (strict)', () => {
132132
expect(result.success).toBe(true)
133133
})
134134

135+
it('accepts workshop format with prerequisites', () => {
136+
const result = ProposalInputSchema.safeParse({
137+
...fullProposal,
138+
format: Format.workshop_120,
139+
capacity: 30,
140+
prerequisites: 'Bring a computer with Docker installed',
141+
})
142+
expect(result.success).toBe(true)
143+
})
144+
145+
it('accepts non-workshop format without prerequisites', () => {
146+
const result = ProposalInputSchema.safeParse({
147+
...fullProposal,
148+
format: Format.presentation_40,
149+
prerequisites: undefined,
150+
})
151+
expect(result.success).toBe(true)
152+
})
153+
135154
it('rejects missing title', () => {
136155
const { title: _, ...withoutTitle } = fullProposal
137156
const result = ProposalInputSchema.safeParse(withoutTitle)

0 commit comments

Comments
 (0)