@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.
- package/README.md +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +239 -195
- 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-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-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 +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/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/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 +1 -1
- 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/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,173 +1,679 @@
|
|
|
1
|
-
import { fixture, html,
|
|
1
|
+
import { expect, fixture, html, elementUpdated } from '@open-wc/testing';
|
|
2
2
|
import './nile-checkbox';
|
|
3
|
-
import
|
|
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
|
-
|
|
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).
|
|
9
|
+
expect(el).to.exist;
|
|
13
10
|
});
|
|
14
11
|
|
|
15
|
-
it('
|
|
12
|
+
it('2. should have a shadow root', async () => {
|
|
16
13
|
const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
|
|
17
|
-
|
|
14
|
+
expect(el.shadowRoot).to.not.be.null;
|
|
15
|
+
});
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
input.
|
|
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('
|
|
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
|
-
|
|
78
|
+
expect(el.helpText).to.equal('');
|
|
79
|
+
});
|
|
28
80
|
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
expect(
|
|
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('
|
|
86
|
+
it('16. should have form default to empty string', async () => {
|
|
35
87
|
const el = await fixture<NileCheckbox>(html`<nile-checkbox></nile-checkbox>`);
|
|
36
|
-
|
|
88
|
+
expect(el.form).to.equal('');
|
|
89
|
+
});
|
|
37
90
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
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
|
-
|
|
168
|
+
expect(el.indeterminate).to.be.true;
|
|
169
|
+
});
|
|
52
170
|
|
|
53
|
-
|
|
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
|
-
|
|
56
|
-
el
|
|
57
|
-
|
|
58
|
-
expect(
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
77
|
-
|
|
78
|
-
expect(el.
|
|
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('
|
|
87
|
-
const el = await fixture<NileCheckbox>(html`<nile-checkbox
|
|
88
|
-
el.
|
|
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
|
-
|
|
91
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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('
|
|
108
|
-
const el =
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
expect(
|
|
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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
const
|
|
120
|
-
expect(
|
|
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('
|
|
369
|
+
it('58. should reflect required attribute', async () => {
|
|
124
370
|
const el = await fixture<NileCheckbox>(html`<nile-checkbox required></nile-checkbox>`);
|
|
125
|
-
|
|
371
|
+
expect(el.hasAttribute('required')).to.be.true;
|
|
372
|
+
});
|
|
126
373
|
|
|
127
|
-
|
|
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('
|
|
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.
|
|
133
|
-
expect(
|
|
383
|
+
const helpText = el.shadowRoot!.querySelector('nile-form-help-text');
|
|
384
|
+
expect(helpText).to.be.null;
|
|
134
385
|
});
|
|
135
386
|
|
|
136
|
-
it('
|
|
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
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
expect(
|
|
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('
|
|
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
|
-
|
|
499
|
+
const control = el.shadowRoot!.querySelector('[part~="control--checked"]');
|
|
500
|
+
expect(control).to.exist;
|
|
153
501
|
});
|
|
154
502
|
|
|
155
|
-
it('
|
|
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('
|
|
161
|
-
const el = await fixture(html
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
+
});
|