@@ -49,8 +49,7 @@ describe("fieldVueMultiSelect.vue", () => {
49
49
} ) ;
50
50
51
51
it ( "should contain option elements" , ( ) => {
52
- let options = input . querySelectorAll ( "li.multiselect__option" ) ;
53
- console . log ( options ) ;
52
+ let options = input . querySelectorAll ( "li.multiselect__option" ) ;
54
53
expect ( options . length ) . to . be . equal ( schema . values . length ) ;
55
54
expect ( options [ 1 ] . querySelector ( "span" ) . textContent ) . to . be . equal ( "Paris" ) ;
56
55
expect ( options [ 1 ] . classList . contains ( "multiselect__option--selected" ) ) . to . be . true ;
@@ -68,6 +67,7 @@ describe("fieldVueMultiSelect.vue", () => {
68
67
it ( "input value should be the model value after changed" , ( done ) => {
69
68
model . city = "Rome" ;
70
69
vm . $nextTick ( ( ) => {
70
+ expect ( input . querySelectorAll ( "li.multiselect__option--selected" ) . length ) . to . be . equal ( 1 ) ;
71
71
let options = input . querySelectorAll ( "li.multiselect__option" ) ;
72
72
expect ( options [ 2 ] . querySelector ( "span" ) . textContent ) . to . be . equal ( "Rome" ) ;
73
73
expect ( options [ 2 ] . classList . contains ( "multiselect__option--selected" ) ) . to . be . true ;
@@ -78,6 +78,7 @@ describe("fieldVueMultiSelect.vue", () => {
78
78
it ( "input value should be the model value after changed (multiselection)" , ( done ) => {
79
79
model . city = [ "Paris" , "Rome" ] ;
80
80
vm . $nextTick ( ( ) => {
81
+ expect ( input . querySelectorAll ( "li.multiselect__option--selected" ) . length ) . to . be . equal ( 2 ) ;
81
82
let options = input . querySelectorAll ( "li.multiselect__option" ) ;
82
83
expect ( options [ 1 ] . querySelector ( "span" ) . textContent ) . to . be . equal ( "Paris" ) ;
83
84
expect ( options [ 1 ] . classList . contains ( "multiselect__option--selected" ) ) . to . be . true ;
@@ -92,6 +93,7 @@ describe("fieldVueMultiSelect.vue", () => {
92
93
trigger ( options [ 2 ] , "mousedown" ) ;
93
94
94
95
vm . $nextTick ( ( ) => {
96
+ expect ( model . city . length ) . to . be . equal ( 1 ) ;
95
97
expect ( model . city [ 0 ] ) . to . be . equal ( "Paris" ) ;
96
98
done ( ) ;
97
99
} ) ;
0 commit comments