-
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
272 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ plugins { | |
} | ||
|
||
group = "dev.zenstack" | ||
version = "2.2.3" | ||
version = "2.2.4" | ||
|
||
repositories { | ||
mavenCentral() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { loadSchema } from '@zenstackhq/testtools'; | ||
describe('issue 1518', () => { | ||
it('regression', async () => { | ||
const { enhance } = await loadSchema( | ||
` | ||
model Activity { | ||
id String @id @default(uuid()) | ||
title String | ||
type String | ||
@@delegate(type) | ||
@@allow('all', true) | ||
} | ||
model TaskActivity extends Activity { | ||
description String | ||
@@map("task_activity") | ||
@@allow('all', true) | ||
} | ||
` | ||
); | ||
|
||
const db = enhance(); | ||
await db.taskActivity.create({ | ||
data: { | ||
id: '00000000-0000-0000-0000-111111111111', | ||
title: 'Test Activity', | ||
description: 'Description of task', | ||
}, | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import { loadSchema } from '@zenstackhq/testtools'; | ||
|
||
describe('issue 1520', () => { | ||
it('regression', async () => { | ||
const { enhance } = await loadSchema( | ||
` | ||
model Course { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
addedToNotifications AddedToCourseNotification[] | ||
} | ||
model Group { | ||
id Int @id @default(autoincrement()) | ||
addedToNotifications AddedToGroupNotification[] | ||
} | ||
model Notification { | ||
id Int @id @default(autoincrement()) | ||
createdAt DateTime @default(now()) | ||
type String | ||
senderId Int | ||
receiverId Int | ||
@@delegate (type) | ||
} | ||
model AddedToGroupNotification extends Notification { | ||
groupId Int | ||
group Group @relation(fields: [groupId], references: [id], onDelete: Cascade) | ||
} | ||
model AddedToCourseNotification extends Notification { | ||
courseId Int | ||
course Course @relation(fields: [courseId], references: [id], onDelete: Cascade) | ||
} | ||
`, | ||
{ enhancements: ['delegate'] } | ||
); | ||
|
||
const db = enhance(); | ||
const r = await db.course.create({ | ||
data: { | ||
title: 'English classes', | ||
addedToNotifications: { | ||
createMany: { | ||
data: [ | ||
{ | ||
id: 1, | ||
receiverId: 1, | ||
senderId: 2, | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
include: { addedToNotifications: true }, | ||
}); | ||
|
||
expect(r.addedToNotifications).toEqual( | ||
expect.arrayContaining([ | ||
expect.objectContaining({ | ||
id: 1, | ||
courseId: 1, | ||
receiverId: 1, | ||
senderId: 2, | ||
}), | ||
]) | ||
); | ||
}); | ||
}); |
Oops, something went wrong.