From f6620a28ddc33aebf5e7ef3cdf88bfe0e4f8b063 Mon Sep 17 00:00:00 2001 From: atusithi Date: Mon, 1 Apr 2019 18:25:29 +0200 Subject: [PATCH] (PC-1679): updated logic to handle display of information, added tests and updated logic to display valid text when thing or event --- jest.config.js | 1 - .../pages/Offers/OfferItem/RawOfferItem.jsx | 87 +++- .../pages/Offers/OfferItem/index.jsx | 7 +- .../OfferItem/tests/RawOfferItem.spec.jsx | 470 ++++++++++++++++-- .../__snapshots__/RawOfferItem.spec.jsx.snap | 126 ++--- .../pages/Offers/tests/offersMock.jsx | 15 + 6 files changed, 547 insertions(+), 159 deletions(-) diff --git a/jest.config.js b/jest.config.js index 233f44eafb..aeb8095742 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,7 +13,6 @@ module.exports = { }, modulePaths: ['node_modules', 'src'], setupFiles: ['/.jest-polyfill.js', '/jest.setup.js'], - testEnvironment: 'node', testMatch: [ '/src/**/__tests__/**/*.{js,jsx}', '/src/**/?(*.)(spec|test).{js,jsx}', diff --git a/src/components/pages/Offers/OfferItem/RawOfferItem.jsx b/src/components/pages/Offers/OfferItem/RawOfferItem.jsx index 99340e8f1e..5d4cced2da 100644 --- a/src/components/pages/Offers/OfferItem/RawOfferItem.jsx +++ b/src/components/pages/Offers/OfferItem/RawOfferItem.jsx @@ -12,9 +12,10 @@ import Thumb from 'components/layout/Thumb' import { offerNormalizer } from 'utils/normalizers' class RawOfferItem extends Component { - onDeactivateClick = event => { + onDeactivateClick = () => { const { dispatch, offer } = this.props const { id, isActive } = offer || {} + dispatch( requestData({ apiPath: `/offers/${id}`, @@ -30,6 +31,42 @@ class RawOfferItem extends Component { ) } + buildEventLabel = remainingStock => { + if (remainingStock === 0) { + return '0 places' + } + + const label = 'encore ' + remainingStock + return remainingStock > 1 ? label + ' places' : label + ' place' + } + + buildThingLabel = remainingStock => { + return remainingStock + ' en stock' + } + + buildNumberOfParticipantsLabel = (groupSizeMin, groupSizeMax) => { + return groupSizeMin === groupSizeMax + ? groupSizeMin + : groupSizeMin - groupSizeMax + } + + buildNumberOfParticipantsTitle = (groupSizeMin, groupSizeMax) => { + const groupLabel = + groupSizeMin === groupSizeMax + ? 'minimum ' + pluralize(groupSizeMin, 'personnes') + : 'entre ' + groupSizeMin + ' et ' + groupSizeMax + ' personnes' + + return groupSizeMin > 0 ? groupLabel : undefined + } + + buildEventNavLinkLabel = stockSize => { + return pluralize(stockSize, 'dates') + } + + buildThingNavLinkLabel = stockSize => { + return stockSize + ' prix' + } + render() { const { aggregatedStock, @@ -47,11 +84,12 @@ class RawOfferItem extends Component { } = this.props const { isNew } = offer || {} - const { available, groupSizeMin, groupSizeMax, priceMin, priceMax } = + const { groupSizeMin, groupSizeMax, priceMin, priceMax } = aggregatedStock || {} const { name, createdAt } = event || thing || {} - const mediationsLength = get(mediations, 'length') + const numberOfMediations = get(mediations, 'length') + const remainingStockQuantity = get(stocks, 'length') return (
  • {offerTypeLabel}
  • - Structure : + Structure : {offerrer && offerrer.name}
  • @@ -84,20 +122,16 @@ class RawOfferItem extends Component {
  • )} - {false && - moment(createdAt).isAfter(moment().add(-1, 'days')) && ( -
  • -
    -
  • - )} + {false && moment(createdAt).isAfter(moment().add(-1, 'days')) && ( +
  • +
    +
  • + )}
  • 0 - ? groupSizeMin === groupSizeMax - ? `minimum ${pluralize(groupSizeMin, 'personnes')}` - : `entre ${groupSizeMin} et ${groupSizeMax} personnes` - : undefined - }> + title={this.buildNumberOfParticipantsTitle( + groupSizeMin, + groupSizeMax + )}> { // DISABLE GROUP SIZE AMBIGUITY FOR THE MOMENT /*groupSizeMin === 0 && ( @@ -111,9 +145,10 @@ class RawOfferItem extends Component {
    ,{' '}

    - {groupSizeMin === groupSizeMax - ? groupSizeMin - : `${groupSizeMin} - ${groupSizeMax}`} + {this.buildNumberOfParticipantsLabel( + groupSizeMin, + groupSizeMax + )}

    )} @@ -122,13 +157,13 @@ class RawOfferItem extends Component { - {event - ? pluralize(get(stocks, 'length'), 'dates') - : get(stocks, 'length') + ' prix'} + {event && this.buildEventNavLinkLabel(remainingStockQuantity)} + {thing && this.buildThingNavLinkLabel(remainingStockQuantity)}
  • {maxDate && `jusqu'au ${maxDate.format('DD/MM/YYYY')}`}
  • -
  • {available ? `encore ${available} places` : '0 place'}
  • + {event &&
  • {this.buildEventLabel(remainingStockQuantity)}
  • } + {thing &&
  • {this.buildThingLabel(remainingStockQuantity)}
  • }
  • {priceMin === priceMax ? ( @@ -143,10 +178,10 @@ class RawOfferItem extends Component {
  • diff --git a/src/components/pages/Offers/OfferItem/index.jsx b/src/components/pages/Offers/OfferItem/index.jsx index 1c955b9193..c91d2671fd 100644 --- a/src/components/pages/Offers/OfferItem/index.jsx +++ b/src/components/pages/Offers/OfferItem/index.jsx @@ -11,7 +11,7 @@ import selectStocksByOfferId from 'selectors/selectStocksByOfferId' import selectThingById from 'selectors/selectThingById' import selectThumbUrlByOfferIdAndEventIdAndThingId from 'selectors/selectThumbUrlByOfferIdAndEventIdAndThingId' import selectVenueById from 'selectors/selectVenueById' -import offerrerSelector from 'selectors/selectOffererById' +import offererSelector from 'selectors/selectOffererById' import { getOfferTypeLabel } from 'utils/offerItem' function mapStateToProps(state, ownProps) { @@ -20,7 +20,8 @@ function mapStateToProps(state, ownProps) { const event = selectEventById(state, eventId) const thing = selectThingById(state, thingId) const venue = selectVenueById(state, venueId) - const offerrer = offerrerSelector(state, venue.managingOffererId) + const offerer = offererSelector(state, venue.managingOffererId) + return { aggregatedStock: selectAggregatedStockByOfferId(state, offerId), event, @@ -36,7 +37,7 @@ function mapStateToProps(state, ownProps) { ), offerTypeLabel: getOfferTypeLabel(event, thing), venue, - offerrer, + offerrer: offerer, } } diff --git a/src/components/pages/Offers/OfferItem/tests/RawOfferItem.spec.jsx b/src/components/pages/Offers/OfferItem/tests/RawOfferItem.spec.jsx index 024ce92b31..88a556eb68 100644 --- a/src/components/pages/Offers/OfferItem/tests/RawOfferItem.spec.jsx +++ b/src/components/pages/Offers/OfferItem/tests/RawOfferItem.spec.jsx @@ -1,74 +1,59 @@ import React from 'react' -import { shallow } from 'enzyme' +import { mount, shallow } from 'enzyme' +import offersMock from '../../tests/offersMock' +import { Icon, pluralize } from 'pass-culture-shared' + +import { NavLink } from 'react-router-dom' +import Dotdotdot from 'react-dotdotdot' +import Thumb from 'components/layout/Thumb' import RawOfferItem from '../RawOfferItem' -import mockedOffers from '../../tests/offersMock' describe('src | components | pages | Offers | RawOfferItem', () => { - const dispatchMock = jest.fn() - const initialProps = { - dispatch: dispatchMock, - offer: mockedOffers[0], - location: { - search: '?orderBy=offer.id+desc', - }, - } + let dispatch = jest.fn() + let props + + beforeEach(() => { + props = { + dispatch: dispatch, + offer: offersMock[0], + location: { + search: '?orderBy=offer.id+desc', + }, + } + }) describe('snapshot', () => { it('should match snapshot', () => { - // given - const wrapper = shallow() + // when + const wrapper = shallow() // then expect(wrapper).toBeDefined() expect(wrapper).toMatchSnapshot() - dispatchMock.mockClear() }) }) - describe('render', () => { - describe('when offer is new', () => { - // TO IMPLEMENT - }) - describe('When group size', () => { - // TO IMPLEMENT - }) - }) - - describe('functions', () => { - describe('onDeactivateClick', () => { - // when - const wrapper = shallow() - wrapper.instance().onDeactivateClick() - const expected = { + describe('click on "disable" button', () => { + it('should dispatch an action with the correct payload', () => { + // given + const wrapper = shallow() + const disableButton = wrapper.find('button') + const expectedParams = { config: { apiPath: '/offers/M4', - body: { - isActive: false, - }, + body: { isActive: false }, isMergingDatum: true, isMutaginArray: false, isMutatingDatum: true, method: 'PATCH', normalizer: { - event: { - normalizer: { - offers: 'offers', - }, - stateKey: 'events', - }, + event: { normalizer: { offers: 'offers' }, stateKey: 'events' }, mediations: 'mediations', stocks: 'stocks', - thing: { - normalizer: { - offers: 'offers', - }, - stateKey: 'things', - }, + thing: { normalizer: { offers: 'offers' }, stateKey: 'things' }, venue: { - normalizer: { - managingOfferer: 'offerers', - }, + normalizer: { managingOfferer: 'offerers' }, stateKey: 'venues', }, }, @@ -76,8 +61,399 @@ describe('src | components | pages | Offers | RawOfferItem', () => { type: 'REQUEST_DATA_PATCH_/OFFERS/M4', } + // when + disableButton.simulate('click') + + // then + expect(dispatch.mock.calls[0][0]).toEqual(expectedParams) + }) + }) + + describe('render offer item', () => { + it('should contain a Thumb Component with the right props', () => { + // given + props.thumbUrl = 'fake url' + + // when + const wrapper = shallow() + + // then + const thumbComponent = wrapper.find(Thumb) + expect(thumbComponent).toBeDefined() + expect(thumbComponent.prop('alt')).toBe('offre') + expect(thumbComponent.prop('src')).toBe('fake url') + }) + + it('should contain a Navlink Component with the right props and containing a DotDotDot component', () => { + // given + props.thing = { + name: 'fake name', + } + props.stocks = [] + + // when + const wrapper = shallow() + + // then + const navLinkComponent = wrapper.find(NavLink).first() + expect(navLinkComponent).toBeDefined() + expect(navLinkComponent.prop('className')).toBe('name') + expect(navLinkComponent.prop('to')).toBe( + '/offres/M4?orderBy=offer.id+desc' + ) + expect(navLinkComponent.prop('title')).toBe('fake name') + const dotdotdotComponent = navLinkComponent.find(Dotdotdot) + expect(dotdotdotComponent).toBeDefined() + expect(dotdotdotComponent.prop('clamp')).toBe(1) + expect(dotdotdotComponent.html()).toBe('
    fake name
    ') + }) + + it('should display informations of the type of offer, the offerer and the venue', () => { + // given + props.offerTypeLabel = 'a thing' + props.offerrer = { + name: 'UGC', + } + props.venue = { + name: 'Paris', + } + + // when + const wrapper = shallow() + // then - expect(dispatchMock.mock.calls[0][0]).toEqual(expected) + const offerInfosElement = wrapper.find('ul.infos').first() + const infosSubItems = offerInfosElement.find('li') + expect(infosSubItems).toHaveLength(3) + + expect(infosSubItems.at(0).prop('className')).toBe('is-uppercase') + expect(infosSubItems.at(0).text()).toBe('a thing') + expect(infosSubItems.at(1).text()).toBe('Structure : UGC') + expect(infosSubItems.at(2).text()).toBe('Lieu : Paris') + }) + + it('should display informations of the type of offer, the offerer and the venue', () => { + // given + props.offerTypeLabel = 'a thing' + props.offerrer = { + name: 'UGC', + } + props.venue = { + name: 'Paris', + } + + // when + const wrapper = shallow() + + // then + const offerInfosElement = wrapper.find('ul.infos').first() + const infosSubItems = offerInfosElement.find('li') + expect(infosSubItems).toHaveLength(3) + + expect(infosSubItems.at(0).prop('className')).toBe('is-uppercase') + expect(infosSubItems.at(0).text()).toBe('a thing') + expect(infosSubItems.at(1).text()).toBe('Structure : UGC') + expect(infosSubItems.at(2).text()).toBe('Lieu : Paris') + }) + + it('should display the number of participants eligible to the offer and user picto when 1 participant', () => { + // given + props.aggregatedStock = { + available: 0, + groupSizeMin: 1, + groupSizeMax: 5, + priceMin: 0, + priceMax: 0, + } + + // when + const wrapper = shallow() + + // then + const offerInfosElement = wrapper.find('ul.infos').at(1) + const offerInfosSubElements = offerInfosElement.find('li') + expect(offerInfosSubElements.at(0).prop('title')).toBe( + 'entre 1 et 5 personnes' + ) + + const userPictoComponent = offerInfosSubElements.at(0).find(Icon) + expect(userPictoComponent).toBeDefined() + expect(userPictoComponent.prop('svg')).toBe('picto-user') + }) + + it('should display the number of participants eligible to the offer and group picto when more than 1 participants', () => { + // given + props.aggregatedStock = { + available: 0, + groupSizeMin: 2, + groupSizeMax: 5, + priceMin: 0, + priceMax: 0, + } + + // when + const wrapper = shallow() + + // then + const offerInfosElement = wrapper.find('ul.infos').at(1) + const offerInfosSubElements = offerInfosElement.find('li') + expect(offerInfosSubElements.at(0).prop('title')).toBe( + 'entre 2 et 5 personnes' + ) + + const userPictoComponent = offerInfosSubElements.at(0).find(Icon) + expect(userPictoComponent).toBeDefined() + expect(userPictoComponent.prop('svg')).toBe('picto-group') + }) + + describe('when offer is an event', () => { + it('should display the correct text when 0 ticket available', () => { + // given + props.event = { + offerType: { label: 'Conférence — Débat — Dédicace' }, + } + props.stocks = [] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = shallow() + + // then + const ulElements = wrapper.find('ul') + const stockAvailabilityElement = ulElements + .at(1) + .find('li') + .at(3) + expect(stockAvailabilityElement.text()).toBe('0 places') + }) + + it('should display the correct text when 1 ticket is available', () => { + // given + props.event = { + offerType: { label: 'Conférence — Débat — Dédicace' }, + } + props.stocks = [{}] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = shallow() + + // then + const ulElements = wrapper.find('ul') + const stockAvailabilityElement = ulElements + .at(1) + .find('li') + .at(3) + expect(stockAvailabilityElement.text()).toBe('encore 1 place') + }) + + it('should display the correct text when 2 tickets are available', () => { + // given + props.event = { + offerType: { label: 'Conférence — Débat — Dédicace' }, + } + props.stocks = [{}, {}] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = shallow() + + // then + const ulElements = wrapper.find('ul') + const stockAvailabilityElement = ulElements + .at(1) + .find('li') + .at(3) + expect(stockAvailabilityElement.text()).toBe('encore 2 places') + }) + + it('should display the correct text "2 dates" on the link redirecting to the offer management', () => { + // given + const options = { + context: { + router: { + history: { + push: jest.fn(), + replace: jest.fn(), + createHref: jest.fn(), + }, + route: { + location: {}, + match: {}, + }, + }, + }, + childContextTypes: { + router: jest.fn(), + }, + } + props.event = { + offerType: { label: 'Conférence — Débat — Dédicace' }, + } + props.stocks = [{}, {}] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = mount(, options) + + // then + const ulElements = wrapper.find('ul') + const navLinkComponent = ulElements + .at(1) + .find('li') + .at(1) + .find(NavLink) + expect(navLinkComponent.prop('className')).toBe('has-text-primary') + expect(navLinkComponent.prop('to')).toBe('/offres/1M?gestion') + expect(navLinkComponent.text()).toBe('2 dates') + }) + }) + + describe('when offer is a thing', () => { + it('should display the correct text when 0 thing is available', () => { + // given + props.thing = { + offerType: { label: 'Une place de cinéma' }, + } + props.stocks = [] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: null, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: 42, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = shallow() + + // then + const ulElements = wrapper.find('ul') + const stockAvailabilityElement = ulElements + .at(1) + .find('li') + .at(3) + expect(stockAvailabilityElement.text()).toBe('0 en stock') + }) + + it('should display the correct text "1 prix" on the link redirecting to the offer management', () => { + // given + const options = { + context: { + router: { + history: { + push: jest.fn(), + replace: jest.fn(), + createHref: jest.fn(), + }, + route: { + location: {}, + match: {}, + }, + }, + }, + childContextTypes: { + router: jest.fn(), + }, + } + props.thing = { + offerType: { label: 'Une place de cinéma' }, + } + props.stocks = [{}] + props.offer = { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + } + + // when + const wrapper = mount(, options) + + // then + const ulElements = wrapper.find('ul') + const navLinkComponent = ulElements + .at(1) + .find('li') + .at(1) + .find(NavLink) + expect(navLinkComponent.prop('className')).toBe('has-text-primary') + expect(navLinkComponent.prop('to')).toBe('/offres/1M?gestion') + expect(navLinkComponent.text()).toBe('1 prix') + }) }) }) }) diff --git a/src/components/pages/Offers/OfferItem/tests/__snapshots__/RawOfferItem.spec.jsx.snap b/src/components/pages/Offers/OfferItem/tests/__snapshots__/RawOfferItem.spec.jsx.snap index 2395a91f9a..106d1b07ae 100644 --- a/src/components/pages/Offers/OfferItem/tests/__snapshots__/RawOfferItem.spec.jsx.snap +++ b/src/components/pages/Offers/OfferItem/tests/__snapshots__/RawOfferItem.spec.jsx.snap @@ -79,7 +79,7 @@ ShallowWrapper { - Structure : + Structure :
  • @@ -106,14 +106,10 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • -
  • - 0 place - -
  • - Structure : + Structure :
  • @@ -244,14 +240,10 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • -
  • - 0 place - -
  • - Structure : + Structure :
  • ,
  • @@ -397,7 +389,7 @@ ShallowWrapper { - Structure : + Structure : , undefined, ], @@ -409,11 +401,11 @@ ShallowWrapper { "key": undefined, "nodeType": "host", "props": Object { - "children": "Structure :", + "children": "Structure : ", "className": "label", }, "ref": null, - "rendered": "Structure :", + "rendered": "Structure : ", "type": "span", }, undefined, @@ -477,14 +469,12 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • ,
  • , -
  • - 0 place - -
  • , + undefined, + undefined,
  • - undefined prix + , }, "ref": null, @@ -539,12 +529,18 @@ ShallowWrapper { "props": Object { "activeClassName": "active", "aria-current": "page", - "children": "undefined prix", + "children": Array [ + undefined, + undefined, + ], "className": "has-text-primary", "to": "/offres/M4?gestion", }, "ref": null, - "rendered": "undefined prix", + "rendered": Array [ + undefined, + undefined, + ], "type": [Function], }, "type": "li", @@ -560,23 +556,8 @@ ShallowWrapper { "rendered": null, "type": "li", }, - Object { - "instance": null, - "key": undefined, - "nodeType": "host", - "props": Object { - "children": Array [ - "0 place", - " ", - ], - }, - "ref": null, - "rendered": Array [ - "0 place", - " ", - ], - "type": "li", - }, + undefined, + undefined, Object { "instance": null, "key": undefined, @@ -910,7 +891,7 @@ ShallowWrapper { - Structure : + Structure :
  • @@ -937,14 +918,10 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • -
  • - 0 place - -
  • - Structure : + Structure :
  • @@ -1075,14 +1052,10 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • -
  • - 0 place - -
  • - Structure : + Structure :
  • ,
  • @@ -1228,7 +1201,7 @@ ShallowWrapper { - Structure : + Structure : , undefined, ], @@ -1240,11 +1213,11 @@ ShallowWrapper { "key": undefined, "nodeType": "host", "props": Object { - "children": "Structure :", + "children": "Structure : ", "className": "label", }, "ref": null, - "rendered": "Structure :", + "rendered": "Structure : ", "type": "span", }, undefined, @@ -1308,14 +1281,12 @@ ShallowWrapper { className="has-text-primary" to="/offres/M4?gestion" > - undefined prix +
  • ,
  • , -
  • - 0 place - -
  • , + undefined, + undefined,
  • - undefined prix + , }, "ref": null, @@ -1370,12 +1341,18 @@ ShallowWrapper { "props": Object { "activeClassName": "active", "aria-current": "page", - "children": "undefined prix", + "children": Array [ + undefined, + undefined, + ], "className": "has-text-primary", "to": "/offres/M4?gestion", }, "ref": null, - "rendered": "undefined prix", + "rendered": Array [ + undefined, + undefined, + ], "type": [Function], }, "type": "li", @@ -1391,23 +1368,8 @@ ShallowWrapper { "rendered": null, "type": "li", }, - Object { - "instance": null, - "key": undefined, - "nodeType": "host", - "props": Object { - "children": Array [ - "0 place", - " ", - ], - }, - "ref": null, - "rendered": Array [ - "0 place", - " ", - ], - "type": "li", - }, + undefined, + undefined, Object { "instance": null, "key": undefined, diff --git a/src/components/pages/Offers/tests/offersMock.jsx b/src/components/pages/Offers/tests/offersMock.jsx index a74df99da0..9ca1b93243 100644 --- a/src/components/pages/Offers/tests/offersMock.jsx +++ b/src/components/pages/Offers/tests/offersMock.jsx @@ -74,6 +74,21 @@ const mockedOffers = [ mediationsIds: ['EY'], stocksIds: ['JQ'], }, + { + id: '1M', + bookingEmail: 'booking.email@test.com', + dateCreated: '2019-02-25T09:50:10.735519Z', + dateModifiedAtLastProvider: '2019-02-25T09:50:31.598542Z', + eventId: 42, + idAtProviders: null, + isActive: true, + lastProviderId: null, + modelName: 'Offer', + thingId: null, + venueId: 'BE', + mediationsIds: ['EY'], + stocksIds: ['JQ'], + }, ] export default mockedOffers