Skip to content

Commit bf37148

Browse files
authored
Merge pull request #431 from iCHEF/fix/rowComp-pass-disabled-prop
fix: pass down disabled prop in the rowComp Hoc
2 parents 68da905 + c96eb64 commit bf37148

File tree

3 files changed

+200
-185
lines changed

3 files changed

+200
-185
lines changed

packages/core/src/mixins/__tests__/rowComp.test.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { render } from '@testing-library/react';
2+
import { render, screen } from '@testing-library/react';
33
import { shallow } from 'enzyme';
44

55
import Icon from 'src/Icon';
@@ -146,3 +146,14 @@ it('takes defaults to its <RowComp> wrapper-component', () => {
146146
expect(Comp.defaultProps.align).toBe('center');
147147
expect(Comp.defaultProps.minified).toBeTruthy();
148148
});
149+
150+
it('pass down disabled prop to wrapped component', () => {
151+
const Input = ({ children, ...props }) => <input {...props} />;
152+
const RowInput = rowComp()(Input);
153+
154+
render(<RowInput disabled />);
155+
156+
const wrapper = screen.getByRole('textbox');
157+
158+
expect(wrapper).toHaveAttribute('disabled');
159+
});

0 commit comments

Comments
 (0)