We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5da470e commit 4c69a7cCopy full SHA for 4c69a7c
tests/regression/tests/issue-foo.test.ts
@@ -0,0 +1,36 @@
1
+import { loadSchema } from '@zenstackhq/testtools';
2
+
3
+describe('issue [...]', () => {
4
+ it('regression', async () => {
5
+ const { zodSchemas } = await loadSchema(
6
+ `
7
+ enum FooType {
8
+ Bar
9
+ Baz
10
+ }
11
+ type Meta {
12
+ test String?
13
14
+ model Foo {
15
+ id String @id @db.Uuid @default(uuid())
16
+ type FooType
17
+ meta Meta @json
18
+ @@validate(type == Bar, "FooType must be Bar")
19
20
+ `,
21
+ {
22
+ provider: 'postgresql',
23
+ pushDb: false,
24
25
+ );
26
+ expect(
27
+ zodSchemas.models.FooSchema.safeParse({
28
+ id: '123e4567-e89b-12d3-a456-426614174000',
29
+ type: 'Bar',
30
+ meta: { test: 'test' },
31
+ })
32
+ ).toMatchObject({
33
+ success: true,
34
+ });
35
36
+});
0 commit comments