@@ -66,6 +66,14 @@ describe("input + menu interactions behavior", () => {
66
66
expect ( wrapper . findAll ( "div[role='option']" ) . length ) . toBe ( options . length ) ;
67
67
} ) ;
68
68
69
+ it ( "should open the menu when clicking on the dropdown button" , async ( ) => {
70
+ const wrapper = mount ( VueSelect , { props : { modelValue : null , options } } ) ;
71
+
72
+ await wrapper . get ( ".dropdown-icon" ) . trigger ( "click" ) ;
73
+
74
+ expect ( wrapper . findAll ( "div[role='option']" ) . length ) . toBe ( options . length ) ;
75
+ } ) ;
76
+
69
77
it ( "should close the menu after focusing and pressing tab" , async ( ) => {
70
78
const wrapper = mount ( VueSelect , { props : { modelValue : null , options } } ) ;
71
79
@@ -327,6 +335,17 @@ describe("clear button", () => {
327
335
expect ( wrapper . emitted ( "update:modelValue" ) ) . toStrictEqual ( [ [ options [ 0 ] . value ] , [ undefined ] ] ) ;
328
336
expect ( wrapper . find ( ".clear-button" ) . exists ( ) ) . toBe ( false ) ;
329
337
} ) ;
338
+
339
+ it ( "should clear all selected options when clicking on the clear button with isMulti prop" , async ( ) => {
340
+ const wrapper = mount ( VueSelect , { props : { modelValue : [ ] , isMulti : true , options, isClearable : true } } ) ;
341
+
342
+ await openMenu ( wrapper ) ;
343
+ await wrapper . get ( "div[role='option']" ) . trigger ( "click" ) ;
344
+ await wrapper . get ( ".clear-button" ) . trigger ( "click" ) ;
345
+
346
+ expect ( wrapper . props ( "modelValue" ) ) . toStrictEqual ( [ options [ 0 ] . value ] ) ;
347
+ expect ( wrapper . find ( ".clear-button" ) . exists ( ) ) . toBe ( false ) ;
348
+ } ) ;
330
349
} ) ;
331
350
332
351
describe ( "search emit" , ( ) => {
0 commit comments