File tree 1 file changed +20
-1
lines changed
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/modal 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,21 @@ define([
10
10
'use strict' ;
11
11
12
12
describe ( 'ui/js/modal/confirm' , function ( ) {
13
- var element = $ ( '<div>some element</div>' ) ,
13
+
14
+ var widget ,
15
+ element ,
16
+ confirm ;
17
+
18
+ beforeEach ( function ( ) {
19
+ element = $ ( '<div id="element">some element</div>' ) ;
14
20
confirm = element . confirm ( { } ) ;
21
+ widget = element . confirm ( { } ) . data ( 'mage-confirm' ) ;
22
+ } ) ;
23
+
24
+ afterEach ( function ( ) {
25
+ $ ( 'element' ) . remove ( ) ;
26
+
27
+ } ) ;
15
28
16
29
it ( 'Check for modal definition' , function ( ) {
17
30
expect ( confirm ) . toBeDefined ( ) ;
@@ -23,5 +36,11 @@ define([
23
36
it ( 'Integration: modal created on page' , function ( ) {
24
37
expect ( confirm . length ) . toEqual ( 1 ) ;
25
38
} ) ;
39
+ it ( 'Check confirm class button' , function ( ) {
40
+ var expectedClassResult = 'action primary action-primary action-accept' ,
41
+ expectedClass = widget . options . buttons [ 1 ] . class ;
42
+
43
+ expect ( $ ( expectedClass ) . selector ) . toContain ( expectedClassResult ) ;
44
+ } ) ;
26
45
} ) ;
27
46
} ) ;
You can’t perform that action at this time.
0 commit comments