@@ -17,14 +17,6 @@ import { evaluateAtNameKey } from '../../../utils/aria.js';
17
17
import commandsJson from '../../../resources/commands.json' ;
18
18
import supportJson from '../../../resources/support.json' ;
19
19
20
- const Container = styled . div `
21
- padding: 20px;
22
- ` ;
23
-
24
- const Heading = styled . h2 `
25
- margin: 0 0 0.5em 0;
26
- ` ;
27
-
28
20
const NumberedList = styled . ol `
29
21
counter-reset: numbered-list;
30
22
list-style: none;
@@ -53,12 +45,12 @@ const NumberedList = styled.ol`
53
45
` ;
54
46
55
47
const InstructionsRenderer = ( {
56
- testResult ,
48
+ test ,
57
49
testPageUrl,
58
50
at,
59
- testFormatVersion = 1
51
+ headingLevel = 2 ,
52
+ testFormatVersion
60
53
} ) => {
61
- const { test = { } } = testResult ;
62
54
const { renderableContent } = test ;
63
55
const [ testRunExport , setTestRunExport ] = useState ( ) ;
64
56
const [ pageContent , setPageContent ] = useState ( {
@@ -171,8 +163,10 @@ const InstructionsRenderer = ({
171
163
const assertions = [ ...pageContent . instructions . assertions . assertions ] ;
172
164
const assertionsContent = parseListContent ( assertions ) ;
173
165
166
+ const Heading = `h${ headingLevel } ` ;
167
+
174
168
return (
175
- < Container >
169
+ < >
176
170
< NumberedList > { allInstructionsContent } </ NumberedList >
177
171
< Heading > { pageContent . instructions . assertions . header } </ Heading >
178
172
{ pageContent . instructions . assertions . description }
@@ -183,19 +177,18 @@ const InstructionsRenderer = ({
183
177
>
184
178
{ pageContent . instructions . openTestPage . button }
185
179
</ Button >
186
- </ Container >
180
+ </ >
187
181
) ;
188
182
} ;
189
183
190
184
InstructionsRenderer . propTypes = {
191
- testResult : PropTypes . shape ( {
192
- test : PropTypes . object . isRequired
193
- } ) ,
185
+ test : PropTypes . object . isRequired ,
194
186
testPageUrl : PropTypes . string ,
195
187
at : PropTypes . shape ( {
196
188
name : PropTypes . string . isRequired
197
189
} ) ,
198
- testFormatVersion : PropTypes . number
190
+ testFormatVersion : PropTypes . number ,
191
+ headingLevel : PropTypes . number
199
192
} ;
200
193
201
194
export default InstructionsRenderer ;
0 commit comments