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';
10
10
import { httpServiceWithUnnamedServers } from '../../../__fixtures__/services/with-unnamed-servers' ;
11
11
import { httpServiceWithUrlVariables } from '../../../__fixtures__/services/with-url-variables' ;
12
12
import { httpServiceWithoutOrigin } from '../../../__fixtures__/services/without-origin' ;
13
+ import { ElementsOptionsProvider } from '../../../context/Options' ;
13
14
import { AdditionalInfo } from './AdditionalInfo' ;
14
15
import { HttpService } from './index' ;
15
16
import { SecuritySchemes } from './SecuritySchemes' ;
@@ -426,4 +427,18 @@ describe('useSplitUrl hook', () => {
426
427
{ kind : 'static' , value : '.stoplight.io{test' } ,
427
428
] ) ;
428
429
} ) ;
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
+ } ) ;
429
444
} ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import { AdditionalInfo } from './AdditionalInfo';
15
15
import { ExportButton } from './ExportButton' ;
16
16
import { SecuritySchemes } from './SecuritySchemes' ;
17
17
import { ServerInfo } from './ServerInfo' ;
18
+ import { NodeVendorExtensions } from '../NodeVendorExtensions' ;
18
19
19
20
export type HttpServiceProps = DocsComponentProps < Partial < IHttpService > > ;
20
21
@@ -91,6 +92,8 @@ const HttpServiceComponent = React.memo<HttpServiceProps>(
91
92
< NodeAnnotation change = { descriptionChanged } />
92
93
</ Box >
93
94
) }
95
+
96
+ < NodeVendorExtensions data = { data } />
94
97
</ Box >
95
98
) ;
96
99
} ,
You can’t perform that action at this time.
0 commit comments