Ver Fonte

test(core): Remove init() calls from clients in e2e tests

It is no longer needed.
Michael Bromley há 6 anos atrás
pai
commit
e0674eaf15

+ 0 - 1
packages/core/e2e/administrator.e2e-spec.ts

@@ -26,7 +26,6 @@ describe('Administrator resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/auth.e2e-spec.ts

@@ -37,7 +37,6 @@ describe('Authorization & permissions', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/collection.e2e-spec.ts

@@ -66,7 +66,6 @@ describe('Collection resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-collections.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
         const assetsResult = await adminClient.query<GetAssetList.Query, GetAssetList.Variables>(
             GET_ASSET_LIST,

+ 0 - 1
packages/core/e2e/country.e2e-spec.ts

@@ -31,7 +31,6 @@ describe('Facet resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/custom-fields.e2e-spec.ts

@@ -105,9 +105,7 @@ describe('Custom fields', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {

+ 0 - 1
packages/core/e2e/customer.e2e-spec.ts

@@ -66,7 +66,6 @@ describe('Customer resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 5,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/default-search-plugin.e2e-spec.ts

@@ -44,9 +44,7 @@ describe('Default search plugin', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {

+ 0 - 2
packages/core/e2e/entity-id-strategy.e2e-spec.ts

@@ -27,8 +27,6 @@ describe('EntityIdStrategy', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/entity-uuid-strategy.e2e-spec.ts

@@ -29,7 +29,6 @@ describe('UuidIdStrategy', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/facet.e2e-spec.ts

@@ -46,7 +46,6 @@ describe('Facet resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/import.e2e-spec.ts

@@ -21,7 +21,6 @@ describe('Import resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-empty.csv'),
             customerCount: 0,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/localization.e2e-spec.ts

@@ -24,7 +24,6 @@ describe('Role resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
 
         const { updateProduct } = await adminClient.query<UpdateProduct.Mutation, UpdateProduct.Variables>(

+ 0 - 2
packages/core/e2e/order-promotion.e2e-spec.ts

@@ -71,8 +71,6 @@ describe('Promotions applied to Orders', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-promotions.csv'),
             customerCount: 2,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
 
         await getProducts();

+ 0 - 2
packages/core/e2e/order.e2e-spec.ts

@@ -65,9 +65,7 @@ describe('Orders resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 3,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
 
         // Create a couple of orders to be queried
         const result = await adminClient.query<GetCustomerList.Query, GetCustomerList.Variables>(

+ 0 - 2
packages/core/e2e/plugin.e2e-spec.ts

@@ -44,9 +44,7 @@ describe('Plugins', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {

+ 0 - 1
packages/core/e2e/product-option.e2e-spec.ts

@@ -30,7 +30,6 @@ describe('ProductOption resolver', () => {
             customerCount: 1,
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/product.e2e-spec.ts

@@ -51,9 +51,7 @@ describe('Product resolver', () => {
             customerCount: 1,
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {

+ 0 - 1
packages/core/e2e/promotion.e2e-spec.ts

@@ -54,7 +54,6 @@ describe('Promotion resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/role.e2e-spec.ts

@@ -30,7 +30,6 @@ describe('Role resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/shipping-method.e2e-spec.ts

@@ -58,9 +58,7 @@ describe('ShippingMethod resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     afterAll(async () => {

+ 0 - 7
packages/core/e2e/shop-auth.e2e-spec.ts

@@ -89,8 +89,6 @@ describe('Shop auth & accounts', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 2,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 
@@ -551,8 +549,6 @@ describe('Expiring tokens', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 
@@ -642,7 +638,6 @@ describe('Registration without email verification', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await shopClient.init();
     }, TEST_SETUP_TIMEOUT_MS);
 
     beforeEach(() => {
@@ -717,8 +712,6 @@ describe('Updating email address without email verification', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
         const result = await adminClient.query<GetCustomer.Query, GetCustomer.Variables>(GET_CUSTOMER, {
             id: 'T_1',

+ 0 - 2
packages/core/e2e/shop-catalog.e2e-spec.ts

@@ -49,8 +49,6 @@ describe('Shop catalog', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 1,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/shop-customer.e2e-spec.ts

@@ -37,8 +37,6 @@ describe('Shop customers', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 2,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
 
         // Fetch the first Customer and store it as the `customer` variable.

+ 0 - 2
packages/core/e2e/shop-order.e2e-spec.ts

@@ -83,8 +83,6 @@ describe('Shop orders', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-full.csv'),
             customerCount: 2,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 2
packages/core/e2e/stock-control.e2e-spec.ts

@@ -48,8 +48,6 @@ describe('Stock control', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-stock-control.csv'),
             customerCount: 2,
         });
-        await shopClient.init();
-        await adminClient.init();
         await adminClient.asSuperAdmin();
     }, TEST_SETUP_TIMEOUT_MS);
 

+ 0 - 1
packages/core/e2e/zone.e2e-spec.ts

@@ -34,7 +34,6 @@ describe('Facet resolver', () => {
             productsCsvPath: path.join(__dirname, 'fixtures/e2e-products-minimal.csv'),
             customerCount: 1,
         });
-        await adminClient.init();
         await adminClient.asSuperAdmin();
 
         const result = await adminClient.query<GetCountryList.Query>(GET_COUNTRY_LIST, {});