mirror of
https://github.com/strapi/strapi.git
synced 2025-12-28 07:33:17 +00:00
Use a global timeout instead of redefining it everytime
This commit is contained in:
parent
cab3a45b58
commit
4c21bea64b
@ -68,12 +68,12 @@ describe('Provider Login', () => {
|
||||
requests.public = createRequest({ strapi });
|
||||
requests.admin = await createAuthRequest({ strapi });
|
||||
requests.noPermissions = await createAuthRequest({ strapi, userInfo: restrictedUser });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await deleteFixtures();
|
||||
await strapi.destroy();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Get the provider list', () => {
|
||||
test.each(Object.keys(requests))('It should be available for everyone (%s)', async type => {
|
||||
|
||||
@ -29,7 +29,7 @@ describe('Admin Auth End to End', () => {
|
||||
} else {
|
||||
internals.role = await utils.getSuperAdminRole();
|
||||
}
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
if (edition === 'EE') {
|
||||
@ -37,7 +37,7 @@ describe('Admin Auth End to End', () => {
|
||||
}
|
||||
|
||||
await strapi.destroy();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Login', () => {
|
||||
test('Can connect successfully', async () => {
|
||||
|
||||
@ -11,7 +11,7 @@ describe('Authenticated User', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -14,7 +14,7 @@ describe('Role CRUD End to End', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -120,14 +120,14 @@ if (edition === 'EE') {
|
||||
utils = createUtils(strapi);
|
||||
|
||||
await createFixtures();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await deleteFixtures();
|
||||
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('User A can create an entry', async () => {
|
||||
const rq = getUserRequest(0);
|
||||
|
||||
@ -27,11 +27,11 @@ describe('Role CRUD End to End', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Default roles', () => {
|
||||
test('Default roles are created', async () => {
|
||||
|
||||
@ -66,7 +66,7 @@ describe('Admin User CRUD (e2e)', () => {
|
||||
|
||||
testData.firstSuperAdminUser = rq.getLoggedUser();
|
||||
testData.superAdminRole = await utils.getSuperAdminRole();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
// Cleanup actions
|
||||
afterAll(async () => {
|
||||
@ -74,7 +74,7 @@ describe('Admin User CRUD (e2e)', () => {
|
||||
await utils.deleteRolesById([testData.role.id]);
|
||||
}
|
||||
await strapi.destroy();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('1. Creates a user (wrong body)', async () => {
|
||||
const body = {
|
||||
|
||||
@ -66,12 +66,12 @@ describe('Migration - draft and publish', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
data.dogs = sortDogs(builder.sanitizedFixturesFor(dogModel.name, strapi));
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Enabling D&P on a content-type', () => {
|
||||
test('No published_at before enabling the feature', async () => {
|
||||
@ -120,7 +120,7 @@ describe('Migration - draft and publish', () => {
|
||||
});
|
||||
|
||||
data.dogs = sortedBody;
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Disabling D&P on a content-type', () => {
|
||||
@ -156,7 +156,7 @@ describe('Migration - draft and publish', () => {
|
||||
expect(body.results.length).toBe(1);
|
||||
expect(body.results[0]).toMatchObject(_.pick(data.dogs[0], ['name']));
|
||||
expect(body.results[0].published_at).toBeUndefined();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Unique constraint is kept after disabling the feature', async () => {
|
||||
const dogToCreate = { code: 'sameCode' };
|
||||
|
||||
@ -52,12 +52,12 @@ describe('Migration - required attribute', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
data.dogs = builder.sanitizedFixturesFor(dogModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Required: false -> true', () => {
|
||||
test('Can be null before migration', async () => {
|
||||
@ -94,7 +94,7 @@ describe('Migration - required attribute', () => {
|
||||
body: { name: null },
|
||||
});
|
||||
expect(res.body.message).toBe('ValidationError');
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Required: true -> false', () => {
|
||||
@ -115,6 +115,6 @@ describe('Migration - required attribute', () => {
|
||||
|
||||
expect(res.body).toMatchObject({ name: null });
|
||||
data.dogs.push(res.body);
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -52,12 +52,12 @@ describe('Migration - unique attribute', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
data.dogs = builder.sanitizedFixturesFor(dogModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Unique: false -> true', () => {
|
||||
test('Can have duplicates before migration', async () => {
|
||||
@ -92,7 +92,7 @@ describe('Migration - unique attribute', () => {
|
||||
body: { name: data.dogs[0].name },
|
||||
});
|
||||
expect(res.statusCode).toBe(400);
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Unique: true -> false', () => {
|
||||
@ -113,6 +113,6 @@ describe('Migration - unique attribute', () => {
|
||||
|
||||
expect(res.body).toMatchObject({ name: data.dogs[0].name });
|
||||
data.dogs.push(res.body);
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -58,12 +58,12 @@ describe('CM API - Basic + compo', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -57,12 +57,12 @@ describe('CM API - Basic + compo', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -61,12 +61,12 @@ describe('CM API - Basic + compo + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -60,12 +60,12 @@ describe('CM API - Basic + compo + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -60,12 +60,12 @@ describe('CM API - Basic + dz + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -56,12 +56,12 @@ describe('CM API - Basic + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create a product', async () => {
|
||||
const product = {
|
||||
|
||||
@ -57,12 +57,12 @@ describe('Core API - Basic + dz', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -123,12 +123,12 @@ describe('CM API', () => {
|
||||
|
||||
data.collectors = builder.sanitizedFixturesFor(collector.name, strapi);
|
||||
data.stamps = builder.sanitizedFixturesFor(stamp.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Count relations', () => {
|
||||
test('many-way', async () => {
|
||||
|
||||
@ -36,12 +36,12 @@ describe('CM API - Basic', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product', async () => {
|
||||
const product = {
|
||||
|
||||
@ -116,12 +116,12 @@ describe('x-to-many RF Preview', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
Object.assign(data, builder.sanitizedFixtures(strapi));
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Entity Misc', () => {
|
||||
test.each(['foobar', 'name'])(`Throws if the targeted field is invalid (%s)`, async field => {
|
||||
|
||||
@ -46,12 +46,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -44,12 +44,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -46,12 +46,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -44,12 +44,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -44,12 +44,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -44,12 +44,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('POST new entry', () => {
|
||||
test('Creating entry with JSON works', async () => {
|
||||
|
||||
@ -33,12 +33,12 @@ describe('Content Manager single types', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Generate UID', () => {
|
||||
test('Throws if input is not provided', async () => {
|
||||
|
||||
@ -92,12 +92,12 @@ describe.each([
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Creation', () => {
|
||||
test('Can create an entry with a dynamic zone and a nested compo', async () => {
|
||||
|
||||
@ -87,12 +87,12 @@ describe.each([
|
||||
|
||||
rq = await createAuthRequest({ strapi });
|
||||
rq.setURLPrefix(path);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
}, 600000);
|
||||
|
||||
describe('Contains components with medias', () => {
|
||||
test('The medias are correctly related to the components on creation', async () => {
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type biginteger', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const inputValue = '1223372036854775';
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type boolean', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type date', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with valid value JSON', async () => {
|
||||
const res = await rq.post('/content-manager/collection-types/application::withdate.withdate', {
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type datetime', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with valid value JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type decimal', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const inputValue = 12.31;
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type email', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -24,12 +24,12 @@ describe('Test type enumeration', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry value enumeration input JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type float', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const inputValue = 12.31;
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type integer', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type json', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const inputValue = {
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type password', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with value input JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type richtext', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Creates an entry with JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type string', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Creates an entry with JSON', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type text', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Creates an entry with JSON', async () => {
|
||||
const res = await rq.post('/content-manager/collection-types/application::withtext.withtext', {
|
||||
|
||||
@ -23,12 +23,12 @@ describe('Test type time', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create entry with valid value JSON', async () => {
|
||||
const res = await rq.post('/content-manager/collection-types/application::withtime.withtime', {
|
||||
|
||||
@ -25,12 +25,12 @@ describe('Test type UID', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Creates an entry successfully', async () => {
|
||||
const res = await rq.post('/content-manager/collection-types/application::withuid.withuid', {
|
||||
@ -101,12 +101,12 @@ describe('Test type UID', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Creates an entry successfully', async () => {
|
||||
const res = await rq.post(
|
||||
|
||||
@ -49,12 +49,12 @@ describe('Content Manager End to End', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Content Types api', () => {
|
||||
test('Label is pluralized', async () => {
|
||||
|
||||
@ -101,12 +101,12 @@ describe('Relation-list route', () => {
|
||||
|
||||
data.shops = builder.sanitizedFixturesFor(shopModel.name, strapi);
|
||||
data.products = builder.sanitizedFixturesFor(productModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Can get relation-list for products of a shop', async () => {
|
||||
const res = await rq({
|
||||
@ -149,12 +149,12 @@ describe('Relation-list route', () => {
|
||||
|
||||
data.shops = builder.sanitizedFixturesFor(shopModel.name, strapi);
|
||||
data.products = builder.sanitizedFixturesFor(productWithDPModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Can get relation-list for products of a shop', async () => {
|
||||
const res = await rq({
|
||||
|
||||
@ -127,12 +127,12 @@ describe('Search query', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
data.beds = builder.sanitizedFixturesFor(bedModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Without filters', () => {
|
||||
test('search for "id"', async () => {
|
||||
|
||||
@ -26,12 +26,12 @@ describe('Content Manager single types', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Label is not pluralized', async () => {
|
||||
const res = await rq({
|
||||
|
||||
@ -16,7 +16,7 @@ describe('Content Type Builder - Components', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
@ -82,7 +82,7 @@ describe('Content Type Builder - Components', () => {
|
||||
});
|
||||
|
||||
await restart();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Errors on already existing components', async () => {
|
||||
const res = await rq({
|
||||
@ -269,7 +269,7 @@ describe('Content Type Builder - Components', () => {
|
||||
},
|
||||
},
|
||||
});
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('DELETE /components/:uid', () => {
|
||||
@ -309,6 +309,6 @@ describe('Content Type Builder - Components', () => {
|
||||
expect(tryGet.body).toEqual({
|
||||
error: 'component.notFound',
|
||||
});
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -20,11 +20,11 @@ describe('Content Type Builder - Content types', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterEach(async () => {
|
||||
await restart();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
const modelsName = [
|
||||
@ -38,7 +38,7 @@ describe('Content Type Builder - Content types', () => {
|
||||
await modelsUtils.deleteContentTypes(modelsName, { strapi });
|
||||
|
||||
await strapi.destroy();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Collection Types', () => {
|
||||
const testCollectionTypeUID = 'application::test-collection-type.test-collection-type';
|
||||
@ -255,7 +255,7 @@ describe('Content Type Builder - Content types', () => {
|
||||
|
||||
expect(updateRes.statusCode).toBe(400);
|
||||
expect(updateRes.body.error).toMatch('multiple entries in DB');
|
||||
}, 60000);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Private relation field', () => {
|
||||
|
||||
@ -42,12 +42,12 @@ describe('Test Graphql API End to End', () => {
|
||||
body,
|
||||
});
|
||||
};
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Test CRUD', () => {
|
||||
const postsPayload = [
|
||||
|
||||
@ -122,12 +122,12 @@ describe('Test Graphql Relations API End to End', () => {
|
||||
body,
|
||||
});
|
||||
};
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Test relations features', () => {
|
||||
let data = {
|
||||
|
||||
@ -54,12 +54,12 @@ describe('Single type Graphql support', () => {
|
||||
body,
|
||||
});
|
||||
};
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Queries', () => {
|
||||
test('No list available', async () => {
|
||||
|
||||
@ -20,7 +20,7 @@ describe('CRUD locales', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -15,7 +15,7 @@ describe('Upload plugin end to end tests', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -14,7 +14,7 @@ describe('Upload plugin end to end tests', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -12,7 +12,7 @@ describe('Test Graphql user service', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
authReq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -46,7 +46,7 @@ describe('Roles API', () => {
|
||||
|
||||
const res = await createTestUser();
|
||||
data.user = res.body.user;
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await deleteTestUser();
|
||||
|
||||
@ -13,7 +13,7 @@ describe('Users API', () => {
|
||||
beforeAll(async () => {
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -22,7 +22,7 @@ describe('Test Graphql Users API End to End', () => {
|
||||
body,
|
||||
});
|
||||
};
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
|
||||
@ -58,12 +58,12 @@ describe('Core API - Basic + compo', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -57,12 +57,12 @@ describe('Core API - Basic + compo', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -59,12 +59,12 @@ describe('Core API - Basic + compo + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -58,12 +58,12 @@ describe('Core API - Basic + compo + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -56,12 +56,12 @@ describe('Core API - Basic + draftAndPublish', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create a product', async () => {
|
||||
const product = {
|
||||
|
||||
@ -57,12 +57,12 @@ describe('Core API - Basic + dz', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product with compo', async () => {
|
||||
const product = {
|
||||
|
||||
@ -50,12 +50,12 @@ describe('Core API - Basic', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('Create product', async () => {
|
||||
const product = {
|
||||
|
||||
@ -92,12 +92,12 @@ describe('Deep Filtering API', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
Object.assign(data, builder.sanitizedFixtures(strapi));
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Without search', () => {
|
||||
describe('Filter on a manyWay relation', () => {
|
||||
|
||||
@ -30,12 +30,12 @@ describe('Create Strapi API End to End', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Test manyToMany relation (article - tag) with Content Manager', () => {
|
||||
beforeAll(async () => {
|
||||
|
||||
@ -93,12 +93,12 @@ describe('Filtering API', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
Object.assign(data, builder.sanitizedFixtures(strapi));
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Basic filters', () => {
|
||||
describe('Filter equals', () => {
|
||||
|
||||
@ -157,12 +157,12 @@ describe('Publication State', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
Object.assign(data, builder.sanitizedFixtures(strapi));
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe.each(['default', 'live', 'preview'])('Mode: "%s"', mode => {
|
||||
describe.each(['country', 'category', 'product'])('For %s', modelName => {
|
||||
|
||||
@ -130,12 +130,12 @@ describe('Search query', () => {
|
||||
rq = await createAuthRequest({ strapi });
|
||||
|
||||
data.bed = builder.sanitizedFixturesFor(bedModel.name, strapi);
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
describe('Without filters', () => {
|
||||
test('search for "id"', async () => {
|
||||
|
||||
@ -27,12 +27,12 @@ describe('Content Manager single types', () => {
|
||||
|
||||
strapi = await createStrapiInstance();
|
||||
rq = await createAuthRequest({ strapi });
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
await strapi.destroy();
|
||||
await builder.cleanup();
|
||||
}, 60000);
|
||||
});
|
||||
|
||||
test('find single type content returns 404 when not created', async () => {
|
||||
const res = await rq({
|
||||
|
||||
@ -10,8 +10,6 @@ const filePattern = `*${fileExtension}`;
|
||||
|
||||
const defaultPaths = ['packages/'];
|
||||
|
||||
const defaultJestTimeout = 60000;
|
||||
|
||||
/**
|
||||
* `STRAPI_TEST_PATHS` is an env variable used internally to filter which test are going to be run.
|
||||
* The expected format is a string containing a space separated list of file or directory.
|
||||
@ -36,8 +34,6 @@ const filesPath = paths.filter(isE2eTestFile);
|
||||
const files = uniq(filesPath.concat(filesFromPaths(directoriesPath)));
|
||||
const len = files.length;
|
||||
|
||||
jest.setTimeout(defaultJestTimeout);
|
||||
|
||||
// Iterate over each file path and create a test suite by requiring it.
|
||||
let it = 0;
|
||||
for (const file of files) {
|
||||
|
||||
@ -16,7 +16,7 @@ const superAdminLoginInfo = _.pick(superAdminCredentials, ['email', 'password'])
|
||||
|
||||
const TEST_APP_URL = path.resolve(__dirname, '../../testApp');
|
||||
|
||||
const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'fatal' } = {}) => {
|
||||
const createStrapiInstance = async ({ ensureSuperAdmin = true, logLevel = 'debug' } = {}) => {
|
||||
const options = { dir: TEST_APP_URL };
|
||||
const instance = strapi(options);
|
||||
|
||||
|
||||
@ -2,6 +2,8 @@
|
||||
|
||||
const isoDateRegex = /\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/;
|
||||
|
||||
jest.setTimeout(180000);
|
||||
|
||||
expect.extend({
|
||||
stringOrNull(received) {
|
||||
const pass = typeof received === 'string' || received === null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user