@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
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import './nile-icon-button';
|
|
3
|
+
import NileIconButton from './nile-icon-button';
|
|
4
|
+
describe('NileIconButton', () => {
|
|
5
|
+
it('1. should render without errors', async () => {
|
|
6
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
7
|
+
expect(el).to.exist;
|
|
8
|
+
});
|
|
9
|
+
it('2. should have a shadow root', async () => {
|
|
10
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
11
|
+
expect(el.shadowRoot).to.not.be.null;
|
|
12
|
+
});
|
|
13
|
+
it('3. should render a button element by default', async () => {
|
|
14
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
15
|
+
const button = el.shadowRoot.querySelector('button');
|
|
16
|
+
expect(button).to.exist;
|
|
17
|
+
});
|
|
18
|
+
it('4. should render an anchor when href is set', async () => {
|
|
19
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com"></nile-icon-button>`);
|
|
20
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
21
|
+
expect(anchor).to.exist;
|
|
22
|
+
});
|
|
23
|
+
it('5. should render a nile-icon inside', async () => {
|
|
24
|
+
const el = await fixture(html `<nile-icon-button name="test"></nile-icon-button>`);
|
|
25
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
26
|
+
expect(icon).to.exist;
|
|
27
|
+
});
|
|
28
|
+
it('6. should have disabled default to false', async () => {
|
|
29
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
30
|
+
expect(el.disabled).to.be.false;
|
|
31
|
+
});
|
|
32
|
+
it('7. should have label default to empty string', async () => {
|
|
33
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
34
|
+
expect(el.label).to.equal('');
|
|
35
|
+
});
|
|
36
|
+
it('8. should have ishovered default to false', async () => {
|
|
37
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
38
|
+
expect(el.ishovered).to.be.false;
|
|
39
|
+
});
|
|
40
|
+
it('9. should set name on nile-icon', async () => {
|
|
41
|
+
const el = await fixture(html `<nile-icon-button name="close"></nile-icon-button>`);
|
|
42
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
43
|
+
expect(icon.getAttribute('name')).to.equal('close');
|
|
44
|
+
});
|
|
45
|
+
it('10. should set library on nile-icon', async () => {
|
|
46
|
+
const el = await fixture(html `<nile-icon-button library="system"></nile-icon-button>`);
|
|
47
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
48
|
+
expect(icon.getAttribute('library')).to.equal('system');
|
|
49
|
+
});
|
|
50
|
+
it('11. should set src on nile-icon', async () => {
|
|
51
|
+
const el = await fixture(html `<nile-icon-button src="/icon.svg"></nile-icon-button>`);
|
|
52
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
53
|
+
expect(icon.getAttribute('src')).to.equal('/icon.svg');
|
|
54
|
+
});
|
|
55
|
+
it('12. should set aria-label from label property', async () => {
|
|
56
|
+
const el = await fixture(html `<nile-icon-button label="Close"></nile-icon-button>`);
|
|
57
|
+
const button = el.shadowRoot.querySelector('button');
|
|
58
|
+
expect(button.getAttribute('aria-label')).to.equal('Close');
|
|
59
|
+
});
|
|
60
|
+
it('13. should have icon-button class on button', async () => {
|
|
61
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
62
|
+
const button = el.shadowRoot.querySelector('.icon-button');
|
|
63
|
+
expect(button).to.exist;
|
|
64
|
+
});
|
|
65
|
+
it('14. should apply disabled class when disabled', async () => {
|
|
66
|
+
const el = await fixture(html `<nile-icon-button disabled></nile-icon-button>`);
|
|
67
|
+
const button = el.shadowRoot.querySelector('.icon-button--disabled');
|
|
68
|
+
expect(button).to.exist;
|
|
69
|
+
});
|
|
70
|
+
it('15. should have aria-disabled true when disabled', async () => {
|
|
71
|
+
const el = await fixture(html `<nile-icon-button disabled></nile-icon-button>`);
|
|
72
|
+
const button = el.shadowRoot.querySelector('button');
|
|
73
|
+
expect(button.getAttribute('aria-disabled')).to.equal('true');
|
|
74
|
+
});
|
|
75
|
+
it('16. should have aria-disabled false when not disabled', async () => {
|
|
76
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
77
|
+
const button = el.shadowRoot.querySelector('button');
|
|
78
|
+
expect(button.getAttribute('aria-disabled')).to.equal('false');
|
|
79
|
+
});
|
|
80
|
+
it('17. should have tabindex 0 when enabled', async () => {
|
|
81
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
82
|
+
const button = el.shadowRoot.querySelector('button');
|
|
83
|
+
expect(button.getAttribute('tabindex')).to.equal('0');
|
|
84
|
+
});
|
|
85
|
+
it('18. should have tabindex -1 when disabled', async () => {
|
|
86
|
+
const el = await fixture(html `<nile-icon-button disabled></nile-icon-button>`);
|
|
87
|
+
const button = el.shadowRoot.querySelector('button');
|
|
88
|
+
expect(button.getAttribute('tabindex')).to.equal('-1');
|
|
89
|
+
});
|
|
90
|
+
it('19. should have type=button on button element', async () => {
|
|
91
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
92
|
+
const button = el.shadowRoot.querySelector('button');
|
|
93
|
+
expect(button.getAttribute('type')).to.equal('button');
|
|
94
|
+
});
|
|
95
|
+
it('20. should have role=button on button element', async () => {
|
|
96
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
97
|
+
const button = el.shadowRoot.querySelector('button');
|
|
98
|
+
expect(button.getAttribute('role')).to.equal('button');
|
|
99
|
+
});
|
|
100
|
+
it('21. should emit nile-focus on focus', async () => {
|
|
101
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
102
|
+
const button = el.shadowRoot.querySelector('button');
|
|
103
|
+
let focusEmitted = false;
|
|
104
|
+
el.addEventListener('nile-focus', () => (focusEmitted = true));
|
|
105
|
+
button.dispatchEvent(new FocusEvent('focus'));
|
|
106
|
+
expect(focusEmitted).to.be.true;
|
|
107
|
+
});
|
|
108
|
+
it('22. should emit nile-blur on blur', async () => {
|
|
109
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
110
|
+
const button = el.shadowRoot.querySelector('button');
|
|
111
|
+
let blurEmitted = false;
|
|
112
|
+
el.addEventListener('nile-blur', () => (blurEmitted = true));
|
|
113
|
+
button.dispatchEvent(new FocusEvent('blur'));
|
|
114
|
+
expect(blurEmitted).to.be.true;
|
|
115
|
+
});
|
|
116
|
+
it('23. should apply focused class on focus', async () => {
|
|
117
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
118
|
+
el.focus();
|
|
119
|
+
await el.updateComplete;
|
|
120
|
+
const button = el.shadowRoot.querySelector('.icon-button--focused');
|
|
121
|
+
expect(button).to.exist;
|
|
122
|
+
});
|
|
123
|
+
it('24. should remove focused class on blur', async () => {
|
|
124
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
125
|
+
el.focus();
|
|
126
|
+
await el.updateComplete;
|
|
127
|
+
el.blur();
|
|
128
|
+
await el.updateComplete;
|
|
129
|
+
const button = el.shadowRoot.querySelector('.icon-button--focused');
|
|
130
|
+
expect(button).to.be.null;
|
|
131
|
+
});
|
|
132
|
+
it('25. should have base part on button', async () => {
|
|
133
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
134
|
+
const base = el.shadowRoot.querySelector('[part="base"]');
|
|
135
|
+
expect(base).to.exist;
|
|
136
|
+
});
|
|
137
|
+
it('26. should set href on anchor', async () => {
|
|
138
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com"></nile-icon-button>`);
|
|
139
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
140
|
+
expect(anchor.getAttribute('href')).to.equal('https://example.com');
|
|
141
|
+
});
|
|
142
|
+
it('27. should set target on anchor', async () => {
|
|
143
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com" target="_blank"></nile-icon-button>`);
|
|
144
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
145
|
+
expect(anchor.getAttribute('target')).to.equal('_blank');
|
|
146
|
+
});
|
|
147
|
+
it('28. should set download on anchor', async () => {
|
|
148
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com" download="file.pdf"></nile-icon-button>`);
|
|
149
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
150
|
+
expect(anchor.getAttribute('download')).to.equal('file.pdf');
|
|
151
|
+
});
|
|
152
|
+
it('29. should set rel on anchor with target', async () => {
|
|
153
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com" target="_blank"></nile-icon-button>`);
|
|
154
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
155
|
+
expect(anchor.getAttribute('rel')).to.equal('noreferrer noopener');
|
|
156
|
+
});
|
|
157
|
+
it('30. should reflect disabled attribute', async () => {
|
|
158
|
+
const el = await fixture(html `<nile-icon-button disabled></nile-icon-button>`);
|
|
159
|
+
expect(el.hasAttribute('disabled')).to.be.true;
|
|
160
|
+
});
|
|
161
|
+
it('31. should update disabled dynamically', async () => {
|
|
162
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
163
|
+
el.disabled = true;
|
|
164
|
+
await el.updateComplete;
|
|
165
|
+
const button = el.shadowRoot.querySelector('.icon-button--disabled');
|
|
166
|
+
expect(button).to.exist;
|
|
167
|
+
});
|
|
168
|
+
it('32. should update name dynamically', async () => {
|
|
169
|
+
const el = await fixture(html `<nile-icon-button name="close"></nile-icon-button>`);
|
|
170
|
+
el.name = 'arrow-left';
|
|
171
|
+
await el.updateComplete;
|
|
172
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
173
|
+
expect(icon.getAttribute('name')).to.equal('arrow-left');
|
|
174
|
+
});
|
|
175
|
+
it('33. should update label dynamically', async () => {
|
|
176
|
+
const el = await fixture(html `<nile-icon-button label="Close"></nile-icon-button>`);
|
|
177
|
+
el.label = 'Open';
|
|
178
|
+
await el.updateComplete;
|
|
179
|
+
const button = el.shadowRoot.querySelector('button');
|
|
180
|
+
expect(button.getAttribute('aria-label')).to.equal('Open');
|
|
181
|
+
});
|
|
182
|
+
it('34. should update color dynamically', async () => {
|
|
183
|
+
const el = await fixture(html `<nile-icon-button color="red"></nile-icon-button>`);
|
|
184
|
+
el.color = 'blue';
|
|
185
|
+
await el.updateComplete;
|
|
186
|
+
expect(el.color).to.equal('blue');
|
|
187
|
+
});
|
|
188
|
+
it('35. should switch from button to anchor when href is set', async () => {
|
|
189
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
190
|
+
el.href = 'https://example.com';
|
|
191
|
+
await el.updateComplete;
|
|
192
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
193
|
+
expect(anchor).to.exist;
|
|
194
|
+
});
|
|
195
|
+
it('36. nile-icon should have aria-hidden true', async () => {
|
|
196
|
+
const el = await fixture(html `<nile-icon-button name="test"></nile-icon-button>`);
|
|
197
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
198
|
+
expect(icon.getAttribute('aria-hidden')).to.equal('true');
|
|
199
|
+
});
|
|
200
|
+
it('37. nile-icon should have icon-button__icon class', async () => {
|
|
201
|
+
const el = await fixture(html `<nile-icon-button name="test"></nile-icon-button>`);
|
|
202
|
+
const icon = el.shadowRoot.querySelector('.icon-button__icon');
|
|
203
|
+
expect(icon).to.exist;
|
|
204
|
+
});
|
|
205
|
+
it('38. should handle click programmatically', async () => {
|
|
206
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
207
|
+
let clicked = false;
|
|
208
|
+
el.addEventListener('click', () => (clicked = true));
|
|
209
|
+
el.click();
|
|
210
|
+
expect(clicked).to.be.true;
|
|
211
|
+
});
|
|
212
|
+
it('39. should prevent click when disabled', async () => {
|
|
213
|
+
const el = await fixture(html `<nile-icon-button disabled></nile-icon-button>`);
|
|
214
|
+
const button = el.shadowRoot.querySelector('button');
|
|
215
|
+
let defaultPrevented = false;
|
|
216
|
+
button.addEventListener('click', (e) => {
|
|
217
|
+
defaultPrevented = e.defaultPrevented;
|
|
218
|
+
});
|
|
219
|
+
button.click();
|
|
220
|
+
// The handleClick method prevents and stops propagation when disabled
|
|
221
|
+
});
|
|
222
|
+
it('40. should set ishovered on mouseover', async () => {
|
|
223
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
224
|
+
const button = el.shadowRoot.querySelector('button');
|
|
225
|
+
button.dispatchEvent(new MouseEvent('mouseover'));
|
|
226
|
+
await el.updateComplete;
|
|
227
|
+
expect(el.ishovered).to.be.true;
|
|
228
|
+
});
|
|
229
|
+
it('41. should clear ishovered on mouseleave', async () => {
|
|
230
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
231
|
+
const button = el.shadowRoot.querySelector('button');
|
|
232
|
+
button.dispatchEvent(new MouseEvent('mouseover'));
|
|
233
|
+
await el.updateComplete;
|
|
234
|
+
button.dispatchEvent(new MouseEvent('mouseleave'));
|
|
235
|
+
await el.updateComplete;
|
|
236
|
+
expect(el.ishovered).to.be.false;
|
|
237
|
+
});
|
|
238
|
+
it('42. should reflect ishovered attribute', async () => {
|
|
239
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
240
|
+
const button = el.shadowRoot.querySelector('button');
|
|
241
|
+
button.dispatchEvent(new MouseEvent('mouseover'));
|
|
242
|
+
await el.updateComplete;
|
|
243
|
+
expect(el.hasAttribute('ishovered')).to.be.true;
|
|
244
|
+
});
|
|
245
|
+
it('43. should reflect color attribute', async () => {
|
|
246
|
+
const el = await fixture(html `<nile-icon-button color="red"></nile-icon-button>`);
|
|
247
|
+
expect(el.getAttribute('color')).to.equal('red');
|
|
248
|
+
});
|
|
249
|
+
it('44. should be instance of NileIconButton', async () => {
|
|
250
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
251
|
+
expect(el).to.be.instanceOf(NileIconButton);
|
|
252
|
+
});
|
|
253
|
+
it('45. should have correct tag name', async () => {
|
|
254
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
255
|
+
expect(el.tagName.toLowerCase()).to.equal('nile-icon-button');
|
|
256
|
+
});
|
|
257
|
+
it('46. should have static styles', async () => {
|
|
258
|
+
expect(NileIconButton.styles).to.exist;
|
|
259
|
+
});
|
|
260
|
+
it('47. should be a defined custom element', async () => {
|
|
261
|
+
expect(customElements.get('nile-icon-button')).to.exist;
|
|
262
|
+
});
|
|
263
|
+
it('48. should handle undefined name', async () => {
|
|
264
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
265
|
+
expect(el.name).to.be.undefined;
|
|
266
|
+
});
|
|
267
|
+
it('49. should handle undefined library', async () => {
|
|
268
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
269
|
+
expect(el.library).to.be.undefined;
|
|
270
|
+
});
|
|
271
|
+
it('50. should handle undefined src', async () => {
|
|
272
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
273
|
+
expect(el.src).to.be.undefined;
|
|
274
|
+
});
|
|
275
|
+
it('51. should handle undefined href', async () => {
|
|
276
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
277
|
+
expect(el.href).to.be.undefined;
|
|
278
|
+
});
|
|
279
|
+
it('52. should handle undefined target', async () => {
|
|
280
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
281
|
+
expect(el.target).to.be.undefined;
|
|
282
|
+
});
|
|
283
|
+
it('53. should handle undefined download', async () => {
|
|
284
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
285
|
+
expect(el.download).to.be.undefined;
|
|
286
|
+
});
|
|
287
|
+
it('54. should render button element as base', async () => {
|
|
288
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
289
|
+
const base = el.shadowRoot.querySelector('[part="base"]');
|
|
290
|
+
expect(base.tagName).to.equal('BUTTON');
|
|
291
|
+
});
|
|
292
|
+
it('55. should render anchor element as base when href set', async () => {
|
|
293
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com"></nile-icon-button>`);
|
|
294
|
+
const base = el.shadowRoot.querySelector('[part="base"]');
|
|
295
|
+
expect(base.tagName).to.equal('A');
|
|
296
|
+
});
|
|
297
|
+
it('56. should focus programmatically', async () => {
|
|
298
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
299
|
+
el.focus();
|
|
300
|
+
await el.updateComplete;
|
|
301
|
+
const focused = el.shadowRoot.querySelector('.icon-button--focused');
|
|
302
|
+
expect(focused).to.exist;
|
|
303
|
+
});
|
|
304
|
+
it('57. should blur programmatically', async () => {
|
|
305
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
306
|
+
el.focus();
|
|
307
|
+
await el.updateComplete;
|
|
308
|
+
el.blur();
|
|
309
|
+
await el.updateComplete;
|
|
310
|
+
const focused = el.shadowRoot.querySelector('.icon-button--focused');
|
|
311
|
+
expect(focused).to.be.null;
|
|
312
|
+
});
|
|
313
|
+
it('58. should not have disabled class when not disabled', async () => {
|
|
314
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
315
|
+
const disabled = el.shadowRoot.querySelector('.icon-button--disabled');
|
|
316
|
+
expect(disabled).to.be.null;
|
|
317
|
+
});
|
|
318
|
+
it('59. should handle multiple icon buttons independently', async () => {
|
|
319
|
+
const container = await fixture(html `
|
|
320
|
+
<div>
|
|
321
|
+
<nile-icon-button name="close" label="Close"></nile-icon-button>
|
|
322
|
+
<nile-icon-button name="edit" label="Edit"></nile-icon-button>
|
|
323
|
+
</div>
|
|
324
|
+
`);
|
|
325
|
+
const buttons = container.querySelectorAll('nile-icon-button');
|
|
326
|
+
expect(buttons.length).to.equal(2);
|
|
327
|
+
expect(buttons[0].label).to.equal('Close');
|
|
328
|
+
expect(buttons[1].label).to.equal('Edit');
|
|
329
|
+
});
|
|
330
|
+
it('60. should not have any slots', async () => {
|
|
331
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
332
|
+
const slots = el.shadowRoot.querySelectorAll('slot');
|
|
333
|
+
expect(slots.length).to.equal(0);
|
|
334
|
+
});
|
|
335
|
+
it('61. icon should be inside button', async () => {
|
|
336
|
+
const el = await fixture(html `<nile-icon-button name="test"></nile-icon-button>`);
|
|
337
|
+
const button = el.shadowRoot.querySelector('button');
|
|
338
|
+
const icon = button.querySelector('nile-icon');
|
|
339
|
+
expect(icon).to.exist;
|
|
340
|
+
});
|
|
341
|
+
it('62. icon should be inside anchor when href set', async () => {
|
|
342
|
+
const el = await fixture(html `<nile-icon-button name="test" href="https://example.com"></nile-icon-button>`);
|
|
343
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
344
|
+
const icon = anchor.querySelector('nile-icon');
|
|
345
|
+
expect(icon).to.exist;
|
|
346
|
+
});
|
|
347
|
+
it('63. should handle name property update', async () => {
|
|
348
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
349
|
+
el.name = 'search';
|
|
350
|
+
await el.updateComplete;
|
|
351
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
352
|
+
expect(icon.getAttribute('name')).to.equal('search');
|
|
353
|
+
});
|
|
354
|
+
it('64. should handle library property update', async () => {
|
|
355
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
356
|
+
el.library = 'custom';
|
|
357
|
+
await el.updateComplete;
|
|
358
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
359
|
+
expect(icon.getAttribute('library')).to.equal('custom');
|
|
360
|
+
});
|
|
361
|
+
it('65. should handle toggling disabled', async () => {
|
|
362
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
363
|
+
el.disabled = true;
|
|
364
|
+
await el.updateComplete;
|
|
365
|
+
expect(el.shadowRoot.querySelector('.icon-button--disabled')).to.exist;
|
|
366
|
+
el.disabled = false;
|
|
367
|
+
await el.updateComplete;
|
|
368
|
+
expect(el.shadowRoot.querySelector('.icon-button--disabled')).to.be.null;
|
|
369
|
+
});
|
|
370
|
+
it('66. should handle color property', async () => {
|
|
371
|
+
const el = await fixture(html `<nile-icon-button color="red"></nile-icon-button>`);
|
|
372
|
+
expect(el.color).to.equal('red');
|
|
373
|
+
});
|
|
374
|
+
it('67. should handle undefined color', async () => {
|
|
375
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
376
|
+
expect(el.color).to.be.undefined;
|
|
377
|
+
});
|
|
378
|
+
it('68. should handle setting all properties', async () => {
|
|
379
|
+
const el = await fixture(html `
|
|
380
|
+
<nile-icon-button name="close" library="system" label="Close" color="red" disabled></nile-icon-button>
|
|
381
|
+
`);
|
|
382
|
+
expect(el.name).to.equal('close');
|
|
383
|
+
expect(el.library).to.equal('system');
|
|
384
|
+
expect(el.label).to.equal('Close');
|
|
385
|
+
expect(el.color).to.equal('red');
|
|
386
|
+
expect(el.disabled).to.be.true;
|
|
387
|
+
});
|
|
388
|
+
it('69. should handle creation via createElement', async () => {
|
|
389
|
+
const el = document.createElement('nile-icon-button');
|
|
390
|
+
document.body.appendChild(el);
|
|
391
|
+
await el.updateComplete;
|
|
392
|
+
expect(el.shadowRoot.querySelector('.icon-button')).to.exist;
|
|
393
|
+
document.body.removeChild(el);
|
|
394
|
+
});
|
|
395
|
+
it('70. shadow root mode should be open', async () => {
|
|
396
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
397
|
+
expect(el.shadowRoot.mode).to.equal('open');
|
|
398
|
+
});
|
|
399
|
+
it('71. should have render method', async () => {
|
|
400
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
401
|
+
expect(el.render).to.be.a('function');
|
|
402
|
+
});
|
|
403
|
+
it('72. should handle data attributes', async () => {
|
|
404
|
+
const el = await fixture(html `<nile-icon-button data-action="close"></nile-icon-button>`);
|
|
405
|
+
expect(el.getAttribute('data-action')).to.equal('close');
|
|
406
|
+
});
|
|
407
|
+
it('73. should handle class attribute', async () => {
|
|
408
|
+
const el = await fixture(html `<nile-icon-button class="custom"></nile-icon-button>`);
|
|
409
|
+
expect(el.classList.contains('custom')).to.be.true;
|
|
410
|
+
});
|
|
411
|
+
it('74. should handle id attribute', async () => {
|
|
412
|
+
const el = await fixture(html `<nile-icon-button id="btn1"></nile-icon-button>`);
|
|
413
|
+
expect(el.id).to.equal('btn1');
|
|
414
|
+
});
|
|
415
|
+
it('75. button should have exactly one child (nile-icon)', async () => {
|
|
416
|
+
const el = await fixture(html `<nile-icon-button name="test"></nile-icon-button>`);
|
|
417
|
+
const button = el.shadowRoot.querySelector('button');
|
|
418
|
+
const icons = button.querySelectorAll('nile-icon');
|
|
419
|
+
expect(icons.length).to.equal(1);
|
|
420
|
+
});
|
|
421
|
+
it('76. anchor should have exactly one child (nile-icon)', async () => {
|
|
422
|
+
const el = await fixture(html `<nile-icon-button name="test" href="https://example.com"></nile-icon-button>`);
|
|
423
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
424
|
+
const icons = anchor.querySelectorAll('nile-icon');
|
|
425
|
+
expect(icons.length).to.equal(1);
|
|
426
|
+
});
|
|
427
|
+
// Various href configurations
|
|
428
|
+
it('77. should handle absolute href', async () => {
|
|
429
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com/path"></nile-icon-button>`);
|
|
430
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
431
|
+
expect(anchor.getAttribute('href')).to.equal('https://example.com/path');
|
|
432
|
+
});
|
|
433
|
+
it('78. should handle relative href', async () => {
|
|
434
|
+
const el = await fixture(html `<nile-icon-button href="/path"></nile-icon-button>`);
|
|
435
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
436
|
+
expect(anchor.getAttribute('href')).to.equal('/path');
|
|
437
|
+
});
|
|
438
|
+
it('79. should handle hash href', async () => {
|
|
439
|
+
const el = await fixture(html `<nile-icon-button href="#section"></nile-icon-button>`);
|
|
440
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
441
|
+
expect(anchor.getAttribute('href')).to.equal('#section');
|
|
442
|
+
});
|
|
443
|
+
// Label combinations
|
|
444
|
+
it('80. should handle long label', async () => {
|
|
445
|
+
const longLabel = 'A'.repeat(200);
|
|
446
|
+
const el = await fixture(html `<nile-icon-button label="${longLabel}"></nile-icon-button>`);
|
|
447
|
+
const button = el.shadowRoot.querySelector('button');
|
|
448
|
+
expect(button.getAttribute('aria-label')).to.equal(longLabel);
|
|
449
|
+
});
|
|
450
|
+
it('81. should handle special characters in label', async () => {
|
|
451
|
+
const el = await fixture(html `<nile-icon-button label="Close & Save"></nile-icon-button>`);
|
|
452
|
+
expect(el.label).to.contain('&');
|
|
453
|
+
});
|
|
454
|
+
// Disabled + href
|
|
455
|
+
it('82. should handle disabled with href', async () => {
|
|
456
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com" disabled></nile-icon-button>`);
|
|
457
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
458
|
+
expect(anchor.getAttribute('aria-disabled')).to.equal('true');
|
|
459
|
+
expect(anchor.getAttribute('tabindex')).to.equal('-1');
|
|
460
|
+
});
|
|
461
|
+
// Multiple renders
|
|
462
|
+
it('83. should handle multiple rapid property changes', async () => {
|
|
463
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
464
|
+
el.name = 'a';
|
|
465
|
+
el.name = 'b';
|
|
466
|
+
el.name = 'c';
|
|
467
|
+
await el.updateComplete;
|
|
468
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
469
|
+
expect(icon.getAttribute('name')).to.equal('c');
|
|
470
|
+
});
|
|
471
|
+
it('84. should maintain structure after requestUpdate', async () => {
|
|
472
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
473
|
+
el.requestUpdate();
|
|
474
|
+
await el.updateComplete;
|
|
475
|
+
expect(el.shadowRoot.querySelector('.icon-button')).to.exist;
|
|
476
|
+
});
|
|
477
|
+
it('85. should handle being inside a form', async () => {
|
|
478
|
+
const container = await fixture(html `<form><nile-icon-button></nile-icon-button></form>`);
|
|
479
|
+
const btn = container.querySelector('nile-icon-button');
|
|
480
|
+
expect(btn.shadowRoot.querySelector('.icon-button')).to.exist;
|
|
481
|
+
});
|
|
482
|
+
it('86. should handle being inside a nile-button container', async () => {
|
|
483
|
+
const container = await fixture(html `<div><nile-icon-button name="x"></nile-icon-button></div>`);
|
|
484
|
+
const btn = container.querySelector('nile-icon-button');
|
|
485
|
+
expect(btn.name).to.equal('x');
|
|
486
|
+
});
|
|
487
|
+
it('87. should handle hidden attribute', async () => {
|
|
488
|
+
const el = await fixture(html `<nile-icon-button hidden></nile-icon-button>`);
|
|
489
|
+
expect(el.hidden).to.be.true;
|
|
490
|
+
});
|
|
491
|
+
it('88. should handle style attribute', async () => {
|
|
492
|
+
const el = await fixture(html `<nile-icon-button style="opacity:0.5"></nile-icon-button>`);
|
|
493
|
+
expect(el.style.opacity).to.equal('0.5');
|
|
494
|
+
});
|
|
495
|
+
it('89. should have no text content', async () => {
|
|
496
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
497
|
+
expect(el.textContent.trim()).to.equal('');
|
|
498
|
+
});
|
|
499
|
+
it('90. should have updateComplete promise', async () => {
|
|
500
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
501
|
+
expect(el.updateComplete).to.be.a('promise');
|
|
502
|
+
});
|
|
503
|
+
it('91. should resolve updateComplete', async () => {
|
|
504
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
505
|
+
const result = await el.updateComplete;
|
|
506
|
+
expect(result).to.not.be.undefined;
|
|
507
|
+
});
|
|
508
|
+
it('92. should be connected after fixture', async () => {
|
|
509
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
510
|
+
expect(el.isConnected).to.be.true;
|
|
511
|
+
});
|
|
512
|
+
it('93. should be disconnected after removal', async () => {
|
|
513
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
514
|
+
el.remove();
|
|
515
|
+
expect(el.isConnected).to.be.false;
|
|
516
|
+
});
|
|
517
|
+
it('94. button should have nodeType ELEMENT_NODE', async () => {
|
|
518
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
519
|
+
expect(el.nodeType).to.equal(Node.ELEMENT_NODE);
|
|
520
|
+
});
|
|
521
|
+
it('95. shadowRoot host should be the element', async () => {
|
|
522
|
+
const el = await fixture(html `<nile-icon-button></nile-icon-button>`);
|
|
523
|
+
expect(el.shadowRoot.host).to.equal(el);
|
|
524
|
+
});
|
|
525
|
+
// Comprehensive combos
|
|
526
|
+
it('96. name + library + label + disabled', async () => {
|
|
527
|
+
const el = await fixture(html `
|
|
528
|
+
<nile-icon-button name="close" library="system" label="Close" disabled></nile-icon-button>
|
|
529
|
+
`);
|
|
530
|
+
expect(el.disabled).to.be.true;
|
|
531
|
+
const icon = el.shadowRoot.querySelector('nile-icon');
|
|
532
|
+
expect(icon.getAttribute('name')).to.equal('close');
|
|
533
|
+
expect(icon.getAttribute('library')).to.equal('system');
|
|
534
|
+
});
|
|
535
|
+
it('97. name + href + target + label', async () => {
|
|
536
|
+
const el = await fixture(html `
|
|
537
|
+
<nile-icon-button name="link" href="https://example.com" target="_blank" label="Link"></nile-icon-button>
|
|
538
|
+
`);
|
|
539
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
540
|
+
expect(anchor.getAttribute('href')).to.equal('https://example.com');
|
|
541
|
+
expect(anchor.getAttribute('target')).to.equal('_blank');
|
|
542
|
+
});
|
|
543
|
+
it('98. should handle name + color + label', async () => {
|
|
544
|
+
const el = await fixture(html `
|
|
545
|
+
<nile-icon-button name="edit" color="blue" label="Edit"></nile-icon-button>
|
|
546
|
+
`);
|
|
547
|
+
expect(el.name).to.equal('edit');
|
|
548
|
+
expect(el.color).to.equal('blue');
|
|
549
|
+
expect(el.label).to.equal('Edit');
|
|
550
|
+
});
|
|
551
|
+
it('99. should handle all link properties', async () => {
|
|
552
|
+
const el = await fixture(html `
|
|
553
|
+
<nile-icon-button name="download" href="https://example.com/file" target="_blank" download="file.pdf" label="Download"></nile-icon-button>
|
|
554
|
+
`);
|
|
555
|
+
const anchor = el.shadowRoot.querySelector('a');
|
|
556
|
+
expect(anchor.getAttribute('href')).to.equal('https://example.com/file');
|
|
557
|
+
expect(anchor.getAttribute('target')).to.equal('_blank');
|
|
558
|
+
expect(anchor.getAttribute('download')).to.equal('file.pdf');
|
|
559
|
+
});
|
|
560
|
+
it('100. should handle switching from anchor to button', async () => {
|
|
561
|
+
const el = await fixture(html `<nile-icon-button href="https://example.com"></nile-icon-button>`);
|
|
562
|
+
expect(el.shadowRoot.querySelector('a')).to.exist;
|
|
563
|
+
el.href = undefined;
|
|
564
|
+
await el.updateComplete;
|
|
565
|
+
expect(el.shadowRoot.querySelector('button')).to.exist;
|
|
566
|
+
});
|
|
567
|
+
});
|
|
568
|
+
//# sourceMappingURL=nile-icon-button.test.js.map
|