Skip to content

Commit

Permalink
move tests outside of the Input test block
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeeshanTamboli committed Dec 15, 2023
1 parent 20e3574 commit f3cec0b
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions packages/mui-joy/src/FormControl/FormControl.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,24 +110,6 @@ describe('<FormControl />', () => {

expect(getByRole('textbox')).to.have.attribute('required');
});

it('should inherit htmlFor from FormControl if htmlFor is undefined', () => {
const { getByText } = render(
<FormControl>
<FormLabel htmlFor={undefined}>label</FormLabel>
</FormControl>,
);
expect(getByText('label')).to.have.attribute('for');
});

it('should inherit id from FormControl if id is undefined', () => {
const { getByText } = render(
<FormControl>
<FormLabel id={undefined}>label</FormLabel>
</FormControl>,
);
expect(getByText('label')).to.have.attribute('id');
});
});

describe('Textarea', () => {
Expand Down Expand Up @@ -523,4 +505,22 @@ describe('<FormControl />', () => {
expect(getByRole('combobox')).to.have.attribute('disabled');
});
});

it('should inherit htmlFor from FormControl if htmlFor is undefined', () => {
const { getByText } = render(
<FormControl>
<FormLabel htmlFor={undefined}>label</FormLabel>
</FormControl>,
);
expect(getByText('label')).to.have.attribute('for');
});

it('should inherit id from FormControl if id is undefined', () => {
const { getByText } = render(
<FormControl>
<FormLabel id={undefined}>label</FormLabel>
</FormControl>,
);
expect(getByText('label')).to.have.attribute('id');
});
});

0 comments on commit f3cec0b

Please sign in to comment.