mirror of
https://github.com/grafana/grafana.git
synced 2025-01-18 12:33:37 -06:00
Chore: convert NewWindowIcon test to rtl (#49830)
This commit is contained in:
parent
4c28d09d6d
commit
8e0342bc74
@ -98,9 +98,6 @@ exports[`no enzyme tests`] = {
|
||||
"packages/jaeger-ui-components/src/TraceTimelineViewer/index.test.js:381298544": [
|
||||
[14, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/common/NewWindowIcon.test.js:1750458349": [
|
||||
[14, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
"packages/jaeger-ui-components/src/common/UiFindInput.test.js:2207118020": [
|
||||
[14, 19, 13, "RegExp match", "2409514259"]
|
||||
],
|
||||
|
@ -10,17 +10,20 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@grafana/tsconfig": "^1.2.0-rc1",
|
||||
"@testing-library/jest-dom": "5.16.4",
|
||||
"@testing-library/react": "12.1.4",
|
||||
"@testing-library/user-event": "14.2.0",
|
||||
"@types/classnames": "^2.2.7",
|
||||
"@types/deep-freeze": "^0.1.1",
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5",
|
||||
"@types/hoist-non-react-statics": "^3.3.1",
|
||||
"@types/jest": "27.5.1",
|
||||
"@types/lodash": "4.14.182",
|
||||
"@types/prop-types": "15.7.5",
|
||||
"@types/react": "17.0.42",
|
||||
"@types/react-icons": "2.2.7",
|
||||
"@types/reselect": "2.2.0",
|
||||
"@types/testing-library__jest-dom": "5.14.3",
|
||||
"@types/tinycolor2": "1.4.3",
|
||||
"enzyme": "3.11.0",
|
||||
"sinon": "14.0.0",
|
||||
|
@ -12,29 +12,15 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { shallow } from 'enzyme';
|
||||
import { render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
|
||||
import NewWindowIcon, { getStyles } from './NewWindowIcon';
|
||||
|
||||
describe('NewWindowIcon', () => {
|
||||
const props = {
|
||||
notIsLarge: 'not is large',
|
||||
};
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(<NewWindowIcon {...props} />);
|
||||
});
|
||||
|
||||
it('renders as expected', () => {
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it('adds is-large className when props.isLarge is true', () => {
|
||||
const { container } = render(<NewWindowIcon isLarge />);
|
||||
const styles = getStyles();
|
||||
expect(wrapper.hasClass(styles.NewWindowIconLarge)).toBe(false);
|
||||
wrapper.setProps({ isLarge: true });
|
||||
expect(wrapper.hasClass(styles.NewWindowIconLarge)).toBe(true);
|
||||
expect(container.firstChild).toHaveClass(styles.NewWindowIconLarge);
|
||||
});
|
||||
});
|
@ -1,8 +0,0 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`NewWindowIcon renders as expected 1`] = `
|
||||
<IoAndroidOpen
|
||||
className=""
|
||||
notIsLarge="not is large"
|
||||
/>
|
||||
`;
|
@ -4577,17 +4577,20 @@ __metadata:
|
||||
"@grafana/e2e-selectors": 9.0.0-pre
|
||||
"@grafana/tsconfig": ^1.2.0-rc1
|
||||
"@grafana/ui": 9.0.0-pre
|
||||
"@testing-library/jest-dom": 5.16.4
|
||||
"@testing-library/react": 12.1.4
|
||||
"@testing-library/user-event": 14.2.0
|
||||
"@types/classnames": ^2.2.7
|
||||
"@types/deep-freeze": ^0.1.1
|
||||
"@types/grafana__slate-react": "npm:@types/slate-react@0.22.5"
|
||||
"@types/hoist-non-react-statics": ^3.3.1
|
||||
"@types/jest": 27.5.1
|
||||
"@types/lodash": 4.14.182
|
||||
"@types/prop-types": 15.7.5
|
||||
"@types/react": 17.0.42
|
||||
"@types/react-icons": 2.2.7
|
||||
"@types/reselect": 2.2.0
|
||||
"@types/testing-library__jest-dom": 5.14.3
|
||||
"@types/tinycolor2": 1.4.3
|
||||
chance: ^1.0.10
|
||||
classnames: ^2.2.5
|
||||
|
Loading…
Reference in New Issue
Block a user