Skip to content

Commit

Permalink
fix: pass down disabled prop in the rowComp Hoc
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoyadmoon committed Apr 8, 2024
1 parent 68da905 commit 723ba8b
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 184 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 723ba8b

Please sign in to comment.