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