@aquera/nile-elements 1.5.2 → 1.5.3

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.
Files changed (517) hide show
  1. package/README.md +6 -0
  2. package/dist/index.cjs.js +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.js +239 -195
  5. package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
  6. package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
  7. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
  8. package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
  9. package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
  10. package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
  11. package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
  12. package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
  13. package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
  14. package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
  15. package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
  16. package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
  17. package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
  18. package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
  19. package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
  20. package/dist/nile-file-preview/utils/index.cjs.js +1 -1
  21. package/dist/nile-file-preview/utils/index.esm.js +1 -1
  22. package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
  23. package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
  24. package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
  25. package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
  26. package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
  27. package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
  28. package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
  29. package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
  30. package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
  31. package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
  32. package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
  33. package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
  34. package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
  35. package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
  36. package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
  37. package/dist/nile-file-upload/types/index.cjs.js +1 -1
  38. package/dist/nile-file-upload/types/index.esm.js +1 -1
  39. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
  40. package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
  41. package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
  42. package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
  43. package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
  44. package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
  45. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
  46. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
  47. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
  48. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
  49. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
  50. package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
  51. package/dist/nile-grid/nile-grid.cjs.js +1 -1
  52. package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
  53. package/dist/nile-grid/nile-grid.esm.js +2 -2
  54. package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
  55. package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
  56. package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
  57. package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
  58. package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
  59. package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
  60. package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
  61. package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
  62. package/dist/nile-grid/nile-grid.width.esm.js +1 -1
  63. package/dist/nile-input/nile-input.cjs.js +1 -1
  64. package/dist/nile-input/nile-input.cjs.js.map +1 -1
  65. package/dist/nile-input/nile-input.esm.js +1 -1
  66. package/dist/nile-popover/index.cjs.js +1 -1
  67. package/dist/nile-popover/index.esm.js +1 -1
  68. package/dist/nile-popover/nile-popover.cjs.js +4 -4
  69. package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
  70. package/dist/nile-popover/nile-popover.esm.js +11 -6
  71. package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
  72. package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
  73. package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
  74. package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
  75. package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
  76. package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
  77. package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
  78. package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
  79. package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
  80. package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
  81. package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
  82. package/dist/src/nile-badge/nile-badge.test.js +554 -35
  83. package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
  84. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
  85. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
  86. package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
  87. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
  88. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
  89. package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
  90. package/dist/src/nile-button/nile-button.test.js +499 -39
  91. package/dist/src/nile-button/nile-button.test.js.map +1 -1
  92. package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
  93. package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
  94. package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
  95. package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
  96. package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
  97. package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
  98. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
  99. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
  100. package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
  101. package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
  102. package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
  103. package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
  104. package/dist/src/nile-card/nile-card.test.js +102 -66
  105. package/dist/src/nile-card/nile-card.test.js.map +1 -1
  106. package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
  107. package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
  108. package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
  109. package/dist/src/nile-chip/nile-chip.test.js +101 -102
  110. package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
  111. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
  112. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
  113. package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
  114. package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
  115. package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
  116. package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
  117. package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
  118. package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
  119. package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
  120. package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
  121. package/dist/src/nile-divider/nile-divider.test.js +560 -0
  122. package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
  123. package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
  124. package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
  125. package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
  126. package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
  127. package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
  128. package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
  129. package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
  130. package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
  131. package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
  132. package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
  133. package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
  134. package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
  135. package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
  136. package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
  137. package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
  138. package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
  139. package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
  140. package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
  141. package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
  142. package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
  143. package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
  144. package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
  145. package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
  146. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
  147. package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
  148. package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
  149. package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
  150. package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
  151. package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
  152. package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
  153. package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
  154. package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
  155. package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
  156. package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
  157. package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
  158. package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
  159. package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
  160. package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
  161. package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
  162. package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
  163. package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
  164. package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
  165. package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
  166. package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
  167. package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
  168. package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
  169. package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
  170. package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
  171. package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
  172. package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
  173. package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
  174. package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
  175. package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
  176. package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
  177. package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
  178. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
  179. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
  180. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
  181. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
  182. package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
  183. package/dist/src/nile-grid/nile-grid.d.ts +1 -0
  184. package/dist/src/nile-grid/nile-grid.js +5 -1
  185. package/dist/src/nile-grid/nile-grid.js.map +1 -1
  186. package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
  187. package/dist/src/nile-grid/nile-grid.utils.js +13 -0
  188. package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
  189. package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
  190. package/dist/src/nile-heading/nile-heading.test.js +108 -0
  191. package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
  192. package/dist/src/nile-hero/nile-hero.test.js +101 -38
  193. package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
  194. package/dist/src/nile-icon/nile-icon.test.js +103 -40
  195. package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
  196. package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
  197. package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
  198. package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
  199. package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
  200. package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
  201. package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
  202. package/dist/src/nile-input/nile-input.js +1 -1
  203. package/dist/src/nile-input/nile-input.js.map +1 -1
  204. package/dist/src/nile-input/nile-input.test.js +109 -139
  205. package/dist/src/nile-input/nile-input.test.js.map +1 -1
  206. package/dist/src/nile-link/nile-link.test.js +103 -67
  207. package/dist/src/nile-link/nile-link.test.js.map +1 -1
  208. package/dist/src/nile-list/nile-list.test.d.ts +1 -0
  209. package/dist/src/nile-list/nile-list.test.js +108 -0
  210. package/dist/src/nile-list/nile-list.test.js.map +1 -0
  211. package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
  212. package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
  213. package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
  214. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
  215. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
  216. package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
  217. package/dist/src/nile-loader/nile-loader.test.js +107 -40
  218. package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
  219. package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
  220. package/dist/src/nile-menu/nile-menu.test.js +113 -0
  221. package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
  222. package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
  223. package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
  224. package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
  225. package/dist/src/nile-option/nile-option.test.d.ts +1 -0
  226. package/dist/src/nile-option/nile-option.test.js +108 -0
  227. package/dist/src/nile-option/nile-option.test.js.map +1 -0
  228. package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
  229. package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
  230. package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
  231. package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
  232. package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
  233. package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
  234. package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
  235. package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
  236. package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
  237. package/dist/src/nile-popover/nile-popover.test.js +103 -68
  238. package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
  239. package/dist/src/nile-popup/nile-popup.test.js +104 -65
  240. package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
  241. package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
  242. package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
  243. package/dist/src/nile-radio/nile-radio.test.js +103 -66
  244. package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
  245. package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
  246. package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
  247. package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
  248. package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
  249. package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
  250. package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
  251. package/dist/src/nile-select/nile-select.test.d.ts +0 -5
  252. package/dist/src/nile-select/nile-select.test.js +105 -244
  253. package/dist/src/nile-select/nile-select.test.js.map +1 -1
  254. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
  255. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
  256. package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
  257. package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
  258. package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
  259. package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
  260. package/dist/src/nile-slider/nile-slider.test.js +108 -0
  261. package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
  262. package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
  263. package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
  264. package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
  265. package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
  266. package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
  267. package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
  268. package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
  269. package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
  270. package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
  271. package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
  272. package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
  273. package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
  274. package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
  275. package/dist/src/nile-tab/nile-tab.test.js +108 -0
  276. package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
  277. package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
  278. package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
  279. package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
  280. package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
  281. package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
  282. package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
  283. package/dist/src/nile-tag/nile-tag.test.js +574 -0
  284. package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
  285. package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
  286. package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
  287. package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
  288. package/dist/src/nile-title/nile-title.test.d.ts +1 -0
  289. package/dist/src/nile-title/nile-title.test.js +108 -0
  290. package/dist/src/nile-title/nile-title.test.js.map +1 -0
  291. package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
  292. package/dist/src/nile-toast/nile-toast.test.js +526 -0
  293. package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
  294. package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
  295. package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
  296. package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
  297. package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
  298. package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
  299. package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
  300. package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
  301. package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
  302. package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
  303. package/dist/src/version.js +1 -1
  304. package/dist/src/version.js.map +1 -1
  305. package/dist/tsconfig.tsbuildinfo +1 -1
  306. package/package.json +1 -1
  307. package/rollup.config.js +7 -1
  308. package/src/nile-accordion/nile-accordian.test.ts +102 -116
  309. package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
  310. package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
  311. package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
  312. package/src/nile-avatar/nile-avatar.test.ts +102 -112
  313. package/src/nile-badge/nile-badge.test.ts +642 -30
  314. package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
  315. package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
  316. package/src/nile-button/nile-button.test.ts +593 -61
  317. package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
  318. package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
  319. package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
  320. package/src/nile-calendar/nile-calendar.test.ts +102 -406
  321. package/src/nile-card/nile-card.test.ts +103 -71
  322. package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
  323. package/src/nile-chip/nile-chip.test.ts +102 -136
  324. package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
  325. package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
  326. package/src/nile-dialog/nile-dialog.test.ts +102 -164
  327. package/src/nile-divider/nile-divider.test.ts +659 -0
  328. package/src/nile-drawer/nile-drawer.test.ts +105 -105
  329. package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
  330. package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
  331. package/src/nile-error-message/nile-error-message.test.ts +104 -67
  332. package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
  333. package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
  334. package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
  335. package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
  336. package/src/nile-file-preview/nile-file-preview.ts +23 -56
  337. package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
  338. package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
  339. package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
  340. package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
  341. package/src/nile-file-upload/nile-file-upload.ts +11 -3
  342. package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
  343. package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
  344. package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
  345. package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
  346. package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
  347. package/src/nile-form-group/nile-form-group.test.ts +103 -60
  348. package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
  349. package/src/nile-format-date/nile-format-date.test.ts +106 -0
  350. package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
  351. package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
  352. package/src/nile-grid/nile-grid.ts +6 -1
  353. package/src/nile-grid/nile-grid.utils.ts +18 -1
  354. package/src/nile-heading/nile-heading.test.ts +106 -0
  355. package/src/nile-hero/nile-hero.test.ts +103 -42
  356. package/src/nile-icon/nile-icon.test.ts +103 -50
  357. package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
  358. package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
  359. package/src/nile-input/nile-input.test.ts +105 -164
  360. package/src/nile-input/nile-input.ts +1 -1
  361. package/src/nile-link/nile-link.test.ts +104 -81
  362. package/src/nile-list/nile-list.test.ts +106 -0
  363. package/src/nile-list-item/nile-list-item.test.ts +106 -0
  364. package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
  365. package/src/nile-loader/nile-loader.test.ts +103 -48
  366. package/src/nile-menu/nile-menu.test.ts +106 -0
  367. package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
  368. package/src/nile-option/nile-option.test.ts +106 -0
  369. package/src/nile-option-group/nile-option-group.test.ts +106 -0
  370. package/src/nile-page-header/nile-page-header.test.ts +106 -0
  371. package/src/nile-pagination/nile-pagination.test.ts +106 -0
  372. package/src/nile-popover/nile-popover.test.ts +103 -83
  373. package/src/nile-popup/nile-popup.test.ts +102 -82
  374. package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
  375. package/src/nile-radio/nile-radio.test.ts +103 -78
  376. package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
  377. package/src/nile-section-message/nile-section-message.test.ts +106 -0
  378. package/src/nile-select/nile-select.test.ts +105 -308
  379. package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
  380. package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
  381. package/src/nile-slider/nile-slider.test.ts +106 -0
  382. package/src/nile-spinner/nile-spinner.test.ts +668 -0
  383. package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
  384. package/src/nile-stepper/nile-stepper.test.ts +107 -0
  385. package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
  386. package/src/nile-tab/nile-tab.test.ts +106 -0
  387. package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
  388. package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
  389. package/src/nile-tag/nile-tag.test.ts +675 -0
  390. package/src/nile-textarea/nile-textarea.test.ts +104 -100
  391. package/src/nile-title/nile-title.test.ts +106 -0
  392. package/src/nile-toast/nile-toast.test.ts +625 -0
  393. package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
  394. package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
  395. package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
  396. package/vscode-html-custom-data.json +8 -3
  397. package/web-test-runner.config.mjs +4 -2
  398. package/dist/axe.min-2720cd56.esm.js +0 -1
  399. package/dist/axe.min-69d47269.cjs.js +0 -2
  400. package/dist/axe.min-69d47269.cjs.js.map +0 -1
  401. package/dist/css-tag-bb10c0fa.cjs.js +0 -6
  402. package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
  403. package/dist/css-tag-dc564feb.esm.js +0 -6
  404. package/dist/fixture-958445f8.cjs.js +0 -395
  405. package/dist/fixture-958445f8.cjs.js.map +0 -1
  406. package/dist/fixture-985bba12.esm.js +0 -569
  407. package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
  408. package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
  409. package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
  410. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
  411. package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
  412. package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
  413. package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
  414. package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
  415. package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
  416. package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
  417. package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
  418. package/dist/nile-badge/nile-badge.test.esm.js +0 -1
  419. package/dist/nile-button/nile-button.test.cjs.js +0 -2
  420. package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
  421. package/dist/nile-button/nile-button.test.esm.js +0 -4
  422. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
  423. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
  424. package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
  425. package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
  426. package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
  427. package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
  428. package/dist/nile-card/nile-card.test.cjs.js +0 -2
  429. package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
  430. package/dist/nile-card/nile-card.test.esm.js +0 -51
  431. package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
  432. package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
  433. package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
  434. package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
  435. package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
  436. package/dist/nile-chip/nile-chip.test.esm.js +0 -1
  437. package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
  438. package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
  439. package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
  440. package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
  441. package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
  442. package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
  443. package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
  444. package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
  445. package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
  446. package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
  447. package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
  448. package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
  449. package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
  450. package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
  451. package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
  452. package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
  453. package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
  454. package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
  455. package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
  456. package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
  457. package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
  458. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
  459. package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
  460. package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
  461. package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
  462. package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
  463. package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
  464. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
  465. package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
  466. package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
  467. package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
  468. package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
  469. package/dist/nile-hero/nile-hero.test.esm.js +0 -14
  470. package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
  471. package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
  472. package/dist/nile-icon/nile-icon.test.esm.js +0 -1
  473. package/dist/nile-input/nile-input.test.cjs.js +0 -2
  474. package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
  475. package/dist/nile-input/nile-input.test.esm.js +0 -17
  476. package/dist/nile-link/nile-link.test.cjs.js +0 -2
  477. package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
  478. package/dist/nile-link/nile-link.test.esm.js +0 -1
  479. package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
  480. package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
  481. package/dist/nile-loader/nile-loader.test.esm.js +0 -1
  482. package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
  483. package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
  484. package/dist/nile-popover/nile-popover.test.esm.js +0 -21
  485. package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
  486. package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
  487. package/dist/nile-popup/nile-popup.test.esm.js +0 -1
  488. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
  489. package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
  490. package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
  491. package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
  492. package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
  493. package/dist/nile-radio/nile-radio.test.esm.js +0 -1
  494. package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
  495. package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
  496. package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
  497. package/dist/nile-select/nile-select.test.cjs.js +0 -2
  498. package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
  499. package/dist/nile-select/nile-select.test.esm.js +0 -55
  500. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
  501. package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
  502. package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
  503. package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
  504. package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
  505. package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
  506. package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
  507. package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
  508. package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
  509. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
  510. package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
  511. package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
  512. package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
  513. package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
  514. package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
  515. package/dist/sinon-esm-68c8e378.esm.js +0 -1
  516. package/dist/sinon-esm-97570c13.cjs.js +0 -2
  517. package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
