mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 22:32:02 +00:00
fix tests
This commit is contained in:
parent
94308aa2bc
commit
fbd9ae5a50
@ -92,20 +92,17 @@ describe('Test type date', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Updating entry sets the right value and format JSON', async () => {
|
test('Updating entry sets the right value and format JSON', async () => {
|
||||||
const now = new Date(2018, 7, 5);
|
|
||||||
|
|
||||||
const res = await rq.post('/content-manager/collection-types/api::withdate.withdate', {
|
const res = await rq.post('/content-manager/collection-types/api::withdate.withdate', {
|
||||||
body: {
|
body: {
|
||||||
field: now,
|
field: '2018-06-05',
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const newDate = new Date(2017, 10, 23);
|
|
||||||
const updateRes = await rq.put(
|
const updateRes = await rq.put(
|
||||||
`/content-manager/collection-types/api::withdate.withdate/${res.body.id}`,
|
`/content-manager/collection-types/api::withdate.withdate/${res.body.id}`,
|
||||||
{
|
{
|
||||||
body: {
|
body: {
|
||||||
field: newDate,
|
field: '2017-11-23',
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@ -123,9 +123,9 @@ describe('Folder', () => {
|
|||||||
children: { count: 1 },
|
children: { count: 1 },
|
||||||
createdAt: expect.anything(),
|
createdAt: expect.anything(),
|
||||||
createdBy: {
|
createdBy: {
|
||||||
firstname: 'admin',
|
firstname: expect.anything(),
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
lastname: 'admin',
|
lastname: expect.anything(),
|
||||||
username: null,
|
username: null,
|
||||||
},
|
},
|
||||||
files: { count: 0 },
|
files: { count: 0 },
|
||||||
@ -136,9 +136,9 @@ describe('Folder', () => {
|
|||||||
uid: expect.anything(),
|
uid: expect.anything(),
|
||||||
updatedAt: expect.anything(),
|
updatedAt: expect.anything(),
|
||||||
updatedBy: {
|
updatedBy: {
|
||||||
firstname: 'admin',
|
firstname: expect.anything(),
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
lastname: 'admin',
|
lastname: expect.anything(),
|
||||||
username: null,
|
username: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -146,14 +146,12 @@ describe('Folder', () => {
|
|||||||
children: { count: 0 },
|
children: { count: 0 },
|
||||||
createdAt: expect.anything(),
|
createdAt: expect.anything(),
|
||||||
createdBy: {
|
createdBy: {
|
||||||
firstname: 'admin',
|
firstname: expect.anything(),
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
lastname: 'admin',
|
lastname: expect.anything(),
|
||||||
username: null,
|
username: null,
|
||||||
},
|
},
|
||||||
files: {
|
files: { count: 0 },
|
||||||
count: 0,
|
|
||||||
},
|
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
name: 'folder-2',
|
name: 'folder-2',
|
||||||
parent: {
|
parent: {
|
||||||
@ -168,9 +166,9 @@ describe('Folder', () => {
|
|||||||
uid: expect.anything(),
|
uid: expect.anything(),
|
||||||
updatedAt: expect.anything(),
|
updatedAt: expect.anything(),
|
||||||
updatedBy: {
|
updatedBy: {
|
||||||
firstname: 'admin',
|
firstname: expect.anything(),
|
||||||
id: expect.anything(),
|
id: expect.anything(),
|
||||||
lastname: 'admin',
|
lastname: expect.anything(),
|
||||||
username: null,
|
username: null,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user