Skip to content
This repository was archived by the owner on Mar 25, 2025. It is now read-only.

Commit e6d4f6d

Browse files
committed
fix warning
1 parent 3fb493b commit e6d4f6d

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

src/__mocks__/react-native.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ ReactNative.View = View;
3737
ReactNative.ScrollView = View;
3838
ReactNative.Text = View;
3939
ReactNative.TouchableOpacity = View;
40+
ReactNative.TouchableHighlight = View;
4041
ReactNative.TouchableWithoutFeedback = View;
4142
ReactNative.ToolbarAndroid = View;
4243
ReactNative.Image = View;

src/components/ErrorAlert.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,12 @@ var ErrorAlert = class ErrorAlertClass{
2121
* ## ErrorAlert
2222
* setup to support testing
2323
*/
24-
constructor(alerter) {
25-
this.alerter = alerter;
26-
}
2724
/**
2825
* ### checkErro
2926
* determine if there is an error and how deep it is. Take the
3027
* deepest level as the message and display it
3128
*/
3229
checkError(obj) {
33-
if (!this.alerter) {
34-
this.alerter = SimpleAlert;
35-
}
3630
let errorMessage = '';
3731
if (!_.isNull(obj)) {
3832
if (!_.isUndefined(obj.error)) {
@@ -46,9 +40,9 @@ var ErrorAlert = class ErrorAlertClass{
4640
}
4741
if (errorMessage !== '') {
4842
if (!_.isUndefined(errorMessage.message)) {
49-
this.alerter.alert('Error',errorMessage.message);
43+
SimpleAlert.alert('Error',errorMessage.message);
5044
} else {
51-
this.alerter.alert('Error',errorMessage);
45+
SimpleAlert.alert('Error',errorMessage);
5246
}
5347
}
5448
}//isNull

src/components/__tests__/ErrorAlert-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('ErrorAlert', () => {
4949
* check that the title is 'Error' which is a hard coded constant
5050
* and the alert matches the props error
5151
*/
52-
new ErrorAlert(SimpleAlert).checkError(errorAlertProps);
52+
new ErrorAlert().checkError(errorAlertProps);
5353
expect(SimpleAlert.alert.mock.calls[0][0]).toEqual('Error');
5454
expect(SimpleAlert.alert.mock.calls[0][1]).toEqual(errorAlertProps.error.error);
5555
});

0 commit comments

Comments
 (0)