Skip to content

Commit fe2bc40

Browse files
authored
fix(Switch): move qa to the root element (#642)
1 parent 07bf593 commit fe2bc40

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

.changeset/loud-garlics-do.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Move qa attribute to the root wrapper in Switch component.

src/components/fields/Switch/Switch.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import { LoadingIcon } from '../../../icons';
2828

2929
const SwitchWrapperElement = tasty({
3030
as: 'label',
31-
qa: 'SwitchWrapper',
3231
styles: {
3332
display: 'flex',
3433
position: 'relative',
@@ -175,14 +174,19 @@ function Switch(props: WithNullableSelected<CubeSwitchProps>, ref) {
175174
};
176175

177176
const switchField = (
178-
<SwitchWrapperElement mods={mods} data-size={size} {...hoverProps}>
177+
<SwitchWrapperElement
178+
qa={qa || 'SwitchWrapper'}
179+
mods={mods}
180+
data-size={size}
181+
{...hoverProps}
182+
>
179183
<HiddenInput
180184
data-qa="HiddenInput"
181185
{...mergeProps(inputProps, focusProps)}
182186
ref={inputRef}
183187
/>
184188
<SwitchElement
185-
qa={qa || 'Switch'}
189+
qa="Switch"
186190
mods={mods}
187191
data-size={size}
188192
styles={inputStyles}

0 commit comments

Comments
 (0)