This repository was archived by the owner on Mar 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ ReactNative.View = View;
3737ReactNative . ScrollView = View ;
3838ReactNative . Text = View ;
3939ReactNative . TouchableOpacity = View ;
40+ ReactNative . TouchableHighlight = View ;
4041ReactNative . TouchableWithoutFeedback = View ;
4142ReactNative . ToolbarAndroid = View ;
4243ReactNative . Image = View ;
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments