File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -87,6 +87,18 @@ describe('mobile', function() {
87
87
} ) ;
88
88
expect ( $ ( '.selectric-wrapper' ) . length ) . toBe ( 1 ) ;
89
89
} ) ;
90
+
91
+ it ( 'should refresh the select after change' , function ( ) {
92
+ setUserAgent ( window , 'Mozilla/5.0 (Linux; Android 4.1.1; Galaxy Nexus Build/JRO03C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19' ) ;
93
+ var spy = spyOn ( select . data ( 'selectric' ) , 'refresh' ) ;
94
+ select . selectric ( {
95
+ disableOnMobile : false ,
96
+ nativeOnMobile : true
97
+ } ) ;
98
+ select . trigger ( 'change' ) ;
99
+ expect ( spy ) . toHaveBeenCalled ( ) ;
100
+ } ) ;
101
+
90
102
describe ( 'nativeOnMobile' , function ( ) {
91
103
beforeEach ( function ( ) {
92
104
setUserAgent ( window , 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3' ) ;
@@ -96,6 +108,10 @@ describe('mobile', function() {
96
108
} ) ;
97
109
} ) ;
98
110
111
+ afterEach ( function ( ) {
112
+ setUserAgent ( window , oldUserAgent ) ;
113
+ } ) ;
114
+
99
115
it ( 'should add class `selectric-is-native`' , function ( ) {
100
116
expect ( $ ( '.selectric-wrapper' ) . find ( '.selectric-is-native' ) . length ) . toBe ( 1 ) ;
101
117
} ) ;
You can’t perform that action at this time.
0 commit comments