Updated data-cy with review comments

This commit is contained in:
Srimanitejas123 2025-09-11 14:10:20 +05:30
parent 7e30956aa7
commit f7ea317b6f
3 changed files with 23 additions and 25 deletions

View file

@ -75,7 +75,7 @@ describe("Workflows features", () => {
});
// Need to run after bug fixes
it.only("Creating workflow inside Workflow and validating execution", () => {
it("Creating workflow inside Workflow and validating execution", () => {
cy.createWorkflowApp(data.childWFName);
enterJsonInputInStartNode();
cy.connectDataSourceNode(workflowsText.runjsNodeLabel);

View file

@ -52,6 +52,7 @@ export function Workflows({ options, optionsChanged, currentState }) {
return (
<>
<label className="mb-1">Workflow</label>
<div data-cy="workflow-dropdown"></div>
<Select
options={workflowOptions}
value={options.workflowId ?? {}}
@ -60,7 +61,6 @@ export function Workflows({ options, optionsChanged, currentState }) {
optionsChanged({ workflowId });
}}
placeholder="Select workflow"
data-cy="workflow-dropdown"
height="32px"
useMenuPortal={true}
closeMenuOnSelect={true}

View file

@ -57,28 +57,26 @@ export const SelectComponent = ({ options = [], value, onChange, closeMenuOnSele
};
return (
<div data-cy={restProps['data-cy']}>
<Select
{...restProps}
ref={selectRef}
selectRef={selectRef} // Exposed ref for custom components if needed
isLoading={isLoading}
isDisabled={isDisabled || isLoading}
options={selectOptions}
value={currentValue}
isSearchable={hasSearch}
onChange={handleOnChange}
placeholder={placeholder}
styles={customStyles}
openMenuOnFocus={openMenuOnFocus}
formatOptionLabel={(option) => renderCustomOption(option)}
menuPlacement={menuPlacement}
maxMenuHeight={maxMenuHeight}
menuPortalTarget={useMenuPortal ? document.body : menuPortalTarget}
closeMenuOnSelect={closeMenuOnSelect ?? true}
classNamePrefix={`${customClassPrefix} ${isDarkMode && 'dark-theme'} ${'react-select'}`}
data-cy={restProps['data-cy']}
/>
</div>
<Select
{...restProps}
ref={selectRef}
selectRef={selectRef}
isLoading={isLoading}
isDisabled={isDisabled || isLoading}
options={selectOptions}
value={currentValue}
isSearchable={hasSearch}
onChange={handleOnChange}
placeholder={placeholder}
styles={customStyles}
openMenuOnFocus={openMenuOnFocus}
formatOptionLabel={(option) => renderCustomOption(option)}
menuPlacement={menuPlacement}
maxMenuHeight={maxMenuHeight}
menuPortalTarget={useMenuPortal ? document.body : menuPortalTarget}
closeMenuOnSelect={closeMenuOnSelect ?? true}
classNamePrefix={`${customClassPrefix} ${isDarkMode && 'dark-theme'} ${'react-select'}`}
data-cy={restProps['data-cy']}
/>
);
};