Skip to content

Commit

Permalink
Merge pull request #431 from iCHEF/fix/rowComp-pass-disabled-prop
Browse files Browse the repository at this point in the history
fix: pass down disabled prop in the rowComp Hoc
  • Loading branch information
kyoyadmoon authored Apr 11, 2024
2 parents 68da905 + c96eb64 commit bf37148
Show file tree
Hide file tree
Showing 3 changed files with 200 additions and 185 deletions.
13 changes: 12 additions & 1 deletion packages/core/src/mixins/__tests__/rowComp.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render } from '@testing-library/react';
import { render, screen } from '@testing-library/react';
import { shallow } from 'enzyme';

import Icon from 'src/Icon';
Expand Down Expand Up @@ -146,3 +146,14 @@ it('takes defaults to its <RowComp> wrapper-component', () => {
expect(Comp.defaultProps.align).toBe('center');
expect(Comp.defaultProps.minified).toBeTruthy();
});

it('pass down disabled prop to wrapped component', () => {
const Input = ({ children, ...props }) => <input {...props} />;
const RowInput = rowComp()(Input);

render(<RowInput disabled />);

const wrapper = screen.getByRole('textbox');

expect(wrapper).toHaveAttribute('disabled');
});
Loading

0 comments on commit bf37148

Please sign in to comment.