diff --git a/src/components/ManageListingCard/ManageListingCard.example.js b/src/components/ManageListingCard/ManageListingCard.example.js index f02f3d39..7999de7b 100644 --- a/src/components/ManageListingCard/ManageListingCard.example.js +++ b/src/components/ManageListingCard/ManageListingCard.example.js @@ -1,7 +1,7 @@ /* eslint-disable no-console */ import React from 'react'; import ManageListingCard from './ManageListingCard'; -import { createListing, fakeIntl } from '../../util/test-data'; +import { createOwnListing, fakeIntl } from '../../util/test-data'; const noop = () => null; @@ -17,7 +17,7 @@ export const ManageListingCardWrapped = { hasClosingError: false, hasOpeningError: false, intl: fakeIntl, - listing: createListing('listing1'), + listing: createOwnListing('listing1'), isMenuOpen: false, onCloseListing: noop, onOpenListing: noop, diff --git a/src/components/ManageListingCard/ManageListingCard.test.js b/src/components/ManageListingCard/ManageListingCard.test.js index bb7658a4..01a84801 100644 --- a/src/components/ManageListingCard/ManageListingCard.test.js +++ b/src/components/ManageListingCard/ManageListingCard.test.js @@ -1,6 +1,6 @@ import React from 'react'; import { renderShallow } from '../../util/test-helpers'; -import { createUser, createListing, fakeIntl } from '../../util/test-data'; +import { createUser, createOwnListing, fakeIntl } from '../../util/test-data'; import { ManageListingCardComponent } from './ManageListingCard'; const noop = () => null; @@ -10,7 +10,7 @@ describe('ManageListingCard', () => { const tree = renderShallow( ({ ...includes, }); +// Create a user that conforms to the util/types ownListing schema +export const createOwnListing = (id, attributes = {}, includes = {}) => ({ + id: new UUID(id), + type: 'ownListing', + attributes: { + title: `${id} title`, + description: `${id} description`, + address: `${id} address`, + geolocation: new LatLng(40, 60), + closed: false, + deleted: false, + price: new Money(5500, 'USD'), + customAttributes: {}, + ...attributes, + }, + ...includes, +}); + export const createTxTransition = options => { return { at: new Date(Date.UTC(2017, 4, 1)),