feat(signup): community guidelines agreement and policies routes
Introduces /community-guidelines and /policies/{privacy,terms,[slug]} pages,
swaps the signup/invite checkbox from agreedToTerms to agreedToGuidelines,
adds Member.agreement.acceptedAt, and stamps the field when a Helcim
customer is created.
This commit is contained in:
parent
e0d11e47f4
commit
c5e901ed24
13 changed files with 1292 additions and 54 deletions
|
|
@ -80,7 +80,8 @@ describe('helcimCustomerSchema', () => {
|
|||
it('accepts valid customer data', () => {
|
||||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane Doe',
|
||||
email: 'jane@example.com'
|
||||
email: 'jane@example.com',
|
||||
agreedToGuidelines: true
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
|
@ -88,7 +89,8 @@ describe('helcimCustomerSchema', () => {
|
|||
it('lowercases email', () => {
|
||||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane',
|
||||
email: 'JANE@Example.COM'
|
||||
email: 'JANE@Example.COM',
|
||||
agreedToGuidelines: true
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data.email).toBe('jane@example.com')
|
||||
|
|
@ -97,7 +99,8 @@ describe('helcimCustomerSchema', () => {
|
|||
it('rejects invalid email', () => {
|
||||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane',
|
||||
email: 'not-an-email'
|
||||
email: 'not-an-email',
|
||||
agreedToGuidelines: true
|
||||
})
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
|
@ -106,11 +109,29 @@ describe('helcimCustomerSchema', () => {
|
|||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane',
|
||||
email: 'jane@example.com',
|
||||
agreedToGuidelines: true,
|
||||
role: 'admin'
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
expect(result.data).not.toHaveProperty('role')
|
||||
})
|
||||
|
||||
it('rejects missing agreedToGuidelines', () => {
|
||||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane',
|
||||
email: 'jane@example.com'
|
||||
})
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
||||
it('rejects agreedToGuidelines:false', () => {
|
||||
const result = helcimCustomerSchema.safeParse({
|
||||
name: 'Jane',
|
||||
email: 'jane@example.com',
|
||||
agreedToGuidelines: false
|
||||
})
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('helcimSubscriptionSchema', () => {
|
||||
|
|
@ -297,14 +318,16 @@ describe('seriesTicketPurchaseSchema', () => {
|
|||
it('accepts valid series ticket purchase', () => {
|
||||
const result = seriesTicketPurchaseSchema.safeParse({
|
||||
name: 'Buyer',
|
||||
email: 'buyer@example.com'
|
||||
email: 'buyer@example.com',
|
||||
ticketType: 'member'
|
||||
})
|
||||
expect(result.success).toBe(true)
|
||||
})
|
||||
|
||||
it('rejects missing name', () => {
|
||||
const result = seriesTicketPurchaseSchema.safeParse({
|
||||
email: 'buyer@example.com'
|
||||
email: 'buyer@example.com',
|
||||
ticketType: 'member'
|
||||
})
|
||||
expect(result.success).toBe(false)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue