From 6f74c88cc06e20cb5361d7a606c248e6c0155cd2 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Thu, 4 Jan 2018 14:19:30 +0200 Subject: [PATCH 1/2] There was no null check for config.customAttributes --- src/containers/ListingPage/ListingPage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/containers/ListingPage/ListingPage.js b/src/containers/ListingPage/ListingPage.js index f7b2f43c..eb798d9f 100644 --- a/src/containers/ListingPage/ListingPage.js +++ b/src/containers/ListingPage/ListingPage.js @@ -232,8 +232,10 @@ export class ListingPageComponent extends Component { } = currentListing.attributes; const { customAttributes } = currentListing.attributes; + const hasCategoryConfig = config.customAttributes && config.customAttributes.category; + const hasCategoryAttribute = customAttributes && customAttributes.category; const category = - config.customAttributes.category && customAttributes && customAttributes.category ? ( + hasCategoryConfig && hasCategoryAttribute ? ( From 5638ab14b033c8d7984a0a31e8d8bbec3f7bfe06 Mon Sep 17 00:00:00 2001 From: Vesa Luusua Date: Fri, 5 Jan 2018 12:19:04 +0200 Subject: [PATCH 2/2] tests failed on master --- .../TransactionPanel.test.js.snap | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap index 19a9c1fe..98bf9e7b 100644 --- a/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap +++ b/src/components/TransactionPanel/__snapshots__/TransactionPanel.test.js.snap @@ -4388,6 +4388,10 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -4401,6 +4405,9 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -4642,6 +4649,10 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -4655,6 +4666,9 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -4764,6 +4778,10 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -4777,6 +4795,9 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5004,6 +5025,10 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5017,6 +5042,9 @@ exports[`TransactionPanel - Order enquired matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5220,6 +5248,10 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5233,6 +5265,9 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5345,6 +5380,10 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5358,6 +5397,9 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5467,6 +5509,10 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5480,6 +5526,9 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5589,6 +5638,10 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5602,6 +5655,9 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -5829,6 +5885,10 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -5842,6 +5902,9 @@ exports[`TransactionPanel - Order preauthorized matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -100, "currency": "USD", @@ -6039,6 +6102,10 @@ exports[`TransactionPanel - Sale accepted matches snapshot 1`] = ` "lineItems": Array [ Object { "code": "line-item/night", + "includeFor": Array [ + "customer", + "provider", + ], "lineTotal": Money { "amount": 16500, "currency": "USD", @@ -6052,6 +6119,9 @@ exports[`TransactionPanel - Sale accepted matches snapshot 1`] = ` }, Object { "code": "line-item/provider-commission", + "includeFor": Array [ + "provider", + ], "lineTotal": Money { "amount": -1000, "currency": "USD",