diff --git a/src/containers/ListingPage/ListingPage.js b/src/containers/ListingPage/ListingPage.js index 6c2c263c..a634e7fb 100644 --- a/src/containers/ListingPage/ListingPage.js +++ b/src/containers/ListingPage/ListingPage.js @@ -167,6 +167,7 @@ export class ListingPageComponent extends Component { sendVerificationEmailInProgress, sendVerificationEmailError, onResendVerificationEmail, + flattenedRoutes, } = this.props; const listingId = new UUID(params.id); const currentListing = ensureListing(getListing(listingId)); @@ -344,6 +345,10 @@ export class ListingPageComponent extends Component { { title, price: formattedPrice, siteTitle } ); + const canonicalPath = createResourceLocatorString('ListingPageCanonical', flattenedRoutes, { + id: listingId.uuid, + }); + return ( { const listing1 = createListing('listing1', {}, { author: createUser('user-1') }); const getListing = () => listing1; const props = { - flattenedRoutes: [], + flattenedRoutes: [ + // Fake route since a circular dependency prevents using the + // full routesConfiguration here + { + path: '/l/:id', + exact: true, + name: 'ListingPageCanonical', + component: noop, + }, + ], location: { search: '' }, history: { push: () => console.log('HistoryPush called'), diff --git a/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap b/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap index b7b25c7f..e8945c6e 100644 --- a/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap +++ b/src/containers/ListingPage/__snapshots__/ListingPage.test.js.snap @@ -2,6 +2,7 @@ exports[`ListingPage matches snapshot 1`] = `