Skip to content

Commit ba4a73f

Browse files
authoredApr 28, 2023
Fix: missing data-* on <ComboBox /> component (#338)
1 parent f25ccea commit ba4a73f

File tree

5 files changed

+32
-0
lines changed

5 files changed

+32
-0
lines changed
 

‎.changeset/purple-kiwis-exist.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@cube-dev/ui-kit': patch
3+
---
4+
5+
Fixed missing data-\* attribiutes on `<Combobox />` component

‎src/components/pickers/ComboBox/ComboBox.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ export const ComboBox = forwardRef(function ComboBox<T extends object>(
191191
let { contains } = useFilter({ sensitivity: 'base' });
192192

193193
const comboboxProps = {
194+
...otherProps,
194195
inputValue: props.inputValue,
195196
defaultInputValue: props.defaultInputValue,
196197
defaultItems: props.defaultItems,

‎src/components/pickers/ComboBox/combobox.test.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,28 @@ describe('<Combobox />', () => {
131131
expect(filterFn).toHaveBeenCalled();
132132
expect(options).toHaveLength(1);
133133
});
134+
135+
it('should have qa', () => {
136+
const { getByTestId } = renderWithRoot(
137+
<ComboBox label="test" qa="test">
138+
{items.map((item) => (
139+
<ComboBox.Item key={item.key}>{item.children}</ComboBox.Item>
140+
))}
141+
</ComboBox>,
142+
);
143+
144+
expect(getByTestId('test')).toBeInTheDocument();
145+
});
146+
147+
it('should have data-qa', () => {
148+
const { getByTestId } = renderWithRoot(
149+
<ComboBox label="test" data-qa="test">
150+
{items.map((item) => (
151+
<ComboBox.Item key={item.key}>{item.children}</ComboBox.Item>
152+
))}
153+
</ComboBox>,
154+
);
155+
156+
expect(getByTestId('test')).toBeInTheDocument();
157+
});
134158
});

‎tsconfig.cjs.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"declaration": false
88
},
99
"exclude": [
10+
"src/**/__mocks__/**/*",
1011
"src/**/*.stories.tsx",
1112
"src/**/*.stories.ts",
1213
"src/test/**/*",

‎tsconfig.es.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"noEmit": false
77
},
88
"exclude": [
9+
"src/**/__mocks__/**/*",
910
"src/**/*.stories.tsx",
1011
"src/**/*.stories.ts",
1112
"src/test/**/*",

0 commit comments

Comments
 (0)
Please sign in to comment.