File tree Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Expand file tree Collapse file tree 4 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ const Headers = ( { headers } )=>{
7
7
return (
8
8
< div >
9
9
< h5 > Response headers</ h5 >
10
- < pre > { headers } </ pre >
10
+ < pre className = "microlight" > { headers } </ pre >
11
11
</ div > )
12
12
}
13
13
Headers . propTypes = {
@@ -18,7 +18,7 @@ const Duration = ( { duration } ) => {
18
18
return (
19
19
< div >
20
20
< h5 > Request duration</ h5 >
21
- < pre > { duration } ms</ pre >
21
+ < pre className = "microlight" > { duration } ms</ pre >
22
22
</ div >
23
23
)
24
24
}
@@ -75,7 +75,7 @@ export default class LiveResponse extends React.Component {
75
75
{ url && < div >
76
76
< h4 > Request URL</ h4 >
77
77
< div className = "request-url" >
78
- < pre > { url } </ pre >
78
+ < pre className = "microlight" > { url } </ pre >
79
79
</ div >
80
80
</ div >
81
81
}
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export default class ResponseBody extends React.PureComponent {
87
87
bodyEl = < div > < a href = { href } download = { download } > { "Download file" } </ a > </ div >
88
88
}
89
89
} else {
90
- bodyEl = < pre > Download headers detected but your browser does not support downloading binary via XHR (Blob).</ pre >
90
+ bodyEl = < pre className = "microlight" > Download headers detected but your browser does not support downloading binary via XHR (Blob).</ pre >
91
91
}
92
92
93
93
// Anything else (CORS)
@@ -123,7 +123,7 @@ export default class ResponseBody extends React.PureComponent {
123
123
124
124
// Audio
125
125
} else if ( / ^ a u d i o \/ / i. test ( contentType ) ) {
126
- bodyEl = < pre > < audio controls > < source src = { url } type = { contentType } /> </ audio > </ pre >
126
+ bodyEl = < pre className = "microlight" > < audio controls > < source src = { url } type = { contentType } /> </ audio > </ pre >
127
127
} else if ( typeof content === "string" ) {
128
128
bodyEl = < HighlightCode downloadable fileName = { `${ downloadName } .txt` } value = { content } />
129
129
} else if ( content . size > 0 ) {
Original file line number Diff line number Diff line change 596
596
}
597
597
}
598
598
599
- .opblock-body pre
599
+ .opblock-body pre .microlight
600
600
{
601
601
font-size : 12px ;
602
602
Original file line number Diff line number Diff line change @@ -43,8 +43,11 @@ describe("<LiveResponse/>", function(){
43
43
let response = fromJSOrdered ( {
44
44
status : 200 ,
45
45
url : "http://petstore.swagger.io/v2/pet/1" ,
46
- headers : { } ,
46
+ headers : {
47
+ "content-type" : "application/xml"
48
+ } ,
47
49
text : "<response/>" ,
50
+ duration : 50
48
51
} )
49
52
50
53
let mutatedRequestForSpy = createSpy ( ) . andReturn ( mutatedRequest )
@@ -81,8 +84,20 @@ describe("<LiveResponse/>", function(){
81
84
expect ( curl . props ( ) . request ) . toBe ( requests [ test . expected . request ] )
82
85
83
86
const expectedUrl = requests [ test . expected . request ] . get ( "url" )
84
- expect ( wrapper . find ( "div.request-url pre" ) . text ( ) ) . toEqual ( expectedUrl )
87
+ expect ( wrapper . find ( "div.request-url pre.microlight" ) . text ( ) ) . toEqual ( expectedUrl )
88
+
89
+ let duration = wrapper . find ( "Duration" )
90
+ expect ( duration . length ) . toEqual ( 1 )
91
+ expect ( duration . props ( ) . duration ) . toEqual ( 50 )
92
+ expect ( duration . html ( ) )
93
+ . toEqual ( "<div><h5>Request duration</h5><pre class=\"microlight\">50 ms</pre></div>" )
85
94
95
+ let responseHeaders = wrapper . find ( "Headers" )
96
+ expect ( duration . length ) . toEqual ( 1 )
97
+ expect ( responseHeaders . props ( ) . headers . length ) . toEqual ( 1 )
98
+ expect ( responseHeaders . props ( ) . headers [ 0 ] . key ) . toEqual ( "content-type" )
99
+ expect ( responseHeaders . html ( ) )
100
+ . toEqual ( "<div><h5>Response headers</h5><pre class=\"microlight\"><span class=\"headerline\"> content-type: application/xml </span></pre></div>" )
86
101
} )
87
102
} )
88
103
} )
You can’t perform that action at this time.
0 commit comments