gradido/dlt-connector/src/client/backend/community.schema.test.ts
2025-08-16 17:51:43 +02:00

25 lines
773 B
TypeScript

// only for IDE, bun don't need this to work
import { describe, expect, it } from 'bun:test'
import * as v from 'valibot'
import { uuidv4Schema } from '../../schemas/typeGuard.schema'
import { communitySchema } from './community.schema'
import { hieroIdSchema } from '../../schemas/typeGuard.schema'
describe('community.schema', () => {
it('community', () => {
expect(
v.parse(communitySchema, {
uuid: '4f28e081-5c39-4dde-b6a4-3bde71de8d65',
topicId: '0.0.4',
foreign: false,
createdAt: '2021-01-01',
}),
).toEqual({
topicId: v.parse(hieroIdSchema, '0.0.4'),
uuid: v.parse(uuidv4Schema, '4f28e081-5c39-4dde-b6a4-3bde71de8d65'),
foreign: false,
createdAt: new Date('2021-01-01'),
})
})
})