@macallumharvey/first-test-wet 2.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/WetButton.d.ts +1 -1
- package/dist/first-test-wet.cjs.development.js +5 -0
- package/dist/first-test-wet.cjs.development.js.map +1 -1
- package/dist/first-test-wet.cjs.production.min.js +1 -1
- package/dist/first-test-wet.cjs.production.min.js.map +1 -1
- package/dist/first-test-wet.esm.js +5 -1
- package/dist/first-test-wet.esm.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/WetButton.tsx +1 -1
- package/src/WetModal.tsx +1 -0
- package/src/index.tsx +1 -0
- package/src/theme-wet-boew/assets/favicon-mobile.png +0 -0
- package/src/theme-wet-boew/assets/favicon.ico +0 -0
- package/src/theme-wet-boew/assets/logo.png +0 -0
- package/src/theme-wet-boew/assets/logo.svg +14 -0
- package/src/theme-wet-boew/css/ie8-theme.css +17370 -0
- package/src/theme-wet-boew/css/ie8-theme.min.css +193 -0
- package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.js → theme-wet-boew/css/ie8-wet-boew.css} +12 -10
- package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js → theme-wet-boew/css/ie8-wet-boew.min.css} +7 -7
- package/src/theme-wet-boew/css/theme.css +11357 -0
- package/src/theme-wet-boew/css/theme.min.css +6 -0
- package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.js → theme-wet-boew/css/wet-boew.css} +12 -10
- package/src/{wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js → theme-wet-boew/css/wet-boew.min.css} +6 -7
- package/src/theme-wet-boew/payload.json +66 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/mediacontrols.html +32 -33
- package/src/wet-boew/assets/sprites_share.png +0 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.css +112 -112
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/noscript.min.css +5 -5
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.css +32 -32
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.css +47 -47
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.css +28 -28
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.css +16 -16
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.css +24 -24
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.css +8 -8
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.css +229 -229
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.svg +287 -287
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/additional-methods.js +1511 -1511
- package/src/wet-boew/js/deps/additional-methods.min.js +9 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/geomap-lib.js +3758 -3770
- package/src/wet-boew/js/deps/geomap-lib.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.dataTables.js +15345 -15733
- package/src/wet-boew/js/deps/jquery.dataTables.min.js +4 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.canvas.js +345 -345
- package/src/wet-boew/js/deps/jquery.flot.canvas.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.js +3168 -3168
- package/src/wet-boew/js/deps/jquery.flot.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.orderBars.js +282 -282
- package/src/wet-boew/js/deps/jquery.flot.orderBars.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.flot.pie.js +820 -820
- package/src/wet-boew/js/deps/jquery.flot.pie.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.magnific-popup.js +2060 -2060
- package/src/wet-boew/js/deps/jquery.magnific-popup.min.js +4 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jquery.validate.js +1660 -1660
- package/src/wet-boew/js/deps/jquery.validate.min.js +9 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/json-patch.js +314 -314
- package/src/wet-boew/js/deps/json-patch.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/jsonpointer.js +349 -349
- package/src/wet-boew/js/deps/jsonpointer.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.js +53 -53
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.js +49 -49
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.js +64 -64
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.js +160 -160
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.js +92 -92
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.js +94 -94
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.js +59 -59
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.js +102 -102
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.js +67 -67
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.js +95 -95
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.js +63 -63
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.js +50 -50
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.js +60 -60
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.js +183 -183
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-matlab.min.js +1 -1
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.js +57 -57
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.js +140 -140
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.js +67 -67
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.js +49 -49
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.js +37 -37
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.js +59 -59
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.js +50 -50
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.js +81 -81
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.js +56 -56
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.js +59 -59
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.js +60 -60
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.js +63 -63
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.js +49 -49
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.js +67 -67
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.js +51 -51
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.js +55 -55
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.js +71 -71
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.js +45 -45
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/ol.js +1008 -1008
- package/src/wet-boew/js/deps/ol.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/prettify.js +1742 -1742
- package/src/wet-boew/js/deps/prettify.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/proj4.js +2 -2
- package/src/wet-boew/js/deps/proj4.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/run_prettify.js +1998 -1998
- package/src/wet-boew/js/deps/run_prettify.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/tableparser.js +2216 -2216
- package/src/wet-boew/js/deps/tableparser.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/unorm.js +452 -452
- package/src/wet-boew/js/deps/unorm.min.js +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/af.js +246 -254
- package/src/wet-boew/js/i18n/af.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ar.js +284 -292
- package/src/wet-boew/js/i18n/ar.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/bg.js +284 -292
- package/src/wet-boew/js/i18n/bg.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/cs.js +285 -293
- package/src/wet-boew/js/i18n/cs.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/de.js +354 -362
- package/src/wet-boew/js/i18n/de.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/el.js +284 -292
- package/src/wet-boew/js/i18n/el.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/en.js +246 -254
- package/src/wet-boew/js/i18n/en.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/es.js +287 -295
- package/src/wet-boew/js/i18n/es.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/et.js +282 -290
- package/src/wet-boew/js/i18n/et.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/fr.js +313 -321
- package/src/wet-boew/js/i18n/fr.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hi.js +246 -254
- package/src/wet-boew/js/i18n/hi.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hu.js +284 -292
- package/src/wet-boew/js/i18n/hu.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/hy.js +246 -254
- package/src/wet-boew/js/i18n/hy.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/id.js +283 -291
- package/src/wet-boew/js/i18n/id.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/is.js +282 -290
- package/src/wet-boew/js/i18n/is.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/it.js +311 -319
- package/src/wet-boew/js/i18n/it.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/iu.js +246 -254
- package/src/wet-boew/js/i18n/iu.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ja.js +285 -293
- package/src/wet-boew/js/i18n/ja.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ko.js +284 -292
- package/src/wet-boew/js/i18n/ko.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lt.js +284 -292
- package/src/wet-boew/js/i18n/lt.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/lv.js +284 -292
- package/src/wet-boew/js/i18n/lv.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/nl.js +318 -326
- package/src/wet-boew/js/i18n/nl.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pl.js +287 -295
- package/src/wet-boew/js/i18n/pl.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt-BR.js +246 -254
- package/src/wet-boew/js/i18n/pt-BR.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/pt.js +270 -278
- package/src/wet-boew/js/i18n/pt.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/ru.js +284 -292
- package/src/wet-boew/js/i18n/ru.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sk.js +282 -290
- package/src/wet-boew/js/i18n/sk.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/sq.js +246 -254
- package/src/wet-boew/js/i18n/sq.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/th.js +284 -292
- package/src/wet-boew/js/i18n/th.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/tr.js +286 -294
- package/src/wet-boew/js/i18n/tr.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/uk.js +284 -292
- package/src/wet-boew/js/i18n/uk.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/vi.js +284 -292
- package/src/wet-boew/js/i18n/vi.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh-Hans.js +246 -254
- package/src/wet-boew/js/i18n/zh-Hans.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/i18n/zh.js +285 -293
- package/src/wet-boew/js/i18n/zh.min.js +7 -0
- package/src/wet-boew/js/ie8-wet-boew.js +3992 -0
- package/src/wet-boew/js/ie8-wet-boew.min.js +7 -0
- package/src/wet-boew/js/ie8-wet-boew2.js +15294 -0
- package/src/wet-boew/js/ie8-wet-boew2.min.js +7 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.js +9814 -9814
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.js +4 -4
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist.js +423 -419
- package/src/wet-boew/js/polyfills/datalist.min.js +8 -0
- package/src/wet-boew/js/polyfills/datalist.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.js +50 -50
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datalist_dynamic.min.js +7 -7
- package/src/wet-boew/js/polyfills/datalist_dynamic.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/datepicker.js +338 -338
- package/src/wet-boew/js/polyfills/datepicker.min.js +8 -0
- package/src/wet-boew/js/polyfills/datepicker.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/details.js +126 -126
- package/src/wet-boew/js/polyfills/details.min.js +8 -0
- package/src/wet-boew/js/polyfills/details.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.js +47 -47
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/jawsariafixes.min.js +15 -15
- package/src/wet-boew/js/polyfills/jawsariafixes.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/meter.js +140 -140
- package/src/wet-boew/js/polyfills/meter.min.js +8 -0
- package/src/wet-boew/js/polyfills/meter.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/mobile.js +783 -784
- package/src/wet-boew/js/polyfills/mobile.min.js +8 -0
- package/src/wet-boew/js/polyfills/mobile.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/progress.js +107 -107
- package/src/wet-boew/js/polyfills/progress.min.js +8 -0
- package/src/wet-boew/js/polyfills/progress.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider.js +1343 -1343
- package/src/wet-boew/js/polyfills/slider.min.js +9 -0
- package/src/wet-boew/js/polyfills/slider.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.js +73 -73
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/slider_wrapper.min.js +7 -7
- package/src/wet-boew/js/polyfills/slider_wrapper.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.js +29 -29
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/svg.min.js +7 -7
- package/src/wet-boew/js/polyfills/svg.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.js +603 -603
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/polyfills/test.min.js +7 -7
- package/src/wet-boew/js/polyfills/test.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/wet-boew.js +17714 -20264
- package/src/wet-boew/js/wet-boew.min.js +9 -0
- package/src/wet-boew/js/wet-boew.min.js.map +1 -0
- package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/payload.json +1721 -1721
- package/src/wet-boew-cdn-4.0.81.1/Licence-fr.txt +0 -1
- package/src/wet-boew-cdn-4.0.81.1/License-en.txt +0 -1
- package/src/wet-boew-cdn-4.0.81.1/assets/sprites_share.png +0 -0
- package/src/wet-boew-cdn-4.0.81.1/js/deps/additional-methods.min.js +0 -9
- package/src/wet-boew-cdn-4.0.81.1/js/deps/geomap-lib.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.dataTables.min.js +0 -4
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.canvas.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.orderBars.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.flot.pie.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.magnific-popup.min.js +0 -4
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jquery.validate.min.js +0 -9
- package/src/wet-boew-cdn-4.0.81.1/js/deps/json-patch.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/jsonpointer.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/ol.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/prettify.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/proj4.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/run_prettify.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/tableparser.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/deps/unorm.min.js +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/af.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/ar.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/bg.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/cs.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/de.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/el.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/en.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/es.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/et.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/fr.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/hi.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/hu.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/hy.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/id.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/is.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/it.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/iu.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/ja.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/ko.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/lt.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/lv.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/nl.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/pl.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt-BR.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/pt.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/ru.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/sk.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/sq.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/th.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/tr.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/uk.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/vi.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh-Hans.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/i18n/zh.min.js +0 -7
- package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/ie8-wet-boew2.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datalist_dynamic.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/datepicker.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/details.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/jawsariafixes.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/meter.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/mobile.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js +0 -8
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/progress.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js +0 -9
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/slider_wrapper.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/svg.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/polyfills/test.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js +0 -9
- package/src/wet-boew-cdn-4.0.81.1/js/wet-boew.min.js.map +0 -1
- package/src/wet-boew-cdn-4.0.81.1/package.json +0 -15
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/cloud-popup-relative.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/fd-slider-sprite.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/loading.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-minus-mini.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-plus-mini.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/assets/zoom-world-mini.png +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datalist.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/datepicker.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/details.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/mathml.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/meter.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/progress.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/css/polyfills/slider.min.css +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.eot +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.ttf +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/fonts/glyphicons-halflings-regular.woff2 +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/mml-chtml.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/MathJax/output/chtml/fonts/woff-v2/MathJax_Zero.woff +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-apollo.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-basic.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-clj.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-css.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-dart.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-erlang.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-go.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-hs.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lasso.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lisp.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-llvm.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-logtalk.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-lua.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-ml.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-mumps.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-n.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-pascal.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-proto.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-r.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rd.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-rust.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-scala.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-sql.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-swift.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tcl.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-tex.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vb.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-vhdl.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-wiki.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-xq.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/deps/lang-yaml.min.js +0 -0
- /package/src/{wet-boew-cdn-4.0.81.1 → wet-boew}/js/jquery/2.2.4/jquery.min.map +0 -0
@@ -1,603 +1,603 @@
|
|
1
|
-
/**
|
2
|
-
* @title Date Picker Unit Tests
|
3
|
-
* @overview Test the date picker behaviour
|
4
|
-
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
|
5
|
-
* @author @LaurentGoderre
|
6
|
-
*/
|
7
|
-
( function( $, wb ) {
|
8
|
-
|
9
|
-
var runTest = Modernizr.inputtypes.date ? describe.skip : describe;
|
10
|
-
|
11
|
-
runTest( "Input type=\"date\" polyfill (date picker)", function() {
|
12
|
-
var sandbox = sinon.sandbox.create(),
|
13
|
-
selector = "input[type=date]",
|
14
|
-
$document = wb.doc,
|
15
|
-
$body = $document.find( "body" ),
|
16
|
-
calendarSelector = "#wb-picker",
|
17
|
-
$formGroup, $calendar, $elm, spy, callback,
|
18
|
-
beforeFactory = function( elm, label ) {
|
19
|
-
elm = elm || "<input type=\"date\" id=\"appointment\"/>";
|
20
|
-
label = label || "<label for=\"appointment\">Appointment Date</label>";
|
21
|
-
return function( done ) {
|
22
|
-
|
23
|
-
// Spy on jQuery's trigger method to see how it's called during the plugin's initialization
|
24
|
-
spy = sandbox.spy( $.prototype, "trigger" );
|
25
|
-
|
26
|
-
if ( !callback ) {
|
27
|
-
callback = done;
|
28
|
-
}
|
29
|
-
|
30
|
-
$formGroup = $(
|
31
|
-
"<div>" + label + "</div>"
|
32
|
-
)
|
33
|
-
.prependTo( $body );
|
34
|
-
|
35
|
-
$elm = $( elm )
|
36
|
-
.appendTo( $formGroup );
|
37
|
-
|
38
|
-
$elm.trigger( "wb-init.wb-date" );
|
39
|
-
};
|
40
|
-
},
|
41
|
-
defaultAfter = function() {
|
42
|
-
|
43
|
-
// Restore the original behaviour of trigger once the tests are finished
|
44
|
-
sandbox.restore();
|
45
|
-
|
46
|
-
// Remove test data from the page
|
47
|
-
$formGroup.remove();
|
48
|
-
|
49
|
-
callback = null;
|
50
|
-
};
|
51
|
-
|
52
|
-
before( function() {
|
53
|
-
$document.on( "wb-init.wb-date", selector, function() {
|
54
|
-
$calendar = $( calendarSelector );
|
55
|
-
if ( callback ) {
|
56
|
-
callback();
|
57
|
-
}
|
58
|
-
} );
|
59
|
-
} );
|
60
|
-
|
61
|
-
describe( "initialization", function() {
|
62
|
-
before( beforeFactory() );
|
63
|
-
after( defaultAfter );
|
64
|
-
|
65
|
-
it( "should have marked the element as initialized", function() {
|
66
|
-
expect( $elm.hasClass( "wb-date-inited" ) ).to.equal( true );
|
67
|
-
} );
|
68
|
-
|
69
|
-
it( "should have created the date picker toggle button", function() {
|
70
|
-
var $toggle = $elm.next().find( "a" );
|
71
|
-
expect( $toggle.attr( "class" ) ).to.contain( "picker-toggle" );
|
72
|
-
expect( $toggle.attr( "id" ) ).to.equal( "appointment-picker-toggle" );
|
73
|
-
} );
|
74
|
-
|
75
|
-
it( "should have created an instance of the calendar plugin", function() {
|
76
|
-
expect( $calendar.length ).to.equal( 1 );
|
77
|
-
expect( $calendar.find( ".wb-clndr" ).length ).to.equal( 1 );
|
78
|
-
} );
|
79
|
-
|
80
|
-
it( "should have created a close icon", function() {
|
81
|
-
expect( $calendar.find( ".picker-close" ).length ).to.equal( 1 );
|
82
|
-
} );
|
83
|
-
|
84
|
-
it( "should have hidden the calendar", function() {
|
85
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
86
|
-
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "true" );
|
87
|
-
} );
|
88
|
-
|
89
|
-
it( "should have added links to the calendar", function() {
|
90
|
-
var lastDay = new Date();
|
91
|
-
lastDay.setMonth( lastDay.getMonth() + 1, 0 );
|
92
|
-
expect( $calendar.find( ".cal-days a" ).length ).to.equal( lastDay.getDate() );
|
93
|
-
} );
|
94
|
-
|
95
|
-
it( "should have stored a state object in the field element", function() {
|
96
|
-
var field = $elm.get( 0 ),
|
97
|
-
state = field.state,
|
98
|
-
today = new Date();
|
99
|
-
|
100
|
-
expect( typeof state ).to.equal( "object" );
|
101
|
-
expect( state.labelText ).to.equal( "Appointment Date" );
|
102
|
-
expect( state.field ).to.equal( field );
|
103
|
-
expect( state.$field.get( 0 ) ).to.equal( $elm.get( 0 ) );
|
104
|
-
expect( state.minDate.toString() ).to.equal( new Date( 1800, 0, 1 ).toString() );
|
105
|
-
expect( state.maxDate.toString() ).to.equal( new Date( 2100, 0, 1 ).toString() );
|
106
|
-
expect( state.year ).to.equal( today.getFullYear() );
|
107
|
-
expect( state.month ).to.equal( today.getMonth() );
|
108
|
-
expect( typeof state.daysCallback ).to.equal( "function" );
|
109
|
-
} );
|
110
|
-
} );
|
111
|
-
|
112
|
-
describe( "with a date format and error in the label", function() {
|
113
|
-
var label = "<label for=\"appointment\">" +
|
114
|
-
"<span class=\"field-name\">Appointment Date</span>" +
|
115
|
-
"<span class=\"datepicker-format\"> (<abbr title=\"Four digits year, dash, two digits month, dash, two digits day\">YYYY-MM-DD</abbr>)</span>" +
|
116
|
-
"<strong class=\"error\" id=\"appointment-error\">" +
|
117
|
-
"<span class=\"label label-danger\">" +
|
118
|
-
"<span class=\"prefix\">Error 1: </span>Please enter a valid date" +
|
119
|
-
"</span>" +
|
120
|
-
"</strong>" +
|
121
|
-
"</label>";
|
122
|
-
|
123
|
-
before( beforeFactory( null, label ) );
|
124
|
-
after( defaultAfter );
|
125
|
-
|
126
|
-
it( "should have stored only the field name in the label", function() {
|
127
|
-
var state = $elm.get( 0 ).state;
|
128
|
-
expect( state.labelText ).to.equal( "Appointment Date" );
|
129
|
-
} );
|
130
|
-
} );
|
131
|
-
|
132
|
-
describe( "with a populated date", function() {
|
133
|
-
before( beforeFactory( "<input type=\"date\" id=\"appointment\" value=\"2014-08-07\"/>" ) );
|
134
|
-
after( defaultAfter );
|
135
|
-
|
136
|
-
it( "should have stored the date in the state object", function() {
|
137
|
-
var state = $elm.get( 0 ).state;
|
138
|
-
expect( state.date.toString() ).to.equal( new Date( 2014, 7, 7 ).toString() );
|
139
|
-
} );
|
140
|
-
} );
|
141
|
-
|
142
|
-
describe( "toggle button", function() {
|
143
|
-
var hiddenAltText = "Pick a date from a calendar for field: Appointment Date";
|
144
|
-
|
145
|
-
before( beforeFactory() );
|
146
|
-
after( defaultAfter );
|
147
|
-
|
148
|
-
it( "should have added alternative text indentifying the parent control", function() {
|
149
|
-
var $toggle = $elm.next().find( "a" );
|
150
|
-
expect( $toggle.text() ).to.equal( hiddenAltText );
|
151
|
-
expect( $toggle.attr( "title" ) ).to.equal( hiddenAltText );
|
152
|
-
} );
|
153
|
-
|
154
|
-
describe( "click while calendar is closed", function() {
|
155
|
-
before( function() {
|
156
|
-
$elm.next().find( "a" ).click();
|
157
|
-
} );
|
158
|
-
|
159
|
-
after( function() {
|
160
|
-
$elm.next().find( "a" ).click();
|
161
|
-
} );
|
162
|
-
|
163
|
-
it( "should have opened the calendar", function() {
|
164
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( true );
|
165
|
-
expect( $calendar.css( "display" ) ).to.equal( "block" );
|
166
|
-
} );
|
167
|
-
|
168
|
-
it( "should have updated the alternative text on open", function() {
|
169
|
-
var $toggle = $elm.next().find( "a" );
|
170
|
-
var altText = "Hide calendar (escape key)";
|
171
|
-
expect( $toggle.text() ).to.equal( altText );
|
172
|
-
expect( $toggle.attr( "title" ) ).to.equal( altText );
|
173
|
-
} );
|
174
|
-
} );
|
175
|
-
|
176
|
-
describe( "click while calendar is opened", function() {
|
177
|
-
before( function() {
|
178
|
-
$elm.next().find( "a" ).click().click();
|
179
|
-
} );
|
180
|
-
|
181
|
-
it( "should have closed the calendar on a second click", function() {
|
182
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
183
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
184
|
-
} );
|
185
|
-
|
186
|
-
it( "should have updated the alternative text on close", function() {
|
187
|
-
var $toggle = $elm.next().find( "a" );
|
188
|
-
expect( $toggle.text() ).to.equal( hiddenAltText );
|
189
|
-
expect( $toggle.attr( "title" ) ).to.equal( hiddenAltText );
|
190
|
-
} );
|
191
|
-
} );
|
192
|
-
} );
|
193
|
-
|
194
|
-
describe( "toggle button for disabled date field", function() {
|
195
|
-
before( function( done ) {
|
196
|
-
callback = function() {
|
197
|
-
$elm.next().find( "a" ).click();
|
198
|
-
done();
|
199
|
-
};
|
200
|
-
beforeFactory( "<input type=\"date\" readonly id=\"appointment\"/>" )();
|
201
|
-
} );
|
202
|
-
after( function() {
|
203
|
-
|
204
|
-
//Avoids breaking subsequent tests if the test fails.
|
205
|
-
$elm.next().find( "a" ).click();
|
206
|
-
|
207
|
-
defaultAfter();
|
208
|
-
} );
|
209
|
-
|
210
|
-
it( "should not have opend the calendar on click", function() {
|
211
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
212
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
213
|
-
} );
|
214
|
-
} );
|
215
|
-
|
216
|
-
describe( "toggle button for read-only date field", function() {
|
217
|
-
before( function( done ) {
|
218
|
-
callback = function() {
|
219
|
-
$elm.next().find( "a" ).click();
|
220
|
-
done();
|
221
|
-
};
|
222
|
-
beforeFactory( "<input type=\"date\" readonly id=\"appointment\"/>" )();
|
223
|
-
} );
|
224
|
-
after( function() {
|
225
|
-
|
226
|
-
//Avoids breaking subsequent tests if the test fails.
|
227
|
-
$elm.next().find( "a" ).click();
|
228
|
-
|
229
|
-
defaultAfter();
|
230
|
-
} );
|
231
|
-
|
232
|
-
it( "should not have opend the calendar on click", function() {
|
233
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
234
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
235
|
-
} );
|
236
|
-
} );
|
237
|
-
|
238
|
-
describe( "close button", function() {
|
239
|
-
before( function( done ) {
|
240
|
-
callback = function() {
|
241
|
-
$elm.next().find( "a" ).click();
|
242
|
-
$( ".picker-close" ).click();
|
243
|
-
done();
|
244
|
-
};
|
245
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\"/>" )();
|
246
|
-
} );
|
247
|
-
after( defaultAfter );
|
248
|
-
|
249
|
-
it( "should have closed the calendar on click", function() {
|
250
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
251
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
252
|
-
} );
|
253
|
-
} );
|
254
|
-
|
255
|
-
describe( "keyboard shortcut", function() {
|
256
|
-
before( function( done ) {
|
257
|
-
callback = function() {
|
258
|
-
$elm.next().find( "a" ).click();
|
259
|
-
$calendar.trigger( {
|
260
|
-
type: "keydown",
|
261
|
-
which: 27
|
262
|
-
} );
|
263
|
-
done();
|
264
|
-
};
|
265
|
-
beforeFactory()();
|
266
|
-
} );
|
267
|
-
after( defaultAfter );
|
268
|
-
|
269
|
-
it( "should have close the calendar on pressing the escape key", function() {
|
270
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
271
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
272
|
-
} );
|
273
|
-
} );
|
274
|
-
|
275
|
-
describe( "opening the calendar", function() {
|
276
|
-
before( function( done ) {
|
277
|
-
callback = function() {
|
278
|
-
$elm.next().find( "a" ).click();
|
279
|
-
done();
|
280
|
-
};
|
281
|
-
beforeFactory( "<input type=\"date\" id=\"test\" min=\"2014-03-04\" max=\"2014-03-18\"/>", "<label for=\"test\">Test Date</label>" )();
|
282
|
-
} );
|
283
|
-
after( function() {
|
284
|
-
$elm.next().find( "a" ).click();
|
285
|
-
defaultAfter();
|
286
|
-
} );
|
287
|
-
|
288
|
-
it( "should have update the calendar settings object with the field state object", function() {
|
289
|
-
var state = $elm.get( 0 ).state,
|
290
|
-
calSettings = $calendar.get( 0 ).firstChild.lib,
|
291
|
-
key;
|
292
|
-
|
293
|
-
for ( key in state ) {
|
294
|
-
expect( calSettings[ key ] ).to.equal( state[ key ] );
|
295
|
-
}
|
296
|
-
} );
|
297
|
-
|
298
|
-
it( "should have updated the aria-hidden attribute", function() {
|
299
|
-
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "false" );
|
300
|
-
} );
|
301
|
-
|
302
|
-
it( "should have updated the aria-controls to the date field", function() {
|
303
|
-
expect( $calendar.attr( "aria-controls" ) ).to.equal( "test" );
|
304
|
-
} );
|
305
|
-
|
306
|
-
it( "should have updated the aria-labelled-by to the toggle button", function() {
|
307
|
-
expect( $calendar.attr( "aria-labelledby" ) ).to.equal( "test-picker-toggle" );
|
308
|
-
} );
|
309
|
-
|
310
|
-
it( "should have positioned the date picker immediately under the control", function() {
|
311
|
-
var calendarPosition = $calendar.offset(),
|
312
|
-
fieldPosition = $elm.offset();
|
313
|
-
|
314
|
-
expect( Math.floor( calendarPosition.left ) ).to.equal( Math.floor( fieldPosition.left ) );
|
315
|
-
expect( Math.floor( calendarPosition.top ) ).to.equal( Math.floor( fieldPosition.top + $elm.outerHeight() ) );
|
316
|
-
} );
|
317
|
-
} );
|
318
|
-
|
319
|
-
describe( "opening the calendar when the field has no date and the current date is inside the date range", function() {
|
320
|
-
var today = new Date();
|
321
|
-
|
322
|
-
before( function( done ) {
|
323
|
-
var minDate = new Date(),
|
324
|
-
maxDate = new Date();
|
325
|
-
|
326
|
-
minDate.setMonth( -1 );
|
327
|
-
maxDate.setMonth( 1 );
|
328
|
-
|
329
|
-
callback = function() {
|
330
|
-
$elm.next().find( "a" ).click();
|
331
|
-
done();
|
332
|
-
};
|
333
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\"" +
|
334
|
-
" min=\"" + minDate.toISOString().split( "T" )[ 0 ] +
|
335
|
-
" max=\"" + maxDate.toISOString().split( "T" )[ 0 ] +
|
336
|
-
" \"/>"
|
337
|
-
)();
|
338
|
-
} );
|
339
|
-
after( function() {
|
340
|
-
$elm.next().find( "a" ).click();
|
341
|
-
defaultAfter();
|
342
|
-
} );
|
343
|
-
|
344
|
-
it( "should have set the month and year to the current month and year", function() {
|
345
|
-
var settings = $calendar.get( 0 ).firstChild.lib;
|
346
|
-
expect( settings.year ).to.equal( today.getFullYear() );
|
347
|
-
expect( settings.month ).to.equal( today.getMonth() );
|
348
|
-
} );
|
349
|
-
} );
|
350
|
-
|
351
|
-
describe( "opening the calendar when the field has no date and the current date is outside the date range", function() {
|
352
|
-
var maxDate = new Date();
|
353
|
-
|
354
|
-
before( function( done ) {
|
355
|
-
var minDate = new Date();
|
356
|
-
|
357
|
-
minDate.setMonth( -2 );
|
358
|
-
maxDate.setMonth( -1 );
|
359
|
-
|
360
|
-
callback = function() {
|
361
|
-
$elm.next().find( "a" ).click();
|
362
|
-
done();
|
363
|
-
};
|
364
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" " +
|
365
|
-
"min=\"" + minDate.toISOString().split( "T" )[ 0 ] + "\" " +
|
366
|
-
"max=\"" + maxDate.toISOString().split( "T" )[ 0 ] + "\" />"
|
367
|
-
)();
|
368
|
-
} );
|
369
|
-
after( function() {
|
370
|
-
$elm.next().find( "a" ).click();
|
371
|
-
defaultAfter();
|
372
|
-
} );
|
373
|
-
|
374
|
-
it( "should have set the month and year to the maximum data's month and year", function() {
|
375
|
-
var settings = $calendar.get( 0 ).firstChild.lib;
|
376
|
-
expect( settings.year ).to.equal( maxDate.getFullYear() );
|
377
|
-
expect( settings.month ).to.equal( maxDate.getMonth() );
|
378
|
-
} );
|
379
|
-
} );
|
380
|
-
|
381
|
-
describe( "opening the calendar when the associated field has a date that is inside the date range", function() {
|
382
|
-
before( function( done ) {
|
383
|
-
callback = function() {
|
384
|
-
$elm.next().find( "a" ).click();
|
385
|
-
done();
|
386
|
-
};
|
387
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-18\" max=\"2015-03-18\" value=\"2014-08-07\"/>" )();
|
388
|
-
} );
|
389
|
-
after( function() {
|
390
|
-
$elm.next().find( "a" ).click();
|
391
|
-
defaultAfter();
|
392
|
-
} );
|
393
|
-
it( "should have set the calendar to the same month as the field's date", function() {
|
394
|
-
var settings = $calendar.get( 0 ).firstChild.lib;
|
395
|
-
expect( settings.year ).to.equal( 2014 );
|
396
|
-
expect( settings.month ).to.equal( 7 );
|
397
|
-
} );
|
398
|
-
|
399
|
-
it( "should have highlighted the selected date", function() {
|
400
|
-
expect( $calendar.find( ".cal-index-7 > a" ).attr( "aria-selected" ) ).to.equal( "true" );
|
401
|
-
} );
|
402
|
-
} );
|
403
|
-
|
404
|
-
describe( "closing the calendar", function() {
|
405
|
-
before( function( done ) {
|
406
|
-
callback = function() {
|
407
|
-
$elm.next().find( "a" ).click().click();
|
408
|
-
done();
|
409
|
-
};
|
410
|
-
beforeFactory()();
|
411
|
-
} );
|
412
|
-
after( defaultAfter );
|
413
|
-
|
414
|
-
it( "should have updated the aria-hidden attribute", function() {
|
415
|
-
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "true" );
|
416
|
-
} );
|
417
|
-
} );
|
418
|
-
|
419
|
-
describe( "minimum date", function() {
|
420
|
-
before( function( done ) {
|
421
|
-
callback = function() {
|
422
|
-
$elm.next().find( "a" ).click();
|
423
|
-
$( ".cal-year" ).val( 2014 ).trigger( "change" );
|
424
|
-
$( ".cal-month" ).val( 2 ).trigger( "change" );
|
425
|
-
done();
|
426
|
-
};
|
427
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-18\"/>" )();
|
428
|
-
} );
|
429
|
-
after( function() {
|
430
|
-
$elm.next().find( "a" ).click();
|
431
|
-
defaultAfter();
|
432
|
-
} );
|
433
|
-
|
434
|
-
it( "should have been added to the state object", function() {
|
435
|
-
expect( $elm.get( 0 ).state.minDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
436
|
-
} );
|
437
|
-
|
438
|
-
it( "should have been passed the minimum to the calendar plugin", function() {
|
439
|
-
expect( $calendar.get( 0 ).firstChild.lib.minDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
440
|
-
} );
|
441
|
-
|
442
|
-
it( "should have prevented the creation of links before the minimum date", function() {
|
443
|
-
expect( $calendar.find( ".cal-days a" ).length ).to.equal( 14 );
|
444
|
-
} );
|
445
|
-
} );
|
446
|
-
|
447
|
-
describe( "maximum date", function() {
|
448
|
-
before( function( done ) {
|
449
|
-
callback = function() {
|
450
|
-
$elm.next().find( "a" ).click();
|
451
|
-
$( ".cal-year" ).val( 2014 ).trigger( "change" );
|
452
|
-
$( ".cal-month" ).val( 2 ).trigger( "change" );
|
453
|
-
done();
|
454
|
-
};
|
455
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" max=\"2014-03-18\"/>" )();
|
456
|
-
} );
|
457
|
-
after( function() {
|
458
|
-
$elm.next().find( "a" ).click();
|
459
|
-
defaultAfter();
|
460
|
-
} );
|
461
|
-
|
462
|
-
it( "should have been added to the state object", function() {
|
463
|
-
expect( $elm.get( 0 ).state.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
464
|
-
} );
|
465
|
-
|
466
|
-
it( "should have been passed the minimum to the calendar plugin", function() {
|
467
|
-
expect( $calendar.get( 0 ).firstChild.lib.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
468
|
-
} );
|
469
|
-
|
470
|
-
it( "should have prevented the creation of links past the maximum date", function() {
|
471
|
-
expect( $calendar.find( ".cal-days a" ).length ).to.equal( 18 );
|
472
|
-
} );
|
473
|
-
} );
|
474
|
-
|
475
|
-
describe( "minimum and maximum dates in same month", function() {
|
476
|
-
before( function( done ) {
|
477
|
-
callback = function() {
|
478
|
-
$elm.next().find( "a" ).click();
|
479
|
-
done();
|
480
|
-
};
|
481
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-04\" max=\"2014-03-18\"/>" )();
|
482
|
-
} );
|
483
|
-
after( function() {
|
484
|
-
$elm.next().find( "a" ).click();
|
485
|
-
defaultAfter();
|
486
|
-
} );
|
487
|
-
|
488
|
-
it( "should have been passed the minimum and maximum to the calendar plugin", function() {
|
489
|
-
var settings = $calendar.get( 0 ).firstChild.lib;
|
490
|
-
expect( settings.minDate.toString() ).to.equal( new Date( 2014, 2, 4 ).toString() );
|
491
|
-
expect( settings.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
492
|
-
} );
|
493
|
-
|
494
|
-
it( "should have prevented the creation of links before the minimum date and past the maximum date", function() {
|
495
|
-
expect( $( calendarSelector ).find( ".cal-days a" ).length ).to.equal( 15 );
|
496
|
-
} );
|
497
|
-
} );
|
498
|
-
|
499
|
-
describe( "selecting a date", function() {
|
500
|
-
before( function( done ) {
|
501
|
-
callback = function() {
|
502
|
-
$elm.next().find( "a" ).click();
|
503
|
-
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
504
|
-
done();
|
505
|
-
};
|
506
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-01\" max=\"2014-03-31\"/>" )();
|
507
|
-
} );
|
508
|
-
after( defaultAfter );
|
509
|
-
|
510
|
-
it( "should have populated the from field with the selected date", function() {
|
511
|
-
expect( $elm.val() ).to.equal( "2014-03-06" );
|
512
|
-
} );
|
513
|
-
|
514
|
-
it( "should have triggered the change event on the form field", function() {
|
515
|
-
expect( spy.calledWith( "change" ) ).to.equal( true );
|
516
|
-
expect( spy.calledOn( $elm ) ).to.equal( true );
|
517
|
-
} );
|
518
|
-
|
519
|
-
it( "should have closed the calendar", function() {
|
520
|
-
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
521
|
-
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
522
|
-
} );
|
523
|
-
} );
|
524
|
-
|
525
|
-
describe( "selecting a date for a disabled field", function() {
|
526
|
-
before( function( done ) {
|
527
|
-
callback = function() {
|
528
|
-
$elm.next().find( "a" ).click();
|
529
|
-
$elm.attr( "disabled", "true" );
|
530
|
-
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
531
|
-
done();
|
532
|
-
};
|
533
|
-
beforeFactory()();
|
534
|
-
} );
|
535
|
-
after( function() {
|
536
|
-
$elm.next().find( "a" ).click();
|
537
|
-
defaultAfter();
|
538
|
-
} );
|
539
|
-
|
540
|
-
it( "should not have populated the form field", function() {
|
541
|
-
expect( $elm.val() ).to.equal( "" );
|
542
|
-
} );
|
543
|
-
|
544
|
-
it( "should not have triggered the change event on the form field", function() {
|
545
|
-
expect( spy.calledWith( "change" ) ).to.equal( false );
|
546
|
-
} );
|
547
|
-
} );
|
548
|
-
|
549
|
-
describe( "selecting a date for a read-only field", function() {
|
550
|
-
before( function( done ) {
|
551
|
-
callback = function() {
|
552
|
-
$elm.next().find( "a" ).click();
|
553
|
-
$elm.attr( "readonly", "true" );
|
554
|
-
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
555
|
-
done();
|
556
|
-
};
|
557
|
-
beforeFactory()();
|
558
|
-
} );
|
559
|
-
after( function() {
|
560
|
-
$elm.next().find( "a" ).click();
|
561
|
-
defaultAfter();
|
562
|
-
} );
|
563
|
-
|
564
|
-
it( "should not have populated the form field", function() {
|
565
|
-
expect( $elm.val() ).to.equal( "" );
|
566
|
-
} );
|
567
|
-
|
568
|
-
it( "should not have triggered the change event on the form field", function() {
|
569
|
-
expect( spy.calledWith( "change" ) ).to.equal( false );
|
570
|
-
} );
|
571
|
-
} );
|
572
|
-
|
573
|
-
describe( "updating the min and max date of the field after the creation of the element", function() {
|
574
|
-
before( function( done ) {
|
575
|
-
callback = function() {
|
576
|
-
$elm.next().find( "a" ).click().click();
|
577
|
-
$elm.attr( "min", "2014-03-12" );
|
578
|
-
$elm.attr( "max", "2014-03-17" );
|
579
|
-
$elm.next().find( "a" ).click();
|
580
|
-
done();
|
581
|
-
};
|
582
|
-
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-08\" max=\"2014-03-22\"/>" )();
|
583
|
-
} );
|
584
|
-
after( function() {
|
585
|
-
$elm.next().find( "a" ).click();
|
586
|
-
defaultAfter();
|
587
|
-
} );
|
588
|
-
|
589
|
-
it( "should have update the field's state", function() {
|
590
|
-
var field = $elm.get( 0 ),
|
591
|
-
state = field.state;
|
592
|
-
|
593
|
-
expect( state.minDate.toString() ).to.equal( new Date( 2014, 2, 12 ).toString() );
|
594
|
-
expect( state.maxDate.toString() ).to.equal( new Date( 2014, 2, 17 ).toString() );
|
595
|
-
} );
|
596
|
-
|
597
|
-
it( "should have update the min and max date of the date picker", function() {
|
598
|
-
expect( $( calendarSelector ).find( ".cal-days a" ).length ).to.equal( 6 );
|
599
|
-
} );
|
600
|
-
} );
|
601
|
-
} );
|
602
|
-
|
603
|
-
}( jQuery, wb ) );
|
1
|
+
/**
|
2
|
+
* @title Date Picker Unit Tests
|
3
|
+
* @overview Test the date picker behaviour
|
4
|
+
* @license wet-boew.github.io/wet-boew/License-en.html / wet-boew.github.io/wet-boew/Licence-fr.html
|
5
|
+
* @author @LaurentGoderre
|
6
|
+
*/
|
7
|
+
( function( $, wb ) {
|
8
|
+
|
9
|
+
var runTest = Modernizr.inputtypes.date ? describe.skip : describe;
|
10
|
+
|
11
|
+
runTest( "Input type=\"date\" polyfill (date picker)", function() {
|
12
|
+
var sandbox = sinon.sandbox.create(),
|
13
|
+
selector = "input[type=date]",
|
14
|
+
$document = wb.doc,
|
15
|
+
$body = $document.find( "body" ),
|
16
|
+
calendarSelector = "#wb-picker",
|
17
|
+
$formGroup, $calendar, $elm, spy, callback,
|
18
|
+
beforeFactory = function( elm, label ) {
|
19
|
+
elm = elm || "<input type=\"date\" id=\"appointment\"/>";
|
20
|
+
label = label || "<label for=\"appointment\">Appointment Date</label>";
|
21
|
+
return function( done ) {
|
22
|
+
|
23
|
+
// Spy on jQuery's trigger method to see how it's called during the plugin's initialization
|
24
|
+
spy = sandbox.spy( $.prototype, "trigger" );
|
25
|
+
|
26
|
+
if ( !callback ) {
|
27
|
+
callback = done;
|
28
|
+
}
|
29
|
+
|
30
|
+
$formGroup = $(
|
31
|
+
"<div>" + label + "</div>"
|
32
|
+
)
|
33
|
+
.prependTo( $body );
|
34
|
+
|
35
|
+
$elm = $( elm )
|
36
|
+
.appendTo( $formGroup );
|
37
|
+
|
38
|
+
$elm.trigger( "wb-init.wb-date" );
|
39
|
+
};
|
40
|
+
},
|
41
|
+
defaultAfter = function() {
|
42
|
+
|
43
|
+
// Restore the original behaviour of trigger once the tests are finished
|
44
|
+
sandbox.restore();
|
45
|
+
|
46
|
+
// Remove test data from the page
|
47
|
+
$formGroup.remove();
|
48
|
+
|
49
|
+
callback = null;
|
50
|
+
};
|
51
|
+
|
52
|
+
before( function() {
|
53
|
+
$document.on( "wb-init.wb-date", selector, function() {
|
54
|
+
$calendar = $( calendarSelector );
|
55
|
+
if ( callback ) {
|
56
|
+
callback();
|
57
|
+
}
|
58
|
+
} );
|
59
|
+
} );
|
60
|
+
|
61
|
+
describe( "initialization", function() {
|
62
|
+
before( beforeFactory() );
|
63
|
+
after( defaultAfter );
|
64
|
+
|
65
|
+
it( "should have marked the element as initialized", function() {
|
66
|
+
expect( $elm.hasClass( "wb-date-inited" ) ).to.equal( true );
|
67
|
+
} );
|
68
|
+
|
69
|
+
it( "should have created the date picker toggle button", function() {
|
70
|
+
var $toggle = $elm.next().find( "a" );
|
71
|
+
expect( $toggle.attr( "class" ) ).to.contain( "picker-toggle" );
|
72
|
+
expect( $toggle.attr( "id" ) ).to.equal( "appointment-picker-toggle" );
|
73
|
+
} );
|
74
|
+
|
75
|
+
it( "should have created an instance of the calendar plugin", function() {
|
76
|
+
expect( $calendar.length ).to.equal( 1 );
|
77
|
+
expect( $calendar.find( ".wb-clndr" ).length ).to.equal( 1 );
|
78
|
+
} );
|
79
|
+
|
80
|
+
it( "should have created a close icon", function() {
|
81
|
+
expect( $calendar.find( ".picker-close" ).length ).to.equal( 1 );
|
82
|
+
} );
|
83
|
+
|
84
|
+
it( "should have hidden the calendar", function() {
|
85
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
86
|
+
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "true" );
|
87
|
+
} );
|
88
|
+
|
89
|
+
it( "should have added links to the calendar", function() {
|
90
|
+
var lastDay = new Date();
|
91
|
+
lastDay.setMonth( lastDay.getMonth() + 1, 0 );
|
92
|
+
expect( $calendar.find( ".cal-days a" ).length ).to.equal( lastDay.getDate() );
|
93
|
+
} );
|
94
|
+
|
95
|
+
it( "should have stored a state object in the field element", function() {
|
96
|
+
var field = $elm.get( 0 ),
|
97
|
+
state = field.state,
|
98
|
+
today = new Date();
|
99
|
+
|
100
|
+
expect( typeof state ).to.equal( "object" );
|
101
|
+
expect( state.labelText ).to.equal( "Appointment Date" );
|
102
|
+
expect( state.field ).to.equal( field );
|
103
|
+
expect( state.$field.get( 0 ) ).to.equal( $elm.get( 0 ) );
|
104
|
+
expect( state.minDate.toString() ).to.equal( new Date( 1800, 0, 1 ).toString() );
|
105
|
+
expect( state.maxDate.toString() ).to.equal( new Date( 2100, 0, 1 ).toString() );
|
106
|
+
expect( state.year ).to.equal( today.getFullYear() );
|
107
|
+
expect( state.month ).to.equal( today.getMonth() );
|
108
|
+
expect( typeof state.daysCallback ).to.equal( "function" );
|
109
|
+
} );
|
110
|
+
} );
|
111
|
+
|
112
|
+
describe( "with a date format and error in the label", function() {
|
113
|
+
var label = "<label for=\"appointment\">" +
|
114
|
+
"<span class=\"field-name\">Appointment Date</span>" +
|
115
|
+
"<span class=\"datepicker-format\"> (<abbr title=\"Four digits year, dash, two digits month, dash, two digits day\">YYYY-MM-DD</abbr>)</span>" +
|
116
|
+
"<strong class=\"error\" id=\"appointment-error\">" +
|
117
|
+
"<span class=\"label label-danger\">" +
|
118
|
+
"<span class=\"prefix\">Error 1: </span>Please enter a valid date" +
|
119
|
+
"</span>" +
|
120
|
+
"</strong>" +
|
121
|
+
"</label>";
|
122
|
+
|
123
|
+
before( beforeFactory( null, label ) );
|
124
|
+
after( defaultAfter );
|
125
|
+
|
126
|
+
it( "should have stored only the field name in the label", function() {
|
127
|
+
var state = $elm.get( 0 ).state;
|
128
|
+
expect( state.labelText ).to.equal( "Appointment Date" );
|
129
|
+
} );
|
130
|
+
} );
|
131
|
+
|
132
|
+
describe( "with a populated date", function() {
|
133
|
+
before( beforeFactory( "<input type=\"date\" id=\"appointment\" value=\"2014-08-07\"/>" ) );
|
134
|
+
after( defaultAfter );
|
135
|
+
|
136
|
+
it( "should have stored the date in the state object", function() {
|
137
|
+
var state = $elm.get( 0 ).state;
|
138
|
+
expect( state.date.toString() ).to.equal( new Date( 2014, 7, 7 ).toString() );
|
139
|
+
} );
|
140
|
+
} );
|
141
|
+
|
142
|
+
describe( "toggle button", function() {
|
143
|
+
var hiddenAltText = "Pick a date from a calendar for field: Appointment Date";
|
144
|
+
|
145
|
+
before( beforeFactory() );
|
146
|
+
after( defaultAfter );
|
147
|
+
|
148
|
+
it( "should have added alternative text indentifying the parent control", function() {
|
149
|
+
var $toggle = $elm.next().find( "a" );
|
150
|
+
expect( $toggle.text() ).to.equal( hiddenAltText );
|
151
|
+
expect( $toggle.attr( "title" ) ).to.equal( hiddenAltText );
|
152
|
+
} );
|
153
|
+
|
154
|
+
describe( "click while calendar is closed", function() {
|
155
|
+
before( function() {
|
156
|
+
$elm.next().find( "a" ).click();
|
157
|
+
} );
|
158
|
+
|
159
|
+
after( function() {
|
160
|
+
$elm.next().find( "a" ).click();
|
161
|
+
} );
|
162
|
+
|
163
|
+
it( "should have opened the calendar", function() {
|
164
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( true );
|
165
|
+
expect( $calendar.css( "display" ) ).to.equal( "block" );
|
166
|
+
} );
|
167
|
+
|
168
|
+
it( "should have updated the alternative text on open", function() {
|
169
|
+
var $toggle = $elm.next().find( "a" );
|
170
|
+
var altText = "Hide calendar (escape key)";
|
171
|
+
expect( $toggle.text() ).to.equal( altText );
|
172
|
+
expect( $toggle.attr( "title" ) ).to.equal( altText );
|
173
|
+
} );
|
174
|
+
} );
|
175
|
+
|
176
|
+
describe( "click while calendar is opened", function() {
|
177
|
+
before( function() {
|
178
|
+
$elm.next().find( "a" ).click().click();
|
179
|
+
} );
|
180
|
+
|
181
|
+
it( "should have closed the calendar on a second click", function() {
|
182
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
183
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
184
|
+
} );
|
185
|
+
|
186
|
+
it( "should have updated the alternative text on close", function() {
|
187
|
+
var $toggle = $elm.next().find( "a" );
|
188
|
+
expect( $toggle.text() ).to.equal( hiddenAltText );
|
189
|
+
expect( $toggle.attr( "title" ) ).to.equal( hiddenAltText );
|
190
|
+
} );
|
191
|
+
} );
|
192
|
+
} );
|
193
|
+
|
194
|
+
describe( "toggle button for disabled date field", function() {
|
195
|
+
before( function( done ) {
|
196
|
+
callback = function() {
|
197
|
+
$elm.next().find( "a" ).click();
|
198
|
+
done();
|
199
|
+
};
|
200
|
+
beforeFactory( "<input type=\"date\" readonly id=\"appointment\"/>" )();
|
201
|
+
} );
|
202
|
+
after( function() {
|
203
|
+
|
204
|
+
//Avoids breaking subsequent tests if the test fails.
|
205
|
+
$elm.next().find( "a" ).click();
|
206
|
+
|
207
|
+
defaultAfter();
|
208
|
+
} );
|
209
|
+
|
210
|
+
it( "should not have opend the calendar on click", function() {
|
211
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
212
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
213
|
+
} );
|
214
|
+
} );
|
215
|
+
|
216
|
+
describe( "toggle button for read-only date field", function() {
|
217
|
+
before( function( done ) {
|
218
|
+
callback = function() {
|
219
|
+
$elm.next().find( "a" ).click();
|
220
|
+
done();
|
221
|
+
};
|
222
|
+
beforeFactory( "<input type=\"date\" readonly id=\"appointment\"/>" )();
|
223
|
+
} );
|
224
|
+
after( function() {
|
225
|
+
|
226
|
+
//Avoids breaking subsequent tests if the test fails.
|
227
|
+
$elm.next().find( "a" ).click();
|
228
|
+
|
229
|
+
defaultAfter();
|
230
|
+
} );
|
231
|
+
|
232
|
+
it( "should not have opend the calendar on click", function() {
|
233
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
234
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
235
|
+
} );
|
236
|
+
} );
|
237
|
+
|
238
|
+
describe( "close button", function() {
|
239
|
+
before( function( done ) {
|
240
|
+
callback = function() {
|
241
|
+
$elm.next().find( "a" ).click();
|
242
|
+
$( ".picker-close" ).click();
|
243
|
+
done();
|
244
|
+
};
|
245
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\"/>" )();
|
246
|
+
} );
|
247
|
+
after( defaultAfter );
|
248
|
+
|
249
|
+
it( "should have closed the calendar on click", function() {
|
250
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
251
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
252
|
+
} );
|
253
|
+
} );
|
254
|
+
|
255
|
+
describe( "keyboard shortcut", function() {
|
256
|
+
before( function( done ) {
|
257
|
+
callback = function() {
|
258
|
+
$elm.next().find( "a" ).click();
|
259
|
+
$calendar.trigger( {
|
260
|
+
type: "keydown",
|
261
|
+
which: 27
|
262
|
+
} );
|
263
|
+
done();
|
264
|
+
};
|
265
|
+
beforeFactory()();
|
266
|
+
} );
|
267
|
+
after( defaultAfter );
|
268
|
+
|
269
|
+
it( "should have close the calendar on pressing the escape key", function() {
|
270
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
271
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
272
|
+
} );
|
273
|
+
} );
|
274
|
+
|
275
|
+
describe( "opening the calendar", function() {
|
276
|
+
before( function( done ) {
|
277
|
+
callback = function() {
|
278
|
+
$elm.next().find( "a" ).click();
|
279
|
+
done();
|
280
|
+
};
|
281
|
+
beforeFactory( "<input type=\"date\" id=\"test\" min=\"2014-03-04\" max=\"2014-03-18\"/>", "<label for=\"test\">Test Date</label>" )();
|
282
|
+
} );
|
283
|
+
after( function() {
|
284
|
+
$elm.next().find( "a" ).click();
|
285
|
+
defaultAfter();
|
286
|
+
} );
|
287
|
+
|
288
|
+
it( "should have update the calendar settings object with the field state object", function() {
|
289
|
+
var state = $elm.get( 0 ).state,
|
290
|
+
calSettings = $calendar.get( 0 ).firstChild.lib,
|
291
|
+
key;
|
292
|
+
|
293
|
+
for ( key in state ) {
|
294
|
+
expect( calSettings[ key ] ).to.equal( state[ key ] );
|
295
|
+
}
|
296
|
+
} );
|
297
|
+
|
298
|
+
it( "should have updated the aria-hidden attribute", function() {
|
299
|
+
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "false" );
|
300
|
+
} );
|
301
|
+
|
302
|
+
it( "should have updated the aria-controls to the date field", function() {
|
303
|
+
expect( $calendar.attr( "aria-controls" ) ).to.equal( "test" );
|
304
|
+
} );
|
305
|
+
|
306
|
+
it( "should have updated the aria-labelled-by to the toggle button", function() {
|
307
|
+
expect( $calendar.attr( "aria-labelledby" ) ).to.equal( "test-picker-toggle" );
|
308
|
+
} );
|
309
|
+
|
310
|
+
it( "should have positioned the date picker immediately under the control", function() {
|
311
|
+
var calendarPosition = $calendar.offset(),
|
312
|
+
fieldPosition = $elm.offset();
|
313
|
+
|
314
|
+
expect( Math.floor( calendarPosition.left ) ).to.equal( Math.floor( fieldPosition.left ) );
|
315
|
+
expect( Math.floor( calendarPosition.top ) ).to.equal( Math.floor( fieldPosition.top + $elm.outerHeight() ) );
|
316
|
+
} );
|
317
|
+
} );
|
318
|
+
|
319
|
+
describe( "opening the calendar when the field has no date and the current date is inside the date range", function() {
|
320
|
+
var today = new Date();
|
321
|
+
|
322
|
+
before( function( done ) {
|
323
|
+
var minDate = new Date(),
|
324
|
+
maxDate = new Date();
|
325
|
+
|
326
|
+
minDate.setMonth( -1 );
|
327
|
+
maxDate.setMonth( 1 );
|
328
|
+
|
329
|
+
callback = function() {
|
330
|
+
$elm.next().find( "a" ).click();
|
331
|
+
done();
|
332
|
+
};
|
333
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\"" +
|
334
|
+
" min=\"" + minDate.toISOString().split( "T" )[ 0 ] +
|
335
|
+
" max=\"" + maxDate.toISOString().split( "T" )[ 0 ] +
|
336
|
+
" \"/>"
|
337
|
+
)();
|
338
|
+
} );
|
339
|
+
after( function() {
|
340
|
+
$elm.next().find( "a" ).click();
|
341
|
+
defaultAfter();
|
342
|
+
} );
|
343
|
+
|
344
|
+
it( "should have set the month and year to the current month and year", function() {
|
345
|
+
var settings = $calendar.get( 0 ).firstChild.lib;
|
346
|
+
expect( settings.year ).to.equal( today.getFullYear() );
|
347
|
+
expect( settings.month ).to.equal( today.getMonth() );
|
348
|
+
} );
|
349
|
+
} );
|
350
|
+
|
351
|
+
describe( "opening the calendar when the field has no date and the current date is outside the date range", function() {
|
352
|
+
var maxDate = new Date();
|
353
|
+
|
354
|
+
before( function( done ) {
|
355
|
+
var minDate = new Date();
|
356
|
+
|
357
|
+
minDate.setMonth( -2 );
|
358
|
+
maxDate.setMonth( -1 );
|
359
|
+
|
360
|
+
callback = function() {
|
361
|
+
$elm.next().find( "a" ).click();
|
362
|
+
done();
|
363
|
+
};
|
364
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" " +
|
365
|
+
"min=\"" + minDate.toISOString().split( "T" )[ 0 ] + "\" " +
|
366
|
+
"max=\"" + maxDate.toISOString().split( "T" )[ 0 ] + "\" />"
|
367
|
+
)();
|
368
|
+
} );
|
369
|
+
after( function() {
|
370
|
+
$elm.next().find( "a" ).click();
|
371
|
+
defaultAfter();
|
372
|
+
} );
|
373
|
+
|
374
|
+
it( "should have set the month and year to the maximum data's month and year", function() {
|
375
|
+
var settings = $calendar.get( 0 ).firstChild.lib;
|
376
|
+
expect( settings.year ).to.equal( maxDate.getFullYear() );
|
377
|
+
expect( settings.month ).to.equal( maxDate.getMonth() );
|
378
|
+
} );
|
379
|
+
} );
|
380
|
+
|
381
|
+
describe( "opening the calendar when the associated field has a date that is inside the date range", function() {
|
382
|
+
before( function( done ) {
|
383
|
+
callback = function() {
|
384
|
+
$elm.next().find( "a" ).click();
|
385
|
+
done();
|
386
|
+
};
|
387
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-18\" max=\"2015-03-18\" value=\"2014-08-07\"/>" )();
|
388
|
+
} );
|
389
|
+
after( function() {
|
390
|
+
$elm.next().find( "a" ).click();
|
391
|
+
defaultAfter();
|
392
|
+
} );
|
393
|
+
it( "should have set the calendar to the same month as the field's date", function() {
|
394
|
+
var settings = $calendar.get( 0 ).firstChild.lib;
|
395
|
+
expect( settings.year ).to.equal( 2014 );
|
396
|
+
expect( settings.month ).to.equal( 7 );
|
397
|
+
} );
|
398
|
+
|
399
|
+
it( "should have highlighted the selected date", function() {
|
400
|
+
expect( $calendar.find( ".cal-index-7 > a" ).attr( "aria-selected" ) ).to.equal( "true" );
|
401
|
+
} );
|
402
|
+
} );
|
403
|
+
|
404
|
+
describe( "closing the calendar", function() {
|
405
|
+
before( function( done ) {
|
406
|
+
callback = function() {
|
407
|
+
$elm.next().find( "a" ).click().click();
|
408
|
+
done();
|
409
|
+
};
|
410
|
+
beforeFactory()();
|
411
|
+
} );
|
412
|
+
after( defaultAfter );
|
413
|
+
|
414
|
+
it( "should have updated the aria-hidden attribute", function() {
|
415
|
+
expect( $calendar.attr( "aria-hidden" ) ).to.equal( "true" );
|
416
|
+
} );
|
417
|
+
} );
|
418
|
+
|
419
|
+
describe( "minimum date", function() {
|
420
|
+
before( function( done ) {
|
421
|
+
callback = function() {
|
422
|
+
$elm.next().find( "a" ).click();
|
423
|
+
$( ".cal-year" ).val( 2014 ).trigger( "change" );
|
424
|
+
$( ".cal-month" ).val( 2 ).trigger( "change" );
|
425
|
+
done();
|
426
|
+
};
|
427
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-18\"/>" )();
|
428
|
+
} );
|
429
|
+
after( function() {
|
430
|
+
$elm.next().find( "a" ).click();
|
431
|
+
defaultAfter();
|
432
|
+
} );
|
433
|
+
|
434
|
+
it( "should have been added to the state object", function() {
|
435
|
+
expect( $elm.get( 0 ).state.minDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
436
|
+
} );
|
437
|
+
|
438
|
+
it( "should have been passed the minimum to the calendar plugin", function() {
|
439
|
+
expect( $calendar.get( 0 ).firstChild.lib.minDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
440
|
+
} );
|
441
|
+
|
442
|
+
it( "should have prevented the creation of links before the minimum date", function() {
|
443
|
+
expect( $calendar.find( ".cal-days a" ).length ).to.equal( 14 );
|
444
|
+
} );
|
445
|
+
} );
|
446
|
+
|
447
|
+
describe( "maximum date", function() {
|
448
|
+
before( function( done ) {
|
449
|
+
callback = function() {
|
450
|
+
$elm.next().find( "a" ).click();
|
451
|
+
$( ".cal-year" ).val( 2014 ).trigger( "change" );
|
452
|
+
$( ".cal-month" ).val( 2 ).trigger( "change" );
|
453
|
+
done();
|
454
|
+
};
|
455
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" max=\"2014-03-18\"/>" )();
|
456
|
+
} );
|
457
|
+
after( function() {
|
458
|
+
$elm.next().find( "a" ).click();
|
459
|
+
defaultAfter();
|
460
|
+
} );
|
461
|
+
|
462
|
+
it( "should have been added to the state object", function() {
|
463
|
+
expect( $elm.get( 0 ).state.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
464
|
+
} );
|
465
|
+
|
466
|
+
it( "should have been passed the minimum to the calendar plugin", function() {
|
467
|
+
expect( $calendar.get( 0 ).firstChild.lib.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
468
|
+
} );
|
469
|
+
|
470
|
+
it( "should have prevented the creation of links past the maximum date", function() {
|
471
|
+
expect( $calendar.find( ".cal-days a" ).length ).to.equal( 18 );
|
472
|
+
} );
|
473
|
+
} );
|
474
|
+
|
475
|
+
describe( "minimum and maximum dates in same month", function() {
|
476
|
+
before( function( done ) {
|
477
|
+
callback = function() {
|
478
|
+
$elm.next().find( "a" ).click();
|
479
|
+
done();
|
480
|
+
};
|
481
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-04\" max=\"2014-03-18\"/>" )();
|
482
|
+
} );
|
483
|
+
after( function() {
|
484
|
+
$elm.next().find( "a" ).click();
|
485
|
+
defaultAfter();
|
486
|
+
} );
|
487
|
+
|
488
|
+
it( "should have been passed the minimum and maximum to the calendar plugin", function() {
|
489
|
+
var settings = $calendar.get( 0 ).firstChild.lib;
|
490
|
+
expect( settings.minDate.toString() ).to.equal( new Date( 2014, 2, 4 ).toString() );
|
491
|
+
expect( settings.maxDate.toString() ).to.equal( new Date( 2014, 2, 18 ).toString() );
|
492
|
+
} );
|
493
|
+
|
494
|
+
it( "should have prevented the creation of links before the minimum date and past the maximum date", function() {
|
495
|
+
expect( $( calendarSelector ).find( ".cal-days a" ).length ).to.equal( 15 );
|
496
|
+
} );
|
497
|
+
} );
|
498
|
+
|
499
|
+
describe( "selecting a date", function() {
|
500
|
+
before( function( done ) {
|
501
|
+
callback = function() {
|
502
|
+
$elm.next().find( "a" ).click();
|
503
|
+
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
504
|
+
done();
|
505
|
+
};
|
506
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-01\" max=\"2014-03-31\"/>" )();
|
507
|
+
} );
|
508
|
+
after( defaultAfter );
|
509
|
+
|
510
|
+
it( "should have populated the from field with the selected date", function() {
|
511
|
+
expect( $elm.val() ).to.equal( "2014-03-06" );
|
512
|
+
} );
|
513
|
+
|
514
|
+
it( "should have triggered the change event on the form field", function() {
|
515
|
+
expect( spy.calledWith( "change" ) ).to.equal( true );
|
516
|
+
expect( spy.calledOn( $elm ) ).to.equal( true );
|
517
|
+
} );
|
518
|
+
|
519
|
+
it( "should have closed the calendar", function() {
|
520
|
+
expect( $calendar.hasClass( "open" ) ).to.equal( false );
|
521
|
+
expect( $calendar.css( "display" ) ).to.equal( "none" );
|
522
|
+
} );
|
523
|
+
} );
|
524
|
+
|
525
|
+
describe( "selecting a date for a disabled field", function() {
|
526
|
+
before( function( done ) {
|
527
|
+
callback = function() {
|
528
|
+
$elm.next().find( "a" ).click();
|
529
|
+
$elm.attr( "disabled", "true" );
|
530
|
+
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
531
|
+
done();
|
532
|
+
};
|
533
|
+
beforeFactory()();
|
534
|
+
} );
|
535
|
+
after( function() {
|
536
|
+
$elm.next().find( "a" ).click();
|
537
|
+
defaultAfter();
|
538
|
+
} );
|
539
|
+
|
540
|
+
it( "should not have populated the form field", function() {
|
541
|
+
expect( $elm.val() ).to.equal( "" );
|
542
|
+
} );
|
543
|
+
|
544
|
+
it( "should not have triggered the change event on the form field", function() {
|
545
|
+
expect( spy.calledWith( "change" ) ).to.equal( false );
|
546
|
+
} );
|
547
|
+
} );
|
548
|
+
|
549
|
+
describe( "selecting a date for a read-only field", function() {
|
550
|
+
before( function( done ) {
|
551
|
+
callback = function() {
|
552
|
+
$elm.next().find( "a" ).click();
|
553
|
+
$elm.attr( "readonly", "true" );
|
554
|
+
$calendar.find( ".cal-days a" ).eq( 5 ).click();
|
555
|
+
done();
|
556
|
+
};
|
557
|
+
beforeFactory()();
|
558
|
+
} );
|
559
|
+
after( function() {
|
560
|
+
$elm.next().find( "a" ).click();
|
561
|
+
defaultAfter();
|
562
|
+
} );
|
563
|
+
|
564
|
+
it( "should not have populated the form field", function() {
|
565
|
+
expect( $elm.val() ).to.equal( "" );
|
566
|
+
} );
|
567
|
+
|
568
|
+
it( "should not have triggered the change event on the form field", function() {
|
569
|
+
expect( spy.calledWith( "change" ) ).to.equal( false );
|
570
|
+
} );
|
571
|
+
} );
|
572
|
+
|
573
|
+
describe( "updating the min and max date of the field after the creation of the element", function() {
|
574
|
+
before( function( done ) {
|
575
|
+
callback = function() {
|
576
|
+
$elm.next().find( "a" ).click().click();
|
577
|
+
$elm.attr( "min", "2014-03-12" );
|
578
|
+
$elm.attr( "max", "2014-03-17" );
|
579
|
+
$elm.next().find( "a" ).click();
|
580
|
+
done();
|
581
|
+
};
|
582
|
+
beforeFactory( "<input type=\"date\" id=\"appointment\" min=\"2014-03-08\" max=\"2014-03-22\"/>" )();
|
583
|
+
} );
|
584
|
+
after( function() {
|
585
|
+
$elm.next().find( "a" ).click();
|
586
|
+
defaultAfter();
|
587
|
+
} );
|
588
|
+
|
589
|
+
it( "should have update the field's state", function() {
|
590
|
+
var field = $elm.get( 0 ),
|
591
|
+
state = field.state;
|
592
|
+
|
593
|
+
expect( state.minDate.toString() ).to.equal( new Date( 2014, 2, 12 ).toString() );
|
594
|
+
expect( state.maxDate.toString() ).to.equal( new Date( 2014, 2, 17 ).toString() );
|
595
|
+
} );
|
596
|
+
|
597
|
+
it( "should have update the min and max date of the date picker", function() {
|
598
|
+
expect( $( calendarSelector ).find( ".cal-days a" ).length ).to.equal( 6 );
|
599
|
+
} );
|
600
|
+
} );
|
601
|
+
} );
|
602
|
+
|
603
|
+
}( jQuery, wb ) );
|