File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
packages/elements-core/src/components/Docs/HttpService Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import httpService from '../../../__fixtures__/services/petstore';
1010import { httpServiceWithUnnamedServers } from '../../../__fixtures__/services/with-unnamed-servers' ;
1111import { httpServiceWithUrlVariables } from '../../../__fixtures__/services/with-url-variables' ;
1212import { httpServiceWithoutOrigin } from '../../../__fixtures__/services/without-origin' ;
13+ import { ElementsOptionsProvider } from '../../../context/Options' ;
1314import { AdditionalInfo } from './AdditionalInfo' ;
1415import { HttpService } from './index' ;
1516import { SecuritySchemes } from './SecuritySchemes' ;
@@ -426,4 +427,18 @@ describe('useSplitUrl hook', () => {
426427 { kind : 'static' , value : '.stoplight.io{test' } ,
427428 ] ) ;
428429 } ) ;
430+
431+ it ( 'HttpService renders NodeVendorExtensions' , ( ) => {
432+ const wrapper = render (
433+ < Router >
434+ < MosaicProvider >
435+ < ElementsOptionsProvider renderExtensionAddon = { ( ) => < div > Vendor Extensions</ div > } >
436+ < HttpService data = { { ...httpService , extensions : { [ 'x-test-extension' ] : 'test' } } } />
437+ </ ElementsOptionsProvider >
438+ </ MosaicProvider >
439+ </ Router > ,
440+ ) ;
441+
442+ expect ( wrapper . getByText ( 'Vendor Extensions' ) ) . toBeInTheDocument ( ) ;
443+ } ) ;
429444} ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { AdditionalInfo } from './AdditionalInfo';
1515import { ExportButton } from './ExportButton' ;
1616import { SecuritySchemes } from './SecuritySchemes' ;
1717import { ServerInfo } from './ServerInfo' ;
18+ import { NodeVendorExtensions } from '../NodeVendorExtensions' ;
1819
1920export type HttpServiceProps = DocsComponentProps < Partial < IHttpService > > ;
2021
@@ -91,6 +92,8 @@ const HttpServiceComponent = React.memo<HttpServiceProps>(
9192 < NodeAnnotation change = { descriptionChanged } />
9293 </ Box >
9394 ) }
95+
96+ < NodeVendorExtensions data = { data } />
9497 </ Box >
9598 ) ;
9699 } ,
You can’t perform that action at this time.
0 commit comments