From 63e06d070121530486c809f75c5fbeab4f168239 Mon Sep 17 00:00:00 2001 From: Kimmo Puputti Date: Wed, 30 Aug 2017 15:59:42 +0300 Subject: [PATCH] Add open flag to all listing prop types --- .../ManageListingsPage/ManageListingsPage.js | 2 +- .../__snapshots__/OrderPage.test.js.snap | 1 + .../SalePage/__snapshots__/SalePage.test.js.snap | 1 + src/util/propTypes.js | 16 +--------------- src/util/test-data.js | 1 + 5 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/containers/ManageListingsPage/ManageListingsPage.js b/src/containers/ManageListingsPage/ManageListingsPage.js index 6b1e2858..b5ae9faf 100644 --- a/src/containers/ManageListingsPage/ManageListingsPage.js +++ b/src/containers/ManageListingsPage/ManageListingsPage.js @@ -164,7 +164,7 @@ ManageListingsPageComponent.propTypes = { currentUser: propTypes.currentUser, currentUserHasListings: bool.isRequired, isAuthenticated: bool.isRequired, - listings: arrayOf(propTypes.ownListing), + listings: arrayOf(propTypes.listing), logoutError: instanceOf(Error), notificationCount: number, onCloseListing: func.isRequired, diff --git a/src/containers/OrderPage/__snapshots__/OrderPage.test.js.snap b/src/containers/OrderPage/__snapshots__/OrderPage.test.js.snap index c52e62dc..c17d30da 100644 --- a/src/containers/OrderPage/__snapshots__/OrderPage.test.js.snap +++ b/src/containers/OrderPage/__snapshots__/OrderPage.test.js.snap @@ -116,6 +116,7 @@ exports[`OrderPage matches snapshot 1`] = ` "lat": 40, "lng": 60, }, + "open": true, "price": Money { "amount": 5500, "currency": "USD", diff --git a/src/containers/SalePage/__snapshots__/SalePage.test.js.snap b/src/containers/SalePage/__snapshots__/SalePage.test.js.snap index 17266f99..7e8bf656 100644 --- a/src/containers/SalePage/__snapshots__/SalePage.test.js.snap +++ b/src/containers/SalePage/__snapshots__/SalePage.test.js.snap @@ -120,6 +120,7 @@ exports[`SalePage matches snapshot 1`] = ` "lat": 40, "lng": 60, }, + "open": true, "price": Money { "amount": 5500, "currency": "USD", diff --git a/src/util/propTypes.js b/src/util/propTypes.js index 0c8c5f0c..30f82b30 100644 --- a/src/util/propTypes.js +++ b/src/util/propTypes.js @@ -106,21 +106,6 @@ export const image = shape({ // Denormalised listing object export const listing = shape({ - id: uuid.isRequired, - type: value('listing').isRequired, - attributes: shape({ - title: string.isRequired, - description: string.isRequired, - address: string.isRequired, - geolocation: latlng.isRequired, - price: money, - }), - author: user, - images: arrayOf(image), -}); - -// Denormalised listing object -export const ownListing = shape({ id: uuid.isRequired, type: value('listing').isRequired, attributes: shape({ @@ -131,6 +116,7 @@ export const ownListing = shape({ open: bool.isRequired, price: money, }), + author: user, images: arrayOf(image), }); diff --git a/src/util/test-data.js b/src/util/test-data.js index 38de4a98..a62e3def 100644 --- a/src/util/test-data.js +++ b/src/util/test-data.js @@ -70,6 +70,7 @@ export const createListing = (id, author = null, price = new Money(5500, 'USD')) type: 'listing', attributes: { title: `${id} title`, + open: true, price, description: `${id} description`, address: `${id} address`,