@@ -24,38 +24,38 @@ define([
24
24
'Magento_Newsletter/js/subscription-status-resolver' : resolverMock
25
25
} ;
26
26
27
- describe ( 'Magento_Newsletter/js/newsletter-sign-up' , function ( ) {
28
- beforeEach ( function ( done ) {
29
- checkbox = $ ( '<input type="checkbox" class="checkbox" name="is_subscribed" id="is_subscribed"/>' ) ;
30
- emailElem = $ ( '<input type="email" name="email" id="email_address"/>' ) ;
31
- button = $ ( '<button type="submit" id="button"/>' ) ;
32
- $ ( document . body ) . append ( checkbox ) . append ( emailElem ) . append ( button ) ;
33
-
34
- injector . mock ( mocks ) ;
35
- injector . require ( [ 'Magento_Newsletter/js/newsletter-sign-up' ] , function ( Constr ) {
36
- obj = new Constr ( {
37
- provider : 'provName' ,
38
- name : '' ,
39
- index : '' ,
40
- submitButton : '#button' ,
41
- signUpElement : '#is_subscribed'
42
- } , '#email_address' ) ;
43
- done ( ) ;
44
- } ) ;
27
+ beforeEach ( function ( done ) {
28
+ checkbox = $ ( '<input type="checkbox" class="checkbox" name="is_subscribed" id="is_subscribed"/>' ) ;
29
+ emailElem = $ ( '<input type="email" name="email" id="email_address"/>' ) ;
30
+ button = $ ( '<button type="submit" id="button"/>' ) ;
31
+ $ ( document . body ) . append ( checkbox ) . append ( emailElem ) . append ( button ) ;
32
+
33
+ injector . mock ( mocks ) ;
34
+ injector . require ( [ 'Magento_Newsletter/js/newsletter-sign-up' ] , function ( Constr ) {
35
+ obj = new Constr ( {
36
+ provider : 'provName' ,
37
+ name : '' ,
38
+ index : '' ,
39
+ submitButton : '#button' ,
40
+ signUpElement : '#is_subscribed'
41
+ } , '#email_address' ) ;
42
+ done ( ) ;
45
43
} ) ;
44
+ } ) ;
46
45
47
- afterEach ( function ( ) {
48
- try {
49
- injector . clean ( ) ;
50
- injector . remove ( ) ;
51
- } catch ( e ) { }
46
+ afterEach ( function ( ) {
47
+ try {
48
+ injector . clean ( ) ;
49
+ injector . remove ( ) ;
50
+ } catch ( e ) { }
52
51
53
- checkbox . remove ( ) ;
54
- emailElem . remove ( ) ;
55
- button . remove ( ) ;
56
- } ) ;
52
+ checkbox . remove ( ) ;
53
+ emailElem . remove ( ) ;
54
+ button . remove ( ) ;
55
+ } ) ;
57
56
58
- it ( 'Check for properties defined' , function ( ) {
57
+ describe ( 'Magento_Newsletter/js/newsletter-sign-up' , function ( ) {
58
+ it ( 'Check for properties defined' , function ( ) {
59
59
expect ( obj . hasOwnProperty ( 'submitButton' ) ) . toBeDefined ( ) ;
60
60
expect ( typeof obj . submitButton ) . toEqual ( 'string' ) ;
61
61
expect ( obj . hasOwnProperty ( 'signUpElement' ) ) . toBeDefined ( ) ;
@@ -64,7 +64,7 @@ define([
64
64
expect ( typeof obj . element ) . toEqual ( 'string' ) ;
65
65
} ) ;
66
66
67
- it ( 'Verify Subscription is checked' , function ( ) {
67
+ it ( 'Verify Subscription is checked' , function ( ) {
68
68
emailElem . val ( '[email protected] ' ) ;
69
69
checkbox . prop ( 'checked' , true ) ;
70
70
expect ( checkbox . is ( ':checked' ) ) . toBeTruthy ( ) ;
@@ -76,7 +76,7 @@ define([
76
76
expect ( checkbox . is ( ':checked' ) ) . toBeTruthy ( ) ;
77
77
} ) ;
78
78
79
- it ( 'Verify sign-up process without email' , function ( ) {
79
+ it ( 'Verify sign-up process without email' , function ( ) {
80
80
checkbox . prop ( 'checked' , false ) ;
81
81
expect ( checkbox . is ( ':checked' ) ) . toBeFalsy ( ) ;
82
82
@@ -86,7 +86,7 @@ define([
86
86
expect ( checkbox . is ( ':checked' ) ) . toBeFalsy ( ) ;
87
87
} ) ;
88
88
89
- it ( 'Verify sign-up process with incorrect email' , function ( ) {
89
+ it ( 'Verify sign-up process with incorrect email' , function ( ) {
90
90
emailElem . val ( 'emailexample.com' ) ;
91
91
checkbox . prop ( 'checked' , false ) ;
92
92
expect ( checkbox . is ( ':checked' ) ) . toBeFalsy ( ) ;
@@ -97,7 +97,7 @@ define([
97
97
expect ( checkbox . is ( ':checked' ) ) . toBeFalsy ( ) ;
98
98
} ) ;
99
99
100
- it ( 'Verify Subscription with correct data' , function ( ) {
100
+ it ( 'Verify Subscription with correct data' , function ( ) {
101
101
emailElem . val ( '[email protected] ' ) ;
102
102
checkbox . prop ( 'checked' , false ) ;
103
103
expect ( checkbox . is ( ':checked' ) ) . toBeFalsy ( ) ;
@@ -109,7 +109,7 @@ define([
109
109
expect ( button . is ( ':disabled' ) ) . toBeFalsy ( ) ;
110
110
} ) ;
111
111
112
- it ( 'Verify sign-up process with non-subscribed email' , function ( ) {
112
+ it ( 'Verify sign-up process with non-subscribed email' , function ( ) {
113
113
resolveStatus ( false ) ;
114
114
emailElem . val ( '[email protected] ' ) ;
115
115
checkbox . prop ( 'checked' , false ) ;
0 commit comments