Skip to content

Commit 4c69a7c

Browse files
committed
update test
1 parent 5da470e commit 4c69a7c

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)