Skip to content

Commit b5b9e34

Browse files
committed
chore(test): Added duplicateCheck test
1 parent fe628da commit b5b9e34

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

packages/core/server/admin-api/__tests__/query-layer-decorator.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,26 @@ describe('Query layer decorator', () => {
155155
expect(updatedPage).toHaveProperty('url_alias.generated', false);
156156
});
157157

158+
it('Update - Should not duplicate check the same entry when updated', async () => {
159+
const page = await strapi.entityService.create("api::test.test", {
160+
data: {
161+
title: 'Unpublished page',
162+
},
163+
populate: ['url_alias']
164+
});
165+
const url = page.url_alias.url_path;
166+
167+
const updatedPage = await strapi.entityService.update("api::test.test", page.id, {
168+
data: {
169+
// @ts-ignore
170+
published_at: new Date(),
171+
},
172+
populate: ['url_alias']
173+
});
174+
175+
expect(updatedPage).toHaveProperty('url_alias.url_path', url);
176+
});
177+
158178
it('Delete - Should delete the corresponding URL alias as wel', async () => {
159179
const page = await strapi.entityService.create("api::test.test", {
160180
data: {

0 commit comments

Comments
 (0)