Skip to content

Commit 58caaad

Browse files
committed
Update existing tests to handle changes in Select
mongodb/leafygreen-ui#3218
1 parent 161dbb8 commit 58caaad

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/match/match-condition-form.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ describe('condition', function () {
7373
renderCondition({ condition });
7474
expect(screen.getByLabelText(new RegExp(SINGLE_SELECT_LABEL, 'i'))).to
7575
.exist;
76-
expect(screen.getByLabelText(LABELS.operatorSelect)).to.exist;
76+
expect(screen.getByTestId('match-condition-operator-select')).to.exist;
7777
expect(screen.getByTestId('match-stage-expected-value-input')).to.exist;
78-
expect(screen.getByLabelText(LABELS.typeSelect)).to.exist;
78+
expect(screen.getByTestId('match-condition-type-select')).to.exist;
7979
});
8080

8181
it('should call onConditionChange with updated condition when a field is selected', function () {

packages/compass-aggregations/src/components/aggregation-side-panel/stage-wizard-use-cases/match/match-condition-form.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ const MatchConditionForm = ({
170170
aria-label={LABELS.operatorSelect}
171171
value={condition.operator}
172172
onChange={handleOperatorChange}
173+
data-testid="match-condition-operator-select"
173174
>
174175
{MATCH_OPERATOR_LABELS.map(({ operator, label }) => {
175176
return (
@@ -183,8 +184,6 @@ const MatchConditionForm = ({
183184
<div className={valueInputStyles}>
184185
<TextInput
185186
placeholder={LABELS.valueInput}
186-
// NOTE: LeafyGreen doesn't support aria-label and only understands "aria-labelledby" and "label".
187-
aria-labelledby=""
188187
data-testid="match-stage-expected-value-input"
189188
aria-label={LABELS.valueInput}
190189
value={condition.value}
@@ -198,6 +197,7 @@ const MatchConditionForm = ({
198197
aria-label={LABELS.typeSelect}
199198
value={condition.bsonType}
200199
onChange={handleBsonTypeChange}
200+
data-testid="match-condition-type-select"
201201
>
202202
{CASTABLE_TYPES.map((type) => (
203203
<Option key={type} value={`${type}`}>

0 commit comments

Comments
 (0)