Skip to content

Commit 548da4a

Browse files
committed
Update comments
1 parent bd8a25d commit 548da4a

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

packages/mui-material-next/src/InputBase/InputBase.test.js

+18-11
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import PropTypes from 'prop-types';
33
import { expect } from 'chai';
44
import { spy } from 'sinon';
55
import { describeConformance, act, createRenderer, fireEvent, screen } from 'test/utils';
6-
import { ThemeProvider } from '@emotion/react';
76
import FormControl, { useFormControl } from '@mui/material-next/FormControl';
7+
// TODO v6: replace with material-next/InputAdornment
88
import InputAdornment from '@mui/material/InputAdornment';
9+
// TODO v6: replace with material-next/TextField
910
import TextField from '@mui/material/TextField';
10-
import { createTheme } from '@mui/material/styles';
11+
// TODO v6: replace with material-next/Select
1112
import Select from '@mui/material/Select';
1213
import InputBase, { inputBaseClasses as classes } from '@mui/material-next/InputBase';
1314
import { CssVarsProvider, extendTheme } from '@mui/material-next/styles';
@@ -670,25 +671,31 @@ describe('<InputBase />', () => {
670671
});
671672

672673
describe('prop: focused', () => {
673-
// TODO v6: use material-next/TextField
674+
// TODO v6: requires material-next/OutlinedInput
674675
// eslint-disable-next-line mocha/no-skipped-tests
675-
it.skip('should render correct border color with `ThemeProvider` imported from `@emotion/react`', function test() {
676+
it.skip('should render correct border color with a customized primary color supplied to CssVarsProvider', function test() {
676677
if (/jsdom/.test(window.navigator.userAgent)) {
677678
this.skip();
678679
}
679-
const theme = createTheme({
680-
palette: {
681-
mode: 'light',
682-
primary: {
683-
main: 'rgb(0, 191, 165)',
680+
const theme = extendTheme({
681+
colorSchemes: {
682+
light: {
683+
palette: {
684+
primary: {
685+
main: 'rgb(0, 191, 165)',
686+
},
687+
},
684688
},
685689
},
686690
});
687691
const { getByRole } = render(
688-
<ThemeProvider theme={theme}>
692+
<CssVarsProvider theme={theme}>
693+
{/* TODO v6: use material-next/TextField or OutlinedInput */}
689694
<TextField focused label="Your email" />
690-
</ThemeProvider>,
695+
</CssVarsProvider>,
691696
);
697+
698+
// this `fieldset` is the (internal) NotchedOutline component
692699
const fieldset = getByRole('textbox').nextSibling;
693700
expect(fieldset).toHaveComputedStyle({
694701
borderTopColor: 'rgb(0, 191, 165)',

packages/mui-material-next/src/InputBase/InputBase.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,12 @@ const InputBase = React.forwardRef(function InputBase<
509509
{endAdornment}
510510
{renderSuffix
511511
? renderSuffix({
512-
// TODO: make sure ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled'] are all passed to renderSuffix when integrating OutlinedInput
512+
// TODO: requires integrating with OutlinedInput
513+
// ...formControlState({
514+
// props,
515+
// muiFormControl,
516+
// states: ['color', 'disabled', 'error', 'hiddenLabel', 'size', 'required', 'filled']
517+
// }),
513518
...muiFormControl,
514519
startAdornment,
515520
})

0 commit comments

Comments
 (0)