This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ ReactNative.View = View;
37
37
ReactNative . ScrollView = View ;
38
38
ReactNative . Text = View ;
39
39
ReactNative . TouchableOpacity = View ;
40
+ ReactNative . TouchableHighlight = View ;
40
41
ReactNative . TouchableWithoutFeedback = View ;
41
42
ReactNative . ToolbarAndroid = View ;
42
43
ReactNative . Image = View ;
Original file line number Diff line number Diff line change @@ -21,18 +21,12 @@ var ErrorAlert = class ErrorAlertClass{
21
21
* ## ErrorAlert
22
22
* setup to support testing
23
23
*/
24
- constructor ( alerter ) {
25
- this . alerter = alerter ;
26
- }
27
24
/**
28
25
* ### checkErro
29
26
* determine if there is an error and how deep it is. Take the
30
27
* deepest level as the message and display it
31
28
*/
32
29
checkError ( obj ) {
33
- if ( ! this . alerter ) {
34
- this . alerter = SimpleAlert ;
35
- }
36
30
let errorMessage = '' ;
37
31
if ( ! _ . isNull ( obj ) ) {
38
32
if ( ! _ . isUndefined ( obj . error ) ) {
@@ -46,9 +40,9 @@ var ErrorAlert = class ErrorAlertClass{
46
40
}
47
41
if ( errorMessage !== '' ) {
48
42
if ( ! _ . isUndefined ( errorMessage . message ) ) {
49
- this . alerter . alert ( 'Error' , errorMessage . message ) ;
43
+ SimpleAlert . alert ( 'Error' , errorMessage . message ) ;
50
44
} else {
51
- this . alerter . alert ( 'Error' , errorMessage ) ;
45
+ SimpleAlert . alert ( 'Error' , errorMessage ) ;
52
46
}
53
47
}
54
48
} //isNull
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ describe('ErrorAlert', () => {
49
49
* check that the title is 'Error' which is a hard coded constant
50
50
* and the alert matches the props error
51
51
*/
52
- new ErrorAlert ( SimpleAlert ) . checkError ( errorAlertProps ) ;
52
+ new ErrorAlert ( ) . checkError ( errorAlertProps ) ;
53
53
expect ( SimpleAlert . alert . mock . calls [ 0 ] [ 0 ] ) . toEqual ( 'Error' ) ;
54
54
expect ( SimpleAlert . alert . mock . calls [ 0 ] [ 1 ] ) . toEqual ( errorAlertProps . error . error ) ;
55
55
} ) ;
You can’t perform that action at this time.
0 commit comments