mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
fix e2e tests
This commit is contained in:
parent
c407c20d05
commit
04fe7f84be
@ -1,6 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const { isEmpty } = require('lodash/fp');
|
|
||||||
const { createTestBuilder } = require('../../../../../test/helpers/builder');
|
const { createTestBuilder } = require('../../../../../test/helpers/builder');
|
||||||
const { createStrapiInstance } = require('../../../../../test/helpers/strapi');
|
const { createStrapiInstance } = require('../../../../../test/helpers/strapi');
|
||||||
const { createAuthRequest } = require('../../../../../test/helpers/request');
|
const { createAuthRequest } = require('../../../../../test/helpers/request');
|
||||||
@ -204,7 +203,7 @@ describe.each([false, true])('Relations, with d&p: %s', (withDraftAndPublish) =>
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
expect(res.body).toMatchObject({
|
expect(res.body.results[0]).toMatchObject({
|
||||||
id: expect.any(Number),
|
id: expect.any(Number),
|
||||||
name: 'Skate',
|
name: 'Skate',
|
||||||
...addPublishedAtCheck(expect.any(String)),
|
...addPublishedAtCheck(expect.any(String)),
|
||||||
@ -237,13 +236,8 @@ describe.each([false, true])('Relations, with d&p: %s', (withDraftAndPublish) =>
|
|||||||
url: `/content-manager/collection-types/api::shop.shop/${data.shops[1].id}/${fieldName}`,
|
url: `/content-manager/collection-types/api::shop.shop/${data.shops[1].id}/${fieldName}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isManyRelation) {
|
expect(res.status).toBe(200);
|
||||||
expect(res.status).toBe(200);
|
expect(res.body.results).toHaveLength(0);
|
||||||
expect(res.body.results).toHaveLength(0);
|
|
||||||
} else {
|
|
||||||
expect(res.status).toBe(204);
|
|
||||||
expect(isEmpty(res.body)).toBe(true);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (isManyRelation) {
|
if (isManyRelation) {
|
||||||
@ -321,7 +315,7 @@ describe.each([false, true])('Relations, with d&p: %s', (withDraftAndPublish) =>
|
|||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
expect(res.body).toMatchObject({
|
expect(res.body.results[0]).toMatchObject({
|
||||||
id: expect.any(Number),
|
id: expect.any(Number),
|
||||||
name: 'Skate',
|
name: 'Skate',
|
||||||
...addPublishedAtCheck(expect.any(String)),
|
...addPublishedAtCheck(expect.any(String)),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user