@@ -20,7 +20,7 @@ export const Components: React.FunctionComponent<Props> = props => {
20
20
"This is the topic which you need to subscribe the related module to." ;
21
21
22
22
return (
23
- < div className = "components" >
23
+ < div className = "components" data-testid = "components" >
24
24
< Query < GetThingsFromGroupIdQuery , GetThingsFromGroupIdVariables >
25
25
query = { getThingsFromGroupId }
26
26
variables = { {
@@ -35,31 +35,45 @@ export const Components: React.FunctionComponent<Props> = props => {
35
35
data . getThingsFromGroupId . length === 0
36
36
) {
37
37
return (
38
- < div className = "component no-component" >
38
+ < div
39
+ className = "component no-component"
40
+ data-testid = "no-component"
41
+ >
39
42
< span > You have no components yet</ span >
40
43
</ div >
41
44
) ;
42
45
}
43
46
return (
44
47
< >
45
48
{ help ? (
46
- < div className = "help-box" >
49
+ < div className = "help-box" data-testid = "help-box" >
47
50
< span > { helpText } </ span >
48
51
</ div >
49
52
) : null }
50
53
{ data . getThingsFromGroupId . map ( ( thing , i ) => {
51
54
return (
52
55
< React . Fragment key = { i } >
53
56
< Link to = { thing . topic } >
54
- < div className = "component" key = { i } >
55
- < div className = "component-space" >
57
+ < div
58
+ className = "component"
59
+ key = { i }
60
+ data-testid = { `component-${ i } ` }
61
+ >
62
+ < div
63
+ className = "component-space"
64
+ data-testid = { `component-space-${ i } ` }
65
+ >
56
66
< span > { thing . space } </ span >
57
67
</ div >
58
- < div className = "component-itself" >
68
+ < div
69
+ className = "component-itself"
70
+ data-testid = { `component-itself-${ i } ` }
71
+ >
59
72
< span > { thing . component } </ span >
60
73
</ div >
61
74
< div
62
75
className = "component-topic"
76
+ data-testid = { `component-topic-${ i } ` }
63
77
onMouseEnter = { ( ) => setHelp ( true ) }
64
78
onMouseLeave = { ( ) => setHelp ( false ) }
65
79
>
0 commit comments