mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-26 21:53:06 +00:00
Offline/hybrid activity updates no longer render tasks/demands editors (outbox cannot persist them) and always send null when responsible or leadership is cleared.
25 lines
771 B
TypeScript
25 lines
771 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
|
|
import { activityUpdateSchema } from '@/lib/schemas/activity'
|
|
|
|
/**
|
|
* Pass 5 P1a — hybrid activity updates must be able to clear relations with
|
|
* explicit null (omitting the key leaves the previous server value).
|
|
*/
|
|
describe('activity hybrid update payload (Pass 5 P1a)', () => {
|
|
it('accepts null responsible and leadership on patch', () => {
|
|
const parsed = activityUpdateSchema.parse({
|
|
id: 1,
|
|
responsible: null,
|
|
leadership: null,
|
|
description: null,
|
|
locality: null,
|
|
})
|
|
expect(parsed.responsible).toBeNull()
|
|
expect(parsed.leadership).toBeNull()
|
|
})
|
|
|
|
it('rejects omitting id', () => {
|
|
expect(() => activityUpdateSchema.parse({ responsible: null })).toThrow()
|
|
})
|
|
})
|