Skip to content

Commit 2bc14de

Browse files
committed
fix: update Cypress test for corrected create option test ID
The previous code had a typo (Option.name instead of createOption.name) that made the create option data-testid always resolve to "Option". Update the test selector to match the corrected test ID. Also remove unnecessary useMemo around createOptionDisplayName.
1 parent 3a742c5 commit 2bc14de

2 files changed

Lines changed: 5 additions & 8 deletions

File tree

frontend/src/components/MultiSelection.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,11 @@ export const MultiSelection: React.FC<MultiSelectionProps> = ({
151151
return undefined;
152152
}, [inputValue, isCreatable, allValues]);
153153

154-
const createOptionDisplayName = React.useMemo(() => {
155-
if (!createOption) {
156-
return undefined;
157-
}
158-
return typeof createOptionMessage === 'string'
154+
const createOptionDisplayName = createOption
155+
? typeof createOptionMessage === 'string'
159156
? createOptionMessage
160-
: createOptionMessage(createOption.name);
161-
}, [createOption, createOptionMessage]);
157+
: createOptionMessage(createOption.name)
158+
: undefined;
162159

163160
const allOptions = React.useMemo(() => {
164161
const options = [...allValues];

packages/cypress/cypress/tests/mocked/connectionTypes/createConnectionType.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('create', () => {
5959

6060
categorySection.findMultiGroupInput().type('New category');
6161

62-
categorySection.findMultiGroupSelectButton('Option').click();
62+
categorySection.findMultiGroupSelectButton('New-category').click();
6363
categorySection.findChipItem('New category').should('exist');
6464
categorySection.findMultiGroupInput().type('{esc}');
6565

0 commit comments

Comments
 (0)