@@ -1,173 +1,679 @@
1
- import { fixture, html, expect, oneEvent } from '@open-wc/testing';
1
+ import { expect, fixture, html, elementUpdated } from '@open-wc/testing';
2
2
  import './nile-checkbox';
3
- import { NileCheckbox } from './nile-checkbox';
4
-
5
- function wait(ms:number=50000) {
6
- return new Promise(resolve => setTimeout(resolve, ms));
7
- }
3
+ import NileCheckbox from './nile-checkbox';
8
4
 
9
5
  describe('NileCheckbox', () => {
10
- it('renders correctly with default properties', async () => {
6
+ // === RENDERING ===
7
+ it('1. should render without errors', async () => {
11
8
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
12
- expect(el).shadowDom.to.equalSnapshot();
9
+ expect(el).to.exist;
13
10
  });
14
11
 
15
- it('toggles checked state on click', async () => {
12
+ it('2. should have a shadow root', async () => {
16
13
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
17
- const input = el.shadowRoot!.querySelector('input[type="checkbox"]')! as HTMLInputElement;
14
+ expect(el.shadowRoot).to.not.be.null;
15
+ });
18
16
 
19
- input.click();
20
- expect(el.checked).to.be.true;
21
- input.click();
17
+ it('3. should render an input of type checkbox', async () => {
18
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
19
+ const input = el.shadowRoot!.querySelector('input[type="checkbox"]');
20
+ expect(input).to.exist;
21
+ });
22
+
23
+ it('4. should render a label element', async () => {
24
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
25
+ const label = el.shadowRoot!.querySelector('label');
26
+ expect(label).to.exist;
27
+ });
28
+
29
+ it('5. should render default slot for label content', async () => {
30
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
31
+ const slot = el.shadowRoot!.querySelector('slot:not([name])');
32
+ expect(slot).to.exist;
33
+ });
34
+
35
+ it('6. should render slot content', async () => {
36
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox>Check me</nile-checkbox>`);
37
+ expect(el.textContent!.trim()).to.equal('Check me');
38
+ });
39
+
40
+ // === DEFAULT PROPERTIES ===
41
+ it('7. should have checked default to false', async () => {
42
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
22
43
  expect(el.checked).to.be.false;
23
44
  });
24
45
 
25
- it('emits nile-change event on click', async () => {
46
+ it('8. should have disabled default to false', async () => {
47
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
48
+ expect(el.disabled).to.be.false;
49
+ });
50
+
51
+ it('9. should have indeterminate default to false', async () => {
52
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
53
+ expect(el.indeterminate).to.be.false;
54
+ });
55
+
56
+ it('10. should have size default to medium', async () => {
57
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
58
+ expect(el.size).to.equal('medium');
59
+ });
60
+
61
+ it('11. should have name default to empty string', async () => {
62
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
63
+ expect(el.name).to.equal('');
64
+ });
65
+
66
+ it('12. should have label default to empty string', async () => {
67
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
68
+ expect(el.label).to.equal('');
69
+ });
70
+
71
+ it('13. should have required default to false', async () => {
72
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
73
+ expect(el.required).to.be.false;
74
+ });
75
+
76
+ it('14. should have helpText default to empty string', async () => {
26
77
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
27
- const input = el.shadowRoot!.querySelector('input[type="checkbox"]')! as HTMLInputElement;
78
+ expect(el.helpText).to.equal('');
79
+ });
28
80
 
29
- setTimeout(() => input.click());
30
- const event = await oneEvent(el, 'valueChange');
31
- expect(event.detail.checked).to.be.true;
81
+ it('15. should have errorMessage default to empty string', async () => {
82
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
83
+ expect(el.errorMessage).to.equal('');
32
84
  });
33
85
 
34
- it('handles focus and blur events', async () => {
86
+ it('16. should have form default to empty string', async () => {
35
87
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
36
- const input = el.shadowRoot!.querySelector('input[type="checkbox"]')! as HTMLInputElement;
88
+ expect(el.form).to.equal('');
89
+ });
37
90
 
38
- // Focus the input and wait for the focus event
39
- setTimeout(() => input.focus());
40
- const focusEvent = await oneEvent(el, 'focus');
41
- expect(focusEvent).to.exist;
91
+ it('17. should have title default to empty string', async () => {
92
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
93
+ expect(el.title).to.equal('');
94
+ });
42
95
 
43
- // Blur the input and wait for the blur event
44
- setTimeout(() => input.blur());
45
- const blurEvent = await oneEvent(el, 'blur');
46
- expect(blurEvent).to.exist;
96
+ it('18. should have showHelpText default to false', async () => {
97
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
98
+ expect(el.showHelpText).to.be.false;
47
99
  });
48
100
 
49
- it('handles indeterminate state', async () => {
101
+ // === CHECKED STATE ===
102
+ it('19. should be checked when checked attribute is set', async () => {
103
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
104
+ expect(el.checked).to.be.true;
105
+ });
106
+
107
+ it('20. should apply checked class when checked', async () => {
108
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
109
+ const label = el.shadowRoot!.querySelector('label');
110
+ expect(label!.classList.contains('checkbox--checked')).to.be.true;
111
+ });
112
+
113
+ it('21. should reflect checked attribute', async () => {
114
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
115
+ expect(el.hasAttribute('checked')).to.be.true;
116
+ });
117
+
118
+ it('22. should set aria-checked to true when checked', async () => {
119
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
120
+ const input = el.shadowRoot!.querySelector('input');
121
+ expect(input!.getAttribute('aria-checked')).to.equal('true');
122
+ });
123
+
124
+ it('23. should set aria-checked to false when unchecked', async () => {
125
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
126
+ const input = el.shadowRoot!.querySelector('input');
127
+ expect(input!.getAttribute('aria-checked')).to.equal('false');
128
+ });
129
+
130
+ it('24. should show checked icon when checked', async () => {
131
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
132
+ const icon = el.shadowRoot!.querySelector('.checkbox__checked-icon');
133
+ expect(icon).to.exist;
134
+ });
135
+
136
+ it('25. should not show checked icon when unchecked', async () => {
137
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
138
+ const icon = el.shadowRoot!.querySelector('.checkbox__checked-icon');
139
+ expect(icon).to.be.null;
140
+ });
141
+
142
+ // === DISABLED STATE ===
143
+ it('26. should be disabled when disabled attribute is set', async () => {
144
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox disabled></nile-checkbox>`);
145
+ expect(el.disabled).to.be.true;
146
+ });
147
+
148
+ it('27. should apply disabled class', async () => {
149
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox disabled></nile-checkbox>`);
150
+ const label = el.shadowRoot!.querySelector('label');
151
+ expect(label!.classList.contains('checkbox--disabled')).to.be.true;
152
+ });
153
+
154
+ it('28. should disable the input when disabled', async () => {
155
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox disabled></nile-checkbox>`);
156
+ const input = el.shadowRoot!.querySelector('input');
157
+ expect(input!.disabled).to.be.true;
158
+ });
159
+
160
+ it('29. should reflect disabled attribute', async () => {
161
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox disabled></nile-checkbox>`);
162
+ expect(el.hasAttribute('disabled')).to.be.true;
163
+ });
164
+
165
+ // === INDETERMINATE STATE ===
166
+ it('30. should be indeterminate when attribute is set', async () => {
50
167
  const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
51
- const input = el.shadowRoot!.querySelector('input[type="checkbox"]')! as HTMLInputElement;
168
+ expect(el.indeterminate).to.be.true;
169
+ });
52
170
 
53
- expect(input.indeterminate).to.be.true;
171
+ it('31. should apply indeterminate class', async () => {
172
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
173
+ const label = el.shadowRoot!.querySelector('label');
174
+ expect(label!.classList.contains('checkbox--indeterminate')).to.be.true;
175
+ });
54
176
 
55
- el.checked = true;
56
- el.indeterminate = false;
57
- await el.updateComplete;
58
- expect(input.indeterminate).to.be.false;
59
- expect(input.checked).to.be.true;
177
+ it('32. should show indeterminate icon when indeterminate', async () => {
178
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
179
+ const icon = el.shadowRoot!.querySelector('.checkbox__indeterminate-icon');
180
+ expect(icon).to.exist;
181
+ });
182
+
183
+ it('33. should not show indeterminate icon when checked', async () => {
184
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked indeterminate></nile-checkbox>`);
185
+ const icon = el.shadowRoot!.querySelector('.checkbox__indeterminate-icon');
186
+ expect(icon).to.be.null;
187
+ });
188
+
189
+ it('34. should reflect indeterminate attribute', async () => {
190
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
191
+ expect(el.hasAttribute('indeterminate')).to.be.true;
60
192
  });
61
193
 
62
- it('reflects properties to attributes', async () => {
63
- const el = await fixture<NileCheckbox>(html`
64
- <nile-checkbox
65
- name="test-name"
66
- title="test-title"
67
- disabled
68
- required
69
- label="test-label"
70
- sub-label="test-sublabel"
71
- help-text="test-help"
72
- error-message="test-error"
73
- ></nile-checkbox>
74
- `);
194
+ // === SIZE ===
195
+ it('35. should support small size', async () => {
196
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox size="small"></nile-checkbox>`);
197
+ expect(el.size).to.equal('small');
198
+ });
75
199
 
76
- expect(el.getAttribute('name')).to.equal('test-name');
77
- expect(el.getAttribute('title')).to.equal('test-title');
78
- expect(el.getAttribute('disabled')).to.equal('');
79
- expect(el.getAttribute('required')).to.equal('');
80
- expect(el.getAttribute('label')).to.equal('test-label');
81
- expect(el.getAttribute('sub-label')).to.equal('test-sublabel');
82
- expect(el.getAttribute('help-text')).to.equal('test-help');
83
- expect(el.getAttribute('error-message')).to.equal('test-error');
200
+ it('36. should support medium size', async () => {
201
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox size="medium"></nile-checkbox>`);
202
+ expect(el.size).to.equal('medium');
84
203
  });
85
204
 
86
- it('displays help text when showHelpText is true', async () => {
87
- const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="test-help"></nile-checkbox>`);
88
- el.showHelpText = true;
205
+ it('37. should support large size', async () => {
206
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox size="large"></nile-checkbox>`);
207
+ expect(el.size).to.equal('large');
208
+ });
209
+
210
+ it('38. should apply medium class by default', async () => {
211
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
212
+ const label = el.shadowRoot!.querySelector('label');
213
+ expect(label!.classList.contains('checkbox--medium')).to.be.true;
214
+ });
215
+
216
+ it('39. should reflect size attribute', async () => {
217
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox size="large"></nile-checkbox>`);
218
+ expect(el.getAttribute('size')).to.equal('large');
219
+ });
220
+
221
+ // === EVENTS ===
222
+ it('40. should emit nile-change when clicked', async () => {
223
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
224
+ const input = el.shadowRoot!.querySelector('input');
225
+ let changeEmitted = false;
226
+ el.addEventListener('nile-change', () => (changeEmitted = true));
227
+ input!.click();
228
+ expect(changeEmitted).to.be.true;
229
+ });
230
+
231
+ it('41. should emit nile-change with checked detail', async () => {
232
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
233
+ const input = el.shadowRoot!.querySelector('input');
234
+ let detail: any = null;
235
+ el.addEventListener('nile-change', (e: any) => (detail = e.detail));
236
+ input!.click();
237
+ expect(detail).to.exist;
238
+ expect(detail.checked).to.be.true;
239
+ });
240
+
241
+ it('42. should emit valueChange when clicked', async () => {
242
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
243
+ const input = el.shadowRoot!.querySelector('input');
244
+ let changeEmitted = false;
245
+ el.addEventListener('valueChange', () => (changeEmitted = true));
246
+ input!.click();
247
+ expect(changeEmitted).to.be.true;
248
+ });
249
+
250
+ it('43. should emit blur event on blur', async () => {
251
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
252
+ const input = el.shadowRoot!.querySelector('input');
253
+ let blurEmitted = false;
254
+ el.addEventListener('blur', () => (blurEmitted = true));
255
+ input!.dispatchEvent(new FocusEvent('blur'));
256
+ expect(blurEmitted).to.be.true;
257
+ });
258
+
259
+ it('44. should emit focus event on focus', async () => {
260
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
261
+ const input = el.shadowRoot!.querySelector('input');
262
+ let focusEmitted = false;
263
+ el.addEventListener('focus', () => (focusEmitted = true));
264
+ input!.dispatchEvent(new FocusEvent('focus'));
265
+ expect(focusEmitted).to.be.true;
266
+ });
267
+
268
+ it('45. should emit input event on input', async () => {
269
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
270
+ const input = el.shadowRoot!.querySelector('input');
271
+ let inputEmitted = false;
272
+ el.addEventListener('input', () => (inputEmitted = true));
273
+ input!.dispatchEvent(new Event('input'));
274
+ expect(inputEmitted).to.be.true;
275
+ });
276
+
277
+ it('46. should emit nile-init on connected', async () => {
278
+ let initEmitted = false;
279
+ const container = await fixture(html`<div></div>`);
280
+ const el = document.createElement('nile-checkbox') as NileCheckbox;
281
+ el.addEventListener('nile-init', () => (initEmitted = true));
282
+ container.appendChild(el);
89
283
  await el.updateComplete;
90
- const helpText=el.shadowRoot?.querySelector("nile-form-help-text")?.textContent?.trim()
91
- expect(helpText).to.equal('test-help')
284
+ expect(initEmitted).to.be.true;
285
+ });
286
+
287
+ it('47. should emit nile-destroy on disconnected', async () => {
288
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
289
+ let destroyEmitted = false;
290
+ el.addEventListener('nile-destroy', () => (destroyEmitted = true));
291
+ el.remove();
292
+ expect(destroyEmitted).to.be.true;
293
+ });
294
+
295
+ // === CLICK BEHAVIOR ===
296
+ it('48. should toggle checked on click', async () => {
297
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
298
+ const input = el.shadowRoot!.querySelector('input');
299
+ input!.click();
300
+ expect(el.checked).to.be.true;
301
+ });
302
+
303
+ it('49. should toggle from checked to unchecked on click', async () => {
304
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
305
+ const input = el.shadowRoot!.querySelector('input');
306
+ input!.click();
307
+ expect(el.checked).to.be.false;
308
+ });
309
+
310
+ it('50. should clear indeterminate on click', async () => {
311
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
312
+ const input = el.shadowRoot!.querySelector('input');
313
+ input!.click();
314
+ expect(el.indeterminate).to.be.false;
92
315
  });
93
316
 
94
- it('updates host class based on helpText', async () => {
317
+ // === FOCUS/BLUR METHODS ===
318
+ it('51. should focus programmatically', async () => {
95
319
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
96
- el.helpText = 'test-help';
320
+ el.focus();
97
321
  await el.updateComplete;
322
+ const label = el.shadowRoot!.querySelector('label');
323
+ expect(label!.classList.contains('checkbox--focused')).to.be.true;
324
+ });
98
325
 
99
- expect(el.classList.contains('full-width')).to.be.true;
326
+ it('52. should blur programmatically', async () => {
327
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
328
+ el.focus();
329
+ await el.updateComplete;
330
+ el.blur();
331
+ await el.updateComplete;
332
+ const label = el.shadowRoot!.querySelector('label');
333
+ expect(label!.classList.contains('checkbox--focused')).to.be.false;
334
+ });
100
335
 
101
- el.helpText = '';
336
+ it('53. should click programmatically', async () => {
337
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
338
+ el.click();
102
339
  await el.updateComplete;
340
+ expect(el.checked).to.be.true;
341
+ });
103
342
 
104
- expect(el.classList.contains('full-width')).to.be.false;
343
+ // === LABEL PROPERTY ===
344
+ it('54. should display label text', async () => {
345
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox label="My Label"></nile-checkbox>`);
346
+ const labelDiv = el.shadowRoot!.querySelector('.checkbox__label');
347
+ expect(labelDiv!.textContent).to.contain('My Label');
105
348
  });
106
349
 
107
- it('emits custom events on connected and disconnected', async () => {
108
- const el = document.createElement('nile-checkbox');
350
+ it('55. should reflect label attribute', async () => {
351
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox label="Test"></nile-checkbox>`);
352
+ expect(el.getAttribute('label')).to.equal('Test');
353
+ });
109
354
 
110
- // Wait for the connected event
111
- const initEventPromise = oneEvent(el, 'nile-init');
112
- document.body.appendChild(el);
113
- const initEvent = await initEventPromise;
114
- expect(initEvent).to.exist;
355
+ // === NAME ===
356
+ it('56. should set name on input', async () => {
357
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox name="myCheckbox"></nile-checkbox>`);
358
+ const input = el.shadowRoot!.querySelector('input');
359
+ expect(input!.getAttribute('name')).to.equal('myCheckbox');
360
+ });
115
361
 
116
- // Wait for the disconnected event
117
- const destroyEventPromise = oneEvent(el, 'nile-destroy');
118
- document.body.removeChild(el);
119
- const destroyEvent = await destroyEventPromise;
120
- expect(destroyEvent).to.exist;
362
+ // === REQUIRED ===
363
+ it('57. should set required on input', async () => {
364
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox required></nile-checkbox>`);
365
+ const input = el.shadowRoot!.querySelector('input');
366
+ expect(input!.required).to.be.true;
121
367
  });
122
368
 
123
- it('handles required attribute', async () => {
369
+ it('58. should reflect required attribute', async () => {
124
370
  const el = await fixture<NileCheckbox>(html`<nile-checkbox required></nile-checkbox>`);
125
- const input = el.shadowRoot!.querySelector('input[type="checkbox"]')! as HTMLInputElement;
371
+ expect(el.hasAttribute('required')).to.be.true;
372
+ });
126
373
 
127
- expect(input.required).to.be.true;
374
+ // === HELP TEXT ===
375
+ it('59. should render help text when set', async () => {
376
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="Some help"></nile-checkbox>`);
377
+ const helpText = el.shadowRoot!.querySelector('nile-form-help-text');
378
+ expect(helpText).to.exist;
128
379
  });
129
380
 
130
- it('simulates click using click method', async () => {
381
+ it('60. should not render help text when empty', async () => {
131
382
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
132
- el.click();
133
- expect(el.checked).to.be.true;
383
+ const helpText = el.shadowRoot!.querySelector('nile-form-help-text');
384
+ expect(helpText).to.be.null;
134
385
  });
135
386
 
136
- it('sets and removes focus using focus and blur methods', async () => {
387
+ it('61. should reflect help-text attribute', async () => {
388
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="Help"></nile-checkbox>`);
389
+ expect(el.getAttribute('help-text')).to.equal('Help');
390
+ });
391
+
392
+ it('62. should add full-width class when helpText is set', async () => {
393
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="Help"></nile-checkbox>`);
394
+ expect(el.classList.contains('full-width')).to.be.true;
395
+ });
396
+
397
+ it('63. should remove full-width class when helpText is empty', async () => {
137
398
  const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
399
+ expect(el.classList.contains('full-width')).to.be.false;
400
+ });
138
401
 
139
- // Call the focus method and wait for the focus event
140
- setTimeout(() => el.focus());
141
- const focusEvent = await oneEvent(el, 'focus');
142
- expect(focusEvent).to.exist;
402
+ // === ERROR MESSAGE ===
403
+ it('64. should render error message when set', async () => {
404
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox error-message="Error!"></nile-checkbox>`);
405
+ const errorMsg = el.shadowRoot!.querySelector('nile-form-error-message');
406
+ expect(errorMsg).to.exist;
407
+ });
143
408
 
144
- // Call the blur method and wait for the blur event
145
- setTimeout(() => el.blur());
146
- const blurEvent = await oneEvent(el, 'blur');
147
- expect(blurEvent).to.exist;
409
+ it('65. should not render error message when empty', async () => {
410
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
411
+ const errorMsg = el.shadowRoot!.querySelector('nile-form-error-message');
412
+ expect(errorMsg).to.be.null;
148
413
  });
149
414
 
150
- it('reflects checked attribute to property', async () => {
415
+ it('66. should reflect error-message attribute', async () => {
416
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox error-message="Err"></nile-checkbox>`);
417
+ expect(el.getAttribute('error-message')).to.equal('Err');
418
+ });
419
+
420
+ // === DYNAMIC PROPERTY CHANGES ===
421
+ it('67. should update checked dynamically', async () => {
422
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
423
+ el.checked = true;
424
+ await el.updateComplete;
425
+ const label = el.shadowRoot!.querySelector('label');
426
+ expect(label!.classList.contains('checkbox--checked')).to.be.true;
427
+ });
428
+
429
+ it('68. should update disabled dynamically', async () => {
430
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
431
+ el.disabled = true;
432
+ await el.updateComplete;
433
+ const input = el.shadowRoot!.querySelector('input');
434
+ expect(input!.disabled).to.be.true;
435
+ });
436
+
437
+ it('69. should update indeterminate dynamically', async () => {
438
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
439
+ el.indeterminate = true;
440
+ await el.updateComplete;
441
+ const label = el.shadowRoot!.querySelector('label');
442
+ expect(label!.classList.contains('checkbox--indeterminate')).to.be.true;
443
+ });
444
+
445
+ it('70. should update size dynamically', async () => {
446
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
447
+ el.size = 'large';
448
+ await el.updateComplete;
449
+ expect(el.getAttribute('size')).to.equal('large');
450
+ });
451
+
452
+ it('71. should update label dynamically', async () => {
453
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
454
+ el.label = 'New Label';
455
+ await el.updateComplete;
456
+ const labelDiv = el.shadowRoot!.querySelector('.checkbox__label');
457
+ expect(labelDiv!.textContent).to.contain('New Label');
458
+ });
459
+
460
+ it('72. should update name dynamically', async () => {
461
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
462
+ el.name = 'newName';
463
+ await el.updateComplete;
464
+ const input = el.shadowRoot!.querySelector('input');
465
+ expect(input!.getAttribute('name')).to.equal('newName');
466
+ });
467
+
468
+ it('73. should update helpText dynamically', async () => {
469
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
470
+ el.helpText = 'New Help';
471
+ await el.updateComplete;
472
+ const helpText = el.shadowRoot!.querySelector('nile-form-help-text');
473
+ expect(helpText).to.exist;
474
+ });
475
+
476
+ it('74. should update errorMessage dynamically', async () => {
477
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
478
+ el.errorMessage = 'New Error';
479
+ await el.updateComplete;
480
+ const errorMsg = el.shadowRoot!.querySelector('nile-form-error-message');
481
+ expect(errorMsg).to.exist;
482
+ });
483
+
484
+ // === CSS PARTS ===
485
+ it('75. should have base part', async () => {
486
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
487
+ const base = el.shadowRoot!.querySelector('[part~="base"]');
488
+ expect(base).to.exist;
489
+ });
490
+
491
+ it('76. should have control part', async () => {
492
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
493
+ const control = el.shadowRoot!.querySelector('[part~="control"]');
494
+ expect(control).to.exist;
495
+ });
496
+
497
+ it('77. should have control--checked part when checked', async () => {
151
498
  const el = await fixture<NileCheckbox>(html`<nile-checkbox checked></nile-checkbox>`);
152
- expect(el.checked).to.be.true;
499
+ const control = el.shadowRoot!.querySelector('[part~="control--checked"]');
500
+ expect(control).to.exist;
153
501
  });
154
502
 
155
- it('reflects indeterminate attribute to property', async () => {
503
+ it('78. should have control--indeterminate part when indeterminate', async () => {
156
504
  const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate></nile-checkbox>`);
505
+ const control = el.shadowRoot!.querySelector('[part~="control--indeterminate"]');
506
+ expect(control).to.exist;
507
+ });
508
+
509
+ it('79. should have label part', async () => {
510
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
511
+ const label = el.shadowRoot!.querySelector('[part~="label"]');
512
+ expect(label).to.exist;
513
+ });
514
+
515
+ // === COMBINED STATES ===
516
+ it('80. should handle checked and disabled together', async () => {
517
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked disabled></nile-checkbox>`);
518
+ const label = el.shadowRoot!.querySelector('label');
519
+ expect(label!.classList.contains('checkbox--checked')).to.be.true;
520
+ expect(label!.classList.contains('checkbox--disabled')).to.be.true;
521
+ });
522
+
523
+ it('81. should show checked icon with different color when checked and disabled', async () => {
524
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked disabled></nile-checkbox>`);
525
+ const icon = el.shadowRoot!.querySelector('.checkbox__checked-icon');
526
+ expect(icon).to.exist;
527
+ });
528
+
529
+ it('82. should show indeterminate icon when indeterminate and disabled', async () => {
530
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox indeterminate disabled></nile-checkbox>`);
531
+ const icon = el.shadowRoot!.querySelector('.checkbox__indeterminate-icon');
532
+ expect(icon).to.exist;
533
+ });
534
+
535
+ it('83. should handle checked, disabled, and indeterminate together', async () => {
536
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox checked disabled indeterminate></nile-checkbox>`);
537
+ expect(el.checked).to.be.true;
538
+ expect(el.disabled).to.be.true;
157
539
  expect(el.indeterminate).to.be.true;
158
540
  });
159
541
 
160
- it('associates form using form attribute', async () => {
161
- const el = await fixture(html`
162
- <div>
163
- <form id="test-form"></form>
164
- <nile-checkbox form="test-form"></nile-checkbox>
165
- </div>
166
- `);
167
- const checkbox = el.querySelector('nile-checkbox') as NileCheckbox;
168
- expect(checkbox).to.not.be.null;
169
- expect(checkbox.getAttribute('form')).to.equal('test-form');
542
+ it('84. should handle help text and error message together', async () => {
543
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="Help" error-message="Error"></nile-checkbox>`);
544
+ const helpText = el.shadowRoot!.querySelector('nile-form-help-text');
545
+ const errorMsg = el.shadowRoot!.querySelector('nile-form-error-message');
546
+ expect(helpText).to.exist;
547
+ expect(errorMsg).to.exist;
170
548
  });
171
549
 
172
- });
550
+ // === TITLE ===
551
+ it('85. should set title on internal input', async () => {
552
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox title="My Title"></nile-checkbox>`);
553
+ const input = el.shadowRoot!.querySelector('input');
554
+ expect(input!.getAttribute('title')).to.equal('My Title');
555
+ });
173
556
 
557
+ // === FORM ===
558
+ it('86. should reflect form attribute', async () => {
559
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox form="myForm"></nile-checkbox>`);
560
+ expect(el.getAttribute('form')).to.equal('myForm');
561
+ });
562
+
563
+ // === FOCUSED STATE ===
564
+ it('87. should apply focused class on focus', async () => {
565
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
566
+ const input = el.shadowRoot!.querySelector('input');
567
+ input!.dispatchEvent(new FocusEvent('focus'));
568
+ await el.updateComplete;
569
+ const label = el.shadowRoot!.querySelector('label');
570
+ expect(label!.classList.contains('checkbox--focused')).to.be.true;
571
+ });
572
+
573
+ it('88. should remove focused class on blur', async () => {
574
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
575
+ const input = el.shadowRoot!.querySelector('input');
576
+ input!.dispatchEvent(new FocusEvent('focus'));
577
+ await el.updateComplete;
578
+ input!.dispatchEvent(new FocusEvent('blur'));
579
+ await el.updateComplete;
580
+ const label = el.shadowRoot!.querySelector('label');
581
+ expect(label!.classList.contains('checkbox--focused')).to.be.false;
582
+ });
583
+
584
+ // === MULTIPLE CLICKS ===
585
+ it('89. should toggle multiple times', async () => {
586
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
587
+ const input = el.shadowRoot!.querySelector('input');
588
+ input!.click();
589
+ expect(el.checked).to.be.true;
590
+ input!.click();
591
+ expect(el.checked).to.be.false;
592
+ input!.click();
593
+ expect(el.checked).to.be.true;
594
+ });
595
+
596
+ it('90. should emit change event each toggle', async () => {
597
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
598
+ const input = el.shadowRoot!.querySelector('input');
599
+ let count = 0;
600
+ el.addEventListener('nile-change', () => count++);
601
+ input!.click();
602
+ input!.click();
603
+ input!.click();
604
+ expect(count).to.equal(3);
605
+ });
606
+
607
+ // === CONTROL CLASS ===
608
+ it('91. should have checkbox class on label', async () => {
609
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
610
+ const label = el.shadowRoot!.querySelector('label');
611
+ expect(label!.classList.contains('checkbox')).to.be.true;
612
+ });
613
+
614
+ it('92. should have checkbox__input class on input', async () => {
615
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
616
+ const input = el.shadowRoot!.querySelector('.checkbox__input');
617
+ expect(input).to.exist;
618
+ });
619
+
620
+ it('93. should have checkbox__control class on span', async () => {
621
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
622
+ const control = el.shadowRoot!.querySelector('.checkbox__control');
623
+ expect(control).to.exist;
624
+ });
625
+
626
+ it('94. should have checkbox__label class', async () => {
627
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
628
+ const labelDiv = el.shadowRoot!.querySelector('.checkbox__label');
629
+ expect(labelDiv).to.exist;
630
+ });
631
+
632
+ // === VALUE ===
633
+ it('95. should set value on input', async () => {
634
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox .value=${true}></nile-checkbox>`);
635
+ expect(el.value).to.be.true;
636
+ });
637
+
638
+ // === EDGE CASES ===
639
+ it('96. should handle empty label (boolean false label)', async () => {
640
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
641
+ const labelDiv = el.shadowRoot!.querySelector('.checkbox__label');
642
+ expect(labelDiv).to.exist;
643
+ });
644
+
645
+ it('97. should update full-width class when helpText changes from set to empty', async () => {
646
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox help-text="Help"></nile-checkbox>`);
647
+ expect(el.classList.contains('full-width')).to.be.true;
648
+ el.helpText = '';
649
+ await el.updateComplete;
650
+ expect(el.classList.contains('full-width')).to.be.false;
651
+ });
652
+
653
+ it('98. should support setting checked via property after render', async () => {
654
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
655
+ expect(el.checked).to.be.false;
656
+ el.checked = true;
657
+ await el.updateComplete;
658
+ expect(el.checked).to.be.true;
659
+ const label = el.shadowRoot!.querySelector('label');
660
+ expect(label!.classList.contains('checkbox--checked')).to.be.true;
661
+ });
662
+
663
+ it('99. should support setting indeterminate via property after render', async () => {
664
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
665
+ el.indeterminate = true;
666
+ await el.updateComplete;
667
+ const label = el.shadowRoot!.querySelector('label');
668
+ expect(label!.classList.contains('checkbox--indeterminate')).to.be.true;
669
+ });
670
+
671
+ it('100. should handle rapid toggling', async () => {
672
+ const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
673
+ const input = el.shadowRoot!.querySelector('input');
674
+ for (let i = 0; i < 10; i++) {
675
+ input!.click();
676
+ }
677
+ expect(el.checked).to.be.false; // even number of clicks
678
+ });
679
+ });