mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
scrollbar: use enzyme for tests instead of react-test-renderer
This commit is contained in:
parent
729cc94daf
commit
349b2787cb
@ -1,16 +1,15 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import { mount } from 'enzyme';
|
||||
import toJson from 'enzyme-to-json';
|
||||
import GrafanaScrollbar from './GrafanaScrollbar';
|
||||
|
||||
describe('GrafanaScrollbar', () => {
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer
|
||||
.create(
|
||||
const tree = mount(
|
||||
<GrafanaScrollbar>
|
||||
<p>Scrollable content</p>
|
||||
</GrafanaScrollbar>
|
||||
)
|
||||
.toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
);
|
||||
expect(toJson(tree)).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,31 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`GrafanaScrollbar renders correctly 1`] = `
|
||||
<GrafanaScrollbar
|
||||
autoHide={true}
|
||||
autoHideDuration={200}
|
||||
autoHideTimeout={200}
|
||||
customClassName="custom-scrollbars"
|
||||
hideTracksWhenNotNeeded={false}
|
||||
>
|
||||
<Scrollbars
|
||||
autoHeight={true}
|
||||
autoHeightMax="100%"
|
||||
autoHeightMin="100%"
|
||||
autoHide={true}
|
||||
autoHideDuration={200}
|
||||
autoHideTimeout={200}
|
||||
className="custom-scrollbars"
|
||||
hideTracksWhenNotNeeded={false}
|
||||
renderThumbHorizontal={[Function]}
|
||||
renderThumbVertical={[Function]}
|
||||
renderTrackHorizontal={[Function]}
|
||||
renderTrackVertical={[Function]}
|
||||
renderView={[Function]}
|
||||
tagName="div"
|
||||
thumbMinSize={30}
|
||||
universal={false}
|
||||
>
|
||||
<div
|
||||
className="custom-scrollbars"
|
||||
style={
|
||||
@ -16,6 +41,7 @@ exports[`GrafanaScrollbar renders correctly 1`] = `
|
||||
>
|
||||
<div
|
||||
className="view"
|
||||
key="view"
|
||||
style={
|
||||
Object {
|
||||
"WebkitOverflowScrolling": "touch",
|
||||
@ -38,6 +64,7 @@ exports[`GrafanaScrollbar renders correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
className="track-horizontal"
|
||||
key="trackHorizontal"
|
||||
style={
|
||||
Object {
|
||||
"display": "none",
|
||||
@ -61,6 +88,7 @@ exports[`GrafanaScrollbar renders correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
className="track-vertical"
|
||||
key="trackVertical"
|
||||
style={
|
||||
Object {
|
||||
"display": "none",
|
||||
@ -83,4 +111,6 @@ exports[`GrafanaScrollbar renders correctly 1`] = `
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Scrollbars>
|
||||
</GrafanaScrollbar>
|
||||
`;
|
||||
|
Loading…
Reference in New Issue
Block a user