File tree 2 files changed +27
-3
lines changed 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 8
8
</ head >
9
9
< body >
10
10
<!-- template for the modal component -->
11
- < template id ="modal-template ">
11
+ < script type =" x/ template" id ="modal-template ">
12
12
< div class = "modal-mask" v-show = "show" v-transition = "modal" >
13
13
< div class = "modal-wrapper" >
14
14
< div class = "modal-container" >
34
34
</ div >
35
35
</ div >
36
36
</ div >
37
- </ template >
37
+ </ script >
38
38
39
39
< script >
40
40
// register modal component
52
52
53
53
<!-- app -->
54
54
< div id ="app ">
55
- < button v-on ="click: showModal = true "> Show Modal</ button >
55
+ < button id =" show-modal " v-on ="click: showModal = true "> Show Modal</ button >
56
56
<!-- use the modal component, pass in the prop -->
57
57
< modal show ="{{@showModal}} ">
58
58
<!--
Original file line number Diff line number Diff line change
1
+ casper . test . begin ( 'modal' , 8 , function ( test ) {
2
+
3
+ casper
4
+ . start ( '../../examples/modal/index.html' )
5
+ . then ( function ( ) {
6
+ test . assertNotVisible ( '.modal-mask' )
7
+ } )
8
+ . thenClick ( '#show-modal' , function ( ) {
9
+ test . assertVisible ( '.modal-mask' )
10
+ test . assertVisible ( '.modal-wrapper' )
11
+ test . assertVisible ( '.modal-container' )
12
+ test . assertSelectorHasText ( '.modal-header h3' , 'custom header' )
13
+ test . assertSelectorHasText ( '.modal-body' , 'default body' )
14
+ test . assertSelectorHasText ( '.modal-footer' , 'default footer' )
15
+ } )
16
+ . thenClick ( '.modal-default-button' , function ( ) {
17
+ test . assertNotVisible ( '.modal-mask' )
18
+ } )
19
+ // run
20
+ . run ( function ( ) {
21
+ test . done ( )
22
+ } )
23
+
24
+ } )
You can’t perform that action at this time.
0 commit comments