From b9b6abbec5e3539c257e6002a0bb4b58efd87672 Mon Sep 17 00:00:00 2001 From: Niklas Fondberg Date: Thu, 29 Apr 2021 14:37:48 +0200 Subject: [PATCH] Added test base for postgres --- queries.graphql | 86 ++++++++++++++------------- src/__test__/e2e.test.ts | 2 +- src/__test__/{seed.sql => schema.sql} | 6 +- 3 files changed, 48 insertions(+), 46 deletions(-) rename src/__test__/{seed.sql => schema.sql} (84%) diff --git a/queries.graphql b/queries.graphql index 03e9ab9..5111b44 100644 --- a/queries.graphql +++ b/queries.graphql @@ -82,8 +82,10 @@ } { - order(id: 588274) { + order(id: 579702) { id + localeName + marketName market { id name @@ -91,53 +93,53 @@ currency priceAdjustment } - deliveryInformation { - address { - recipientName - companyname - address1 - address2 - city - countryCode - stateCountyOrRegion - zipcode - } - email - phone - } - billingInformation { - address { - recipientName - companyname - address1 - address2 - city - countryCode - stateCountyOrRegion - zipcode - } - email - phone - } + rows { id - order { - id - } - inserted - orderId - productId - productGroup artNo - path - name - price - designerId + code + commission commissionAmount - status - pwintyImageId + commissionResale + designer + designerId + designerPath + discountType + discountValue + displayHeight + displayWidth + edge frameColor + framed + group + height + imagedonotprint + imageprocessed + imageprocessingrejected + inserted + material + measureUnit + mirrored + modifier + name + noShipping + orderId + path + price + printId + process + productGroup + productId + pwintyImageId pwintySku + resolution + status + type + vat + weight + width + x + y } } } diff --git a/src/__test__/e2e.test.ts b/src/__test__/e2e.test.ts index 01a5368..116b108 100644 --- a/src/__test__/e2e.test.ts +++ b/src/__test__/e2e.test.ts @@ -23,7 +23,7 @@ const createDB = async (mappedPort): Promise => { await initialDb.destroy(); const db = createKnexDb(mappedPort, 'photowalltest'); - const sql = fs.readFileSync(resolve(__dirname, 'seed.sql')).toString(); + const sql = fs.readFileSync(resolve(__dirname, 'schema.sql')).toString(); await db.raw(sql); return db; }; diff --git a/src/__test__/seed.sql b/src/__test__/schema.sql similarity index 84% rename from src/__test__/seed.sql rename to src/__test__/schema.sql index 4845d9a..785d4d6 100644 --- a/src/__test__/seed.sql +++ b/src/__test__/schema.sql @@ -1,18 +1,18 @@ CREATE EXTENSION IF NOT EXISTS unaccent WITH SCHEMA public; CREATE TABLE locales ( - id integer NOT NULL, + id SERIAL NOT NULL, value character(5), esales_locale character varying NOT NULL, fallback_id integer, name text NOT NULL ); CREATE TABLE markets ( - id integer NOT NULL, + id SERIAL NOT NULL, name character varying, locale_id integer ); CREATE TABLE market_locales ( - id integer NOT NULL, + id SERIAL NOT NULL, market_id integer NOT NULL, locale_id integer NOT NULL, name text NOT NULL