Skip to content

Commit

Permalink
[base] Remove @mui/system in tests (#32945)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinji authored Jun 1, 2022
1 parent 8ae84a2 commit e7a1c9b
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions packages/mui-base/test/integration/SelectUnstyled.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import * as React from 'react';
import { expect } from 'chai';
import { act, createRenderer, fireEvent } from 'test/utils';
import OptionUnstyled from '@mui/base/OptionUnstyled';
import SelectUnstyled from '@mui/base/SelectUnstyled';
import { styled } from '@mui/system';
import SelectUnstyled, { SelectUnstyledListboxSlotProps } from '@mui/base/SelectUnstyled';

describe('<SelectUnstyled> integration', () => {
const { render } = createRenderer();
Expand All @@ -13,13 +12,25 @@ describe('<SelectUnstyled> integration', () => {
this.skip();
}

const SelectListbox = styled('ul')({
maxHeight: '100px',
overflow: 'auto',
const SelectListbox = React.forwardRef(function SelectListbox(
props: SelectUnstyledListboxSlotProps<string>,
ref: React.ForwardedRef<HTMLUListElement>,
) {
const { ownerState, ...other } = props;
return <ul {...other} ref={ref} style={{ maxHeight: '100px', overflow: 'auto' }} />;
});

const Option = styled(OptionUnstyled)({
height: '50px',
const Option = React.forwardRef(function Option(
props: { value: string; children?: React.ReactNode },
ref: React.Ref<HTMLLIElement>,
) {
return (
<OptionUnstyled
{...props}
ref={ref}
componentsProps={{ root: { style: { height: '50px' } } }}
/>
);
});

const { getByRole } = render(
Expand Down

0 comments on commit e7a1c9b

Please sign in to comment.