P5 7617 cleanup market and locale (#10)
* Minor fixes * Cleanup with adding Locale type * Add locales to test
This commit is contained in:
@@ -214,6 +214,12 @@ describe('GraphQL Apollo tests', () => {
|
||||
);
|
||||
const marketControlData = market_response.rows[0];
|
||||
|
||||
// Locale
|
||||
const locale_response = await allContainers.db.raw(
|
||||
`SELECT * FROM locales WHERE value='${orderControlData.locale}';`,
|
||||
);
|
||||
const localeControlData = locale_response.rows[0];
|
||||
|
||||
// Order row
|
||||
const orderrow_response = await allContainers.db.raw(
|
||||
`SELECT * FROM "order-rows" WHERE orderid = 1;`,
|
||||
@@ -230,8 +236,10 @@ describe('GraphQL Apollo tests', () => {
|
||||
{
|
||||
order(id: 1) {
|
||||
id
|
||||
localeName
|
||||
marketName
|
||||
locale {
|
||||
id
|
||||
value
|
||||
}
|
||||
market {
|
||||
id
|
||||
name
|
||||
@@ -254,8 +262,6 @@ describe('GraphQL Apollo tests', () => {
|
||||
|
||||
// Order
|
||||
expect(order.id).toBe(`${orderControlData.id}`);
|
||||
expect(order.marketName).toBe(orderControlData.country_code);
|
||||
expect(order.localeName).toBe(orderControlData.locale);
|
||||
|
||||
// Market
|
||||
expect(order.market.id).toBe(`${marketControlData.id}`);
|
||||
@@ -266,6 +272,10 @@ describe('GraphQL Apollo tests', () => {
|
||||
parseFloat(marketControlData.price_adjustment),
|
||||
);
|
||||
|
||||
// Locale
|
||||
expect(order.locale.id).toBe(`${localeControlData.id}`);
|
||||
expect(order.locale.value).toBe(localeControlData.value);
|
||||
|
||||
// Order Rows
|
||||
expect(order.rows.length).toBe(orderRowsControlData.length);
|
||||
expect(order.rows[0].id).toBe('' + orderRowsControlData[0].rowid);
|
||||
|
||||
Reference in New Issue
Block a user