"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/material-ui/src/AccordionSummary/AccordionSummary.test.js" between
material-ui-4.12.1.tar.gz and material-ui-4.12.2.tar.gz

About: Material-UI is a simple and customizable component library to build faster, beautiful, and more accessible React applications.

AccordionSummary.test.js  (material-ui-4.12.1):AccordionSummary.test.js  (material-ui-4.12.2)
import * as React from 'react'; import * as React from 'react';
import PropTypes from 'prop-types';
import { expect } from 'chai'; import { expect } from 'chai';
import { spy } from 'sinon'; import { spy } from 'sinon';
import { getClasses } from 'test/utils'; import { getClasses } from 'test/utils';
import createMount from 'test/utils/createMount'; import createMount from 'test/utils/createMount';
import describeConformance from 'test/utils/describeConformance'; import describeConformance from 'test/utils/describeConformance';
import consoleErrorMock from 'test/utils/consoleErrorMock';
import { createClientRender, fireEvent } from 'test/utils/createClientRender'; import { createClientRender, fireEvent } from 'test/utils/createClientRender';
import Accordion from '../Accordion'; import Accordion from '../Accordion';
import AccordionSummary from './AccordionSummary'; import AccordionSummary from './AccordionSummary';
import ButtonBase from '../ButtonBase'; import ButtonBase from '../ButtonBase';
describe('<AccordionSummary />', () => { describe('<AccordionSummary />', () => {
const mount = createMount(); const mount = createMount();
let classes; let classes;
const render = createClientRender(); const render = createClientRender();
skipping to change at line 101 skipping to change at line 103
const { getByRole } = render(<AccordionSummary onFocusVisible={handleFocusVi sible} />); const { getByRole } = render(<AccordionSummary onFocusVisible={handleFocusVi sible} />);
// simulate pointer device // simulate pointer device
fireEvent.mouseDown(document.body); fireEvent.mouseDown(document.body);
// this doesn't actually apply focus like in the browser. we need to move fo cus manually // this doesn't actually apply focus like in the browser. we need to move fo cus manually
fireEvent.keyDown(document.body, { key: 'Tab' }); fireEvent.keyDown(document.body, { key: 'Tab' });
getByRole('button').focus(); getByRole('button').focus();
expect(handleFocusVisible.callCount).to.equal(1); expect(handleFocusVisible.callCount).to.equal(1);
}); });
describe('warnings', () => {
beforeEach(() => {
consoleErrorMock.spy();
PropTypes.resetWarningCache();
});
afterEach(() => {
consoleErrorMock.reset();
});
it('should when using the `focused` class', () => {
PropTypes.checkPropTypes(
AccordionSummary.Naked.propTypes,
{
classes: {
focused:
// `Mui-focused` is the class generated by jss
// `focused` is the custom class
// i.e. this is the focused class when using `<AccordionSummary cl
asses={{ focused: 'focused' }} />`
'Mui-focused focused',
},
children: <div />,
},
'prop',
'MockedName',
);
expect(consoleErrorMock.callCount()).to.equal(1);
expect(consoleErrorMock.messages()[0]).to.include(
'Material-UI: The `classes.focused` key is deprecated.\nUse `classes.foc
usVisible` instead.',
);
});
});
}); });
 End of changes. 3 change blocks. 
0 lines changed or deleted 38 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)