Skip to content

Commit a7bc7fe

Browse files
committed
update dependency
1 parent 44176b7 commit a7bc7fe

File tree

5 files changed

+33
-4
lines changed

5 files changed

+33
-4
lines changed

lib/loading-bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { View, StyleSheet } from 'react-native';
3-
import PropTypes from 'prop-types';
3+
import * as PropTypes from 'prop-types';
44

55
const LoadingBar = ({ color, percent, height }) => {
66
const style = {

lib/webview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { View, StyleSheet } from 'react-native';
3-
import WebView from 'react-native-webview';
4-
import PropTypes from 'prop-types';
3+
import { WebView } from 'react-native-webview';
4+
import * as PropTypes from 'prop-types';
55
import LoadingBar from "./loading-bar";
66

77
class ProgressBarWebView extends React.PureComponent {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@
2222
"prop-types": "^15.7.2"
2323
},
2424
"peerDependencies": {
25-
"react-native-webview": "^5.0.0"
25+
"react-native-webview": "^7.0.0"
2626
}
2727
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`WebView Rendering should match to snapshot 1`] = `ShallowWrapper {}`;

test/webview.test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import React from 'react';
2+
import { shallow } from 'enzyme';
3+
import WebView from '../lib/webview';
4+
5+
describe('WebView', () => {
6+
describe('Rendering', () => {
7+
it('should match to snapshot', () => {
8+
const component = shallow(<WebView source={{ uri: 'https://www.google.com.au' }}/>);
9+
expect(component).toMatchSnapshot()
10+
});
11+
});
12+
13+
describe('function callback', () => {
14+
it('should call onLoadProgress', () => {
15+
const onLoadProgress = jest.fn();
16+
shallow(
17+
<WebView
18+
source={{ uri: 'https://www.google.com.au' }}
19+
onLoadProgress={onLoadProgress}
20+
/>
21+
);
22+
23+
expect(onLoadProgress).toBeCalled();
24+
});
25+
});
26+
});

0 commit comments

Comments
 (0)