File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
test/e2e-cypress/tests/bugs Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ const getExampleComponent = ( sampleResponse, HighlightCode ) => {
1010 sampleResponse !== undefined &&
1111 sampleResponse !== null
1212 ) { return < div >
13- < HighlightCode className = "example" value = { sampleResponse } />
13+ < HighlightCode className = "example" value = { stringify ( sampleResponse ) } />
1414 </ div >
1515 }
1616 return null
Original file line number Diff line number Diff line change 11// http://github.com/swagger-api/swagger-ui/issues/5458
22
3+ const expectedValue = `{
4+ "foo": "custom value"
5+ }`
6+
37describe ( "#5458: Swagger 2.0 `Response.examples` mappings" , ( ) => {
48 it ( "should render a custom example when a schema is not defined" , ( ) => {
59 cy . visit ( "/?url=/documents/bugs/5458.yaml" )
610 . get ( "#operations-default-get_foo1" )
711 . click ( )
812 . get ( ".model-example .highlight-code" )
9- . contains ( "custom value" )
13+ . contains ( expectedValue )
1014 } )
1115 it ( "should render a custom example when a schema is defined" , ( ) => {
1216 cy . visit ( "/?url=/documents/bugs/5458.yaml" )
1317 . get ( "#operations-default-get_foo2" )
1418 . click ( )
1519 . get ( ".model-example .highlight-code" )
16- . contains ( "custom value" )
20+ . contains ( expectedValue )
1721 } )
1822} )
You can’t perform that action at this time.
0 commit comments