File tree Expand file tree Collapse file tree 1 file changed +78
-0
lines changed
Expand file tree Collapse file tree 1 file changed +78
-0
lines changed Original file line number Diff line number Diff line change 1+ import { createTestClient } from '@zenstackhq/testtools' ;
2+ import { describe , it } from 'vitest' ;
3+
4+ describe ( 'Regression for issue #2375' , ( ) => {
5+ it ( 'verifies the issue' , async ( ) => {
6+ const db = await createTestClient (
7+ `
8+ model TestRunResults {
9+ id Int @id @default(autoincrement())
10+ testRunStepResults TestRunStepResults[]
11+ }
12+
13+ model TestRunStepResults {
14+ id Int @id @default(autoincrement())
15+ testRunResultId Int
16+ testRunResult TestRunResults @relation(fields: [testRunResultId], references: [id])
17+ stepId Int
18+ step Steps @relation(fields: [stepId], references: [id], onDelete: Cascade)
19+ sharedStepItemId Int?
20+ sharedStepItem SharedStepItem? @relation(fields: [sharedStepItemId], references: [id], onDelete: SetNull)
21+ statusId Int
22+ }
23+
24+ model Steps {
25+ id Int @id @default(autoincrement())
26+ order Int @default(0)
27+ testRunStepResults TestRunStepResults[]
28+ }
29+
30+ model SharedStepItem {
31+ id Int @id @default(autoincrement())
32+ order Int
33+ testRunStepResults TestRunStepResults[]
34+ }
35+ ` ,
36+ { provider : 'postgresql' } ,
37+ ) ;
38+
39+ await db . testRunResults . create ( {
40+ data : {
41+ testRunStepResults : {
42+ create : [
43+ {
44+ step : {
45+ create : {
46+ order : 1 ,
47+ } ,
48+ } ,
49+ sharedStepItem : {
50+ create : {
51+ order : 1 ,
52+ } ,
53+ } ,
54+ statusId : 1 ,
55+ } ,
56+ {
57+ step : {
58+ create : {
59+ order : 2 ,
60+ } ,
61+ } ,
62+ sharedStepItem : {
63+ create : {
64+ order : 2 ,
65+ } ,
66+ } ,
67+ statusId : 1 ,
68+ } ,
69+ ] ,
70+ } ,
71+ } ,
72+ } ) ;
73+
74+ await db . testRunStepResults . findMany ( {
75+ orderBy : [ { step : { order : 'asc' } } , { sharedStepItem : { order : 'asc' } } ] ,
76+ } ) ;
77+ } ) ;
78+ } ) ;
You can’t perform that action at this time.
0 commit comments