File tree 5 files changed +17
-11
lines changed
5 files changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
8
8
## [ Unreleased]
9
9
### Fixed
10
10
- Make keyword spacing look right ([ #376 ] ( https://github.com/cucumber/react-components/pull/376 ) )
11
+ - Fix issue with hook steps not being rendered ([ #379 ] ( https://github.com/cucumber/react-components/pull/379 ) )
11
12
12
13
### Changed
13
14
- Inherit font-size instead of setting at 14px ([ #377 ] ( https://github.com/cucumber/react-components/pull/377 ) )
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import attachments from '../../../acceptance/attachments/attachments.feature.js'
6
6
import dataTables from '../../../acceptance/data-tables/data-tables.feature.js'
7
7
import examplesTables from '../../../acceptance/examples-tables/examples-tables.feature.js'
8
8
import hooks from '../../../acceptance/hooks/hooks.feature.js'
9
+ import hooksAttachments from '../../../acceptance/hooks-attachment/hooks-attachment.feature.js'
9
10
import markdown from '../../../acceptance/markdown/markdown.feature.md.js'
10
11
import minimal from '../../../acceptance/minimal/minimal.feature.js'
11
12
import parameterTypes from '../../../acceptance/parameter-types/parameter-types.feature.js'
@@ -57,6 +58,11 @@ Hooks.args = {
57
58
envelopes : hooks ,
58
59
}
59
60
61
+ export const HooksWithAttachments = Template . bind ( { } )
62
+ HooksWithAttachments . args = {
63
+ envelopes : hooksAttachments ,
64
+ }
65
+
60
66
export const Markdown = Template . bind ( { } )
61
67
Markdown . args = {
62
68
envelopes : markdown ,
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const DefaultRenderer: React.FunctionComponent<HookStepProps> = ({ step }) => {
39
39
)
40
40
}
41
41
42
- if ( attachments ) {
42
+ if ( attachments ?. length ) {
43
43
return (
44
44
< StepItem >
45
45
{ attachments . map ( ( attachment , i ) => (
Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ interface IProps {
10
10
export const HookSteps : React . FunctionComponent < IProps > = ( { hookSteps } ) => {
11
11
return (
12
12
< >
13
- { hookSteps
14
- . map ( ( step , index ) => < HookStep key = { index } step = { step } /> )
15
- . filter ( ( el ) => ! ! el . props . children ?. length )
16
- . map ( ( el , index ) => (
17
- < li key = { index } > { el } </ li >
18
- ) ) }
13
+ { hookSteps . map ( ( step , index ) => (
14
+ < li key = { index } >
15
+ < HookStep key = { index } step = { step } />
16
+ </ li >
17
+ ) ) }
19
18
</ >
20
19
)
21
20
}
Original file line number Diff line number Diff line change 1
1
.steps {
2
2
padding : 0 ;
3
- margin : 1em ;
3
+ margin : 0.875 em 1em ;
4
4
5
5
> li {
6
6
list-style : none ;
7
- }
8
7
9
- > li + li {
10
- margin-top : 0.25em ;
8
+ & :not (:empty ) {
9
+ padding : 0.125em 0 ;
10
+ }
11
11
}
12
12
}
You can’t perform that action at this time.
0 commit comments