Skip to content

Commit d45c058

Browse files
authored
fix: test ids (#4111)
1 parent 5623292 commit d45c058

File tree

7 files changed

+22
-22
lines changed

7 files changed

+22
-22
lines changed

src/writeData/subscriptions/components/EmptySubscriptionState.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const EmptySubscriptionState: FC = () => {
3737
}}
3838
status={ComponentStatus.Default}
3939
titleText=""
40-
testID="create-subscription-button"
40+
testID="create-subscription-button--empty"
4141
/>
4242
</EmptyState>
4343
)

src/writeData/subscriptions/components/JsonParsingForm.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
7777
updateForm({...formContent})
7878
}}
7979
maxLength={56}
80-
testID="json-parsing--timestamp"
80+
testID="timestamp-json-parsing"
8181
/>
8282
</Grid.Column>
8383
<Grid.Column>
@@ -125,7 +125,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
125125
}}
126126
status={status}
127127
maxLength={16}
128-
testID="json-parsing--name"
128+
testID="measurement-json-parsing-name"
129129
/>
130130
)}
131131
</Form.ValidationElement>
@@ -136,7 +136,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
136136
<Dropdown.Button
137137
active={active}
138138
onClick={onClick}
139-
testID="variable-type-dropdown--button"
139+
testID="measurement-json-parsing-type"
140140
>
141141
{dataTypeM}
142142
</Dropdown.Button>
@@ -153,7 +153,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
153153
formContent.jsonMeasurementKey.type = d
154154
}}
155155
selected={dataTypeM === d}
156-
testID={`variable-type-dropdown-${1}`}
156+
testID={`measurement-json-parsing-type-${1}`}
157157
>
158158
{d}
159159
</Dropdown.Item>
@@ -189,7 +189,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
189189
}}
190190
status={status}
191191
maxLength={56}
192-
testID="json-parsing--jsonpath"
192+
testID="measurement-json-parsing-path"
193193
/>
194194
)}
195195
</Form.ValidationElement>
@@ -219,7 +219,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
219219
<Dropdown.Button
220220
active={active}
221221
onClick={onClick}
222-
testID="variable-type-dropdown--button"
222+
testID="json-parsing-add-rule"
223223
>
224224
<Icon glyph={IconFont.Plus} /> Add Rule
225225
</Dropdown.Button>
@@ -235,7 +235,7 @@ const JsonParsingForm: FC<Props> = ({formContent, updateForm}) => {
235235
setRule(r)
236236
}}
237237
selected={rule === r}
238-
testID={`variable-type-dropdown-${1}`}
238+
testID={`json-parsing-add-rule-${1}`}
239239
>
240240
{r}
241241
</Dropdown.Item>

src/writeData/subscriptions/components/JsonPathInput.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const JsonPathInput: FC<Props> = ({name, formContent, updateForm, itemNum}) => {
6767
updateForm({...formContent})
6868
}}
6969
confirmationButtonText="Confirm"
70-
testID="json-delete-label"
70+
testID={`${tagType}-json-delete-label`}
7171
/>
7272
)}
7373
</div>
@@ -113,7 +113,7 @@ const JsonPathInput: FC<Props> = ({name, formContent, updateForm, itemNum}) => {
113113
}}
114114
status={status}
115115
maxLength={16}
116-
testID="json-parsing--name"
116+
testID={`${tagType}-json-parsing-name`}
117117
/>
118118
)}
119119
</Form.ValidationElement>
@@ -124,7 +124,7 @@ const JsonPathInput: FC<Props> = ({name, formContent, updateForm, itemNum}) => {
124124
<Dropdown.Button
125125
active={active}
126126
onClick={onClick}
127-
testID="variable-type-dropdown--button"
127+
testID={`${tagType}-json-parsing-type`}
128128
>
129129
{dataType}
130130
</Dropdown.Button>
@@ -143,7 +143,7 @@ const JsonPathInput: FC<Props> = ({name, formContent, updateForm, itemNum}) => {
143143
: (formContent.jsonFieldKeys[itemNum].type = d)
144144
}}
145145
selected={dataType === d}
146-
testID={`variable-type-dropdown-${1}`}
146+
testID={`${tagType}-json-parsing-type-${1}`}
147147
>
148148
{d}
149149
</Dropdown.Item>
@@ -191,7 +191,7 @@ const JsonPathInput: FC<Props> = ({name, formContent, updateForm, itemNum}) => {
191191
}}
192192
status={status}
193193
maxLength={16}
194-
testID="json-parsing--jsonpath"
194+
testID={`${tagType}-json-parsing-path`}
195195
/>
196196
)}
197197
</Form.ValidationElement>

src/writeData/subscriptions/components/StringParsingForm.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const StringParsingForm: FC<Props> = ({formContent, updateForm}) => {
7272
updateForm({...formContent})
7373
}}
7474
maxLength={56}
75-
testID="string-parsing--timestamp"
75+
testID="timestamp-string-parsing"
7676
/>
7777
</Grid.Column>
7878
<Grid.Column>
@@ -111,7 +111,7 @@ const StringParsingForm: FC<Props> = ({formContent, updateForm}) => {
111111
}}
112112
status={status}
113113
maxLength={56}
114-
testID="string-parsing--regex"
114+
testID="measurment-string-parsing-pattern"
115115
/>
116116
)}
117117
</Form.ValidationElement>
@@ -141,7 +141,7 @@ const StringParsingForm: FC<Props> = ({formContent, updateForm}) => {
141141
<Dropdown.Button
142142
active={active}
143143
onClick={onClick}
144-
testID="variable-type-dropdown--button"
144+
testID="string-parsing-add-rule"
145145
>
146146
<Icon glyph={IconFont.Plus} /> Add Rule
147147
</Dropdown.Button>
@@ -157,7 +157,7 @@ const StringParsingForm: FC<Props> = ({formContent, updateForm}) => {
157157
setRule(r)
158158
}}
159159
selected={rule === r}
160-
testID={`variable-type-dropdown-${1}`}
160+
testID={`string-parsing-add-rule-${1}`}
161161
>
162162
{r}
163163
</Dropdown.Item>

src/writeData/subscriptions/components/StringPatternInput.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const StringPatternInput: FC<Props> = ({
7474
updateForm({...formContent})
7575
}}
7676
confirmationButtonText="Confirm"
77-
testID="json-delete-label"
77+
testID={`${name}-string-delete-label`}
7878
/>
7979
)}
8080
</FlexBox>
@@ -114,7 +114,7 @@ const StringPatternInput: FC<Props> = ({
114114
}}
115115
status={status}
116116
maxLength={16}
117-
testID="json-parsing--name"
117+
testID={`${name}-string-parsing-name`}
118118
/>
119119
)}
120120
</Form.ValidationElement>
@@ -156,7 +156,7 @@ const StringPatternInput: FC<Props> = ({
156156
}}
157157
status={status}
158158
maxLength={56}
159-
testID="string-parsing--regex"
159+
testID={`${name}-string-parsing-pattern`}
160160
/>
161161
)}
162162
</Form.ValidationElement>

src/writeData/subscriptions/components/SubscriptionsLanding.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const SubscriptionsLanding: FC = () => {
7575
}}
7676
status={ComponentStatus.Default}
7777
titleText=""
78-
testID="create-subscription-button"
78+
testID="create-subscription-button--control-bar"
7979
/>
8080
</Page.ControlBarRight>
8181
</Page.ControlBar>

src/writeData/subscriptions/context/subscription.create.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const DEFAULT_CONTEXT: SubscriptionCreateContextType = {
6464
},
6565
stringMeasurement: {
6666
pattern: '',
67-
name: '',
67+
name: 'measurement',
6868
},
6969
stringFields: [
7070
{

0 commit comments

Comments
 (0)