From 7c5b14478d38d6b4116fe4601a51bc1d58addc37 Mon Sep 17 00:00:00 2001 From: Marc Cuva Date: Mon, 25 Feb 2019 10:54:23 -0800 Subject: [PATCH] Make /reference-edit use the baseUrl prop --- packages/api-explorer/__tests__/Doc.test.jsx | 9 +++++++++ packages/api-explorer/src/Doc.jsx | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/api-explorer/__tests__/Doc.test.jsx b/packages/api-explorer/__tests__/Doc.test.jsx index 268a2e27b..fa2ee2834 100644 --- a/packages/api-explorer/__tests__/Doc.test.jsx +++ b/packages/api-explorer/__tests__/Doc.test.jsx @@ -271,6 +271,15 @@ describe('suggest edits', () => { const doc = shallow(); expect(doc.find('a.hub-reference-edit.pull-right').length).toBe(1); }); + + test('should have child project if baseUrl is set', () => { + const doc = shallow( + , + ); + expect(doc.find('a.hub-reference-edit.pull-right').prop('href')).toBe( + `/child/reference-edit/${props.doc.slug}`, + ); + }); }); describe('Response Schema', () => { diff --git a/packages/api-explorer/src/Doc.jsx b/packages/api-explorer/src/Doc.jsx index c926cde9b..af4a0236a 100644 --- a/packages/api-explorer/src/Doc.jsx +++ b/packages/api-explorer/src/Doc.jsx @@ -343,7 +343,10 @@ class Doc extends React.Component {
{this.props.suggestedEdits && ( // eslint-disable-next-line jsx-a11y/href-no-hash - + Suggest Edits