@aquera/nile-elements 1.5.2 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +240 -196
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-badge/index.cjs.js +1 -1
- package/dist/nile-badge/index.esm.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js +1 -1
- package/dist/nile-badge/nile-badge.cjs.js.map +1 -1
- package/dist/nile-badge/nile-badge.esm.js +1 -1
- package/dist/nile-button/index.cjs.js +1 -1
- package/dist/nile-button/index.esm.js +1 -1
- package/dist/nile-button/nile-button.cjs.js +1 -1
- package/dist/nile-button/nile-button.cjs.js.map +1 -1
- package/dist/nile-button/nile-button.esm.js +1 -1
- package/dist/nile-carousel/index.cjs.js +1 -1
- package/dist/nile-carousel/index.esm.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js +1 -1
- package/dist/nile-carousel/nile-carousel.cjs.js.map +1 -1
- package/dist/nile-carousel/nile-carousel.esm.js +11 -11
- package/dist/nile-dialog/index.cjs.js +1 -1
- package/dist/nile-dialog/index.esm.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js +1 -1
- package/dist/nile-dialog/nile-dialog.cjs.js.map +1 -1
- package/dist/nile-dialog/nile-dialog.esm.js +1 -1
- package/dist/nile-drawer/index.cjs.js +1 -1
- package/dist/nile-drawer/index.esm.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js +1 -1
- package/dist/nile-drawer/nile-drawer.cjs.js.map +1 -1
- package/dist/nile-drawer/nile-drawer.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/types/index.cjs.js +1 -1
- package/dist/nile-file-upload/types/index.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.esm.js +2 -2
- package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
- package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.width.esm.js +1 -1
- package/dist/nile-icon/icons/svg/delete_history.cjs.js +2 -0
- package/dist/nile-icon/icons/svg/delete_history.cjs.js.map +1 -0
- package/dist/nile-icon/icons/svg/delete_history.esm.js +1 -0
- package/dist/nile-icon/icons/svg/index.cjs.js +1 -1
- package/dist/nile-icon/icons/svg/index.esm.js +1 -1
- package/dist/nile-icon/index.cjs.js +1 -1
- package/dist/nile-icon/index.cjs.js.map +1 -1
- package/dist/nile-icon/index.esm.js +1 -1
- package/dist/nile-icon-button/index.cjs.js +1 -1
- package/dist/nile-icon-button/index.esm.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js +1 -1
- package/dist/nile-icon-button/nile-icon-button.cjs.js.map +1 -1
- package/dist/nile-icon-button/nile-icon-button.esm.js +1 -1
- package/dist/nile-input/index.cjs.js +1 -1
- package/dist/nile-input/index.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +2 -2
- package/dist/nile-menu-item/index.cjs.js +1 -1
- package/dist/nile-menu-item/index.esm.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js +1 -1
- package/dist/nile-menu-item/nile-menu-item.cjs.js.map +1 -1
- package/dist/nile-menu-item/nile-menu-item.esm.js +1 -1
- package/dist/nile-option/index.cjs.js +1 -1
- package/dist/nile-option/index.esm.js +1 -1
- package/dist/nile-option/nile-option.cjs.js +1 -1
- package/dist/nile-option/nile-option.cjs.js.map +1 -1
- package/dist/nile-option/nile-option.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +4 -4
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +11 -6
- package/dist/nile-select/index.cjs.js +1 -1
- package/dist/nile-select/index.esm.js +1 -1
- package/dist/nile-select/nile-select.cjs.js +1 -1
- package/dist/nile-select/nile-select.cjs.js.map +1 -1
- package/dist/nile-select/nile-select.esm.js +1 -1
- package/dist/nile-side-bar-action-menu-item/index.cjs.js +1 -1
- package/dist/nile-side-bar-action-menu-item/index.esm.js +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.cjs.js +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.cjs.js.map +1 -1
- package/dist/nile-side-bar-action-menu-item/nile-side-bar-action-menu-item.esm.js +1 -1
- package/dist/nile-tab/index.cjs.js +1 -1
- package/dist/nile-tab/index.esm.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js +1 -1
- package/dist/nile-tab/nile-tab.cjs.js.map +1 -1
- package/dist/nile-tab/nile-tab.esm.js +1 -1
- package/dist/nile-tab-group/index.cjs.js +1 -1
- package/dist/nile-tab-group/index.esm.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js +1 -1
- package/dist/nile-tab-group/nile-tab-group.cjs.js.map +1 -1
- package/dist/nile-tab-group/nile-tab-group.esm.js +1 -1
- package/dist/nile-tag/index.cjs.js +1 -1
- package/dist/nile-tag/index.esm.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js +1 -1
- package/dist/nile-tag/nile-tag.cjs.js.map +1 -1
- package/dist/nile-tag/nile-tag.esm.js +1 -1
- package/dist/nile-toast/index.cjs.js +1 -1
- package/dist/nile-toast/index.esm.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js +1 -1
- package/dist/nile-toast/nile-toast.cjs.js.map +1 -1
- package/dist/nile-toast/nile-toast.esm.js +1 -1
- package/dist/nile-tree/index.cjs.js +1 -1
- package/dist/nile-tree/index.esm.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js +1 -1
- package/dist/nile-tree/nile-tree.cjs.js.map +1 -1
- package/dist/nile-tree/nile-tree.esm.js +1 -1
- package/dist/nile-tree-item/index.cjs.js +1 -1
- package/dist/nile-tree-item/index.esm.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js +1 -1
- package/dist/nile-tree-item/nile-tree-item.cjs.js.map +1 -1
- package/dist/nile-tree-item/nile-tree-item.esm.js +1 -1
- package/dist/nile-virtual-select/index.cjs.js +1 -1
- package/dist/nile-virtual-select/index.esm.js +1 -1
- package/dist/nile-virtual-select/nile-virtual-select.cjs.js +2 -2
- package/dist/nile-virtual-select/nile-virtual-select.esm.js +1 -1
- package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
- package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
- package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +554 -35
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
- package/dist/src/nile-button/nile-button.test.js +499 -39
- package/dist/src/nile-button/nile-button.test.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
- package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.js +102 -66
- package/dist/src/nile-card/nile-card.test.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
- package/dist/src/nile-chip/nile-chip.test.js +101 -102
- package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
- package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
- package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
- package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
- package/dist/src/nile-divider/nile-divider.test.js +560 -0
- package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
- package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
- package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
- package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
- package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
- package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
- package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
- package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
- package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
- package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
- package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
- package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.d.ts +1 -0
- package/dist/src/nile-grid/nile-grid.js +5 -1
- package/dist/src/nile-grid/nile-grid.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
- package/dist/src/nile-grid/nile-grid.utils.js +13 -0
- package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
- package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
- package/dist/src/nile-heading/nile-heading.test.js +108 -0
- package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +101 -38
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
- package/dist/src/nile-icon/icons/svg/delete_history.d.ts +5 -0
- package/dist/src/nile-icon/icons/svg/delete_history.js +5 -0
- package/dist/src/nile-icon/icons/svg/delete_history.js.map +1 -0
- package/dist/src/nile-icon/icons/svg/index.d.ts +1 -0
- package/dist/src/nile-icon/icons/svg/index.js +1 -0
- package/dist/src/nile-icon/icons/svg/index.js.map +1 -1
- package/dist/src/nile-icon/nile-icon.test.js +103 -40
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.js +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-input/nile-input.test.js +109 -139
- package/dist/src/nile-input/nile-input.test.js.map +1 -1
- package/dist/src/nile-link/nile-link.test.js +103 -67
- package/dist/src/nile-link/nile-link.test.js.map +1 -1
- package/dist/src/nile-list/nile-list.test.d.ts +1 -0
- package/dist/src/nile-list/nile-list.test.js +108 -0
- package/dist/src/nile-list/nile-list.test.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
- package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +107 -40
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.test.js +113 -0
- package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
- package/dist/src/nile-option/nile-option.test.d.ts +1 -0
- package/dist/src/nile-option/nile-option.test.js +108 -0
- package/dist/src/nile-option/nile-option.test.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
- package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
- package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
- package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +103 -68
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.test.js +104 -65
- package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.test.js +103 -66
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
- package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
- package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
- package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
- package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.test.d.ts +0 -5
- package/dist/src/nile-select/nile-select.test.js +105 -244
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
- package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
- package/dist/src/nile-slider/nile-slider.test.js +108 -0
- package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
- package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.test.js +108 -0
- package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
- package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
- package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
- package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.test.js +574 -0
- package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
- package/dist/src/nile-title/nile-title.test.d.ts +1 -0
- package/dist/src/nile-title/nile-title.test.js +108 -0
- package/dist/src/nile-title/nile-title.test.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.test.js +526 -0
- package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/version.js +2 -2
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.js +7 -1
- package/src/nile-accordion/nile-accordian.test.ts +102 -116
- package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
- package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-avatar/nile-avatar.test.ts +102 -112
- package/src/nile-badge/nile-badge.test.ts +642 -30
- package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
- package/src/nile-button/nile-button.test.ts +593 -61
- package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
- package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
- package/src/nile-calendar/nile-calendar.test.ts +102 -406
- package/src/nile-card/nile-card.test.ts +103 -71
- package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
- package/src/nile-chip/nile-chip.test.ts +102 -136
- package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
- package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
- package/src/nile-dialog/nile-dialog.test.ts +102 -164
- package/src/nile-divider/nile-divider.test.ts +659 -0
- package/src/nile-drawer/nile-drawer.test.ts +105 -105
- package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
- package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
- package/src/nile-error-message/nile-error-message.test.ts +104 -67
- package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
- package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
- package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
- package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
- package/src/nile-file-preview/nile-file-preview.ts +23 -56
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
- package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
- package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
- package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
- package/src/nile-file-upload/nile-file-upload.ts +11 -3
- package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
- package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
- package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
- package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
- package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
- package/src/nile-form-group/nile-form-group.test.ts +103 -60
- package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
- package/src/nile-format-date/nile-format-date.test.ts +106 -0
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
- package/src/nile-grid/nile-grid.ts +6 -1
- package/src/nile-grid/nile-grid.utils.ts +18 -1
- package/src/nile-heading/nile-heading.test.ts +106 -0
- package/src/nile-hero/nile-hero.test.ts +103 -42
- package/src/nile-icon/icons/svg/delete_history.ts +5 -0
- package/src/nile-icon/icons/svg/index.ts +1 -0
- package/src/nile-icon/nile-icon.test.ts +103 -50
- package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
- package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
- package/src/nile-input/nile-input.test.ts +105 -164
- package/src/nile-input/nile-input.ts +1 -1
- package/src/nile-link/nile-link.test.ts +104 -81
- package/src/nile-list/nile-list.test.ts +106 -0
- package/src/nile-list-item/nile-list-item.test.ts +106 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
- package/src/nile-loader/nile-loader.test.ts +103 -48
- package/src/nile-menu/nile-menu.test.ts +106 -0
- package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
- package/src/nile-option/nile-option.test.ts +106 -0
- package/src/nile-option-group/nile-option-group.test.ts +106 -0
- package/src/nile-page-header/nile-page-header.test.ts +106 -0
- package/src/nile-pagination/nile-pagination.test.ts +106 -0
- package/src/nile-popover/nile-popover.test.ts +103 -83
- package/src/nile-popup/nile-popup.test.ts +102 -82
- package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
- package/src/nile-radio/nile-radio.test.ts +103 -78
- package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
- package/src/nile-section-message/nile-section-message.test.ts +106 -0
- package/src/nile-select/nile-select.test.ts +105 -308
- package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
- package/src/nile-slider/nile-slider.test.ts +106 -0
- package/src/nile-spinner/nile-spinner.test.ts +668 -0
- package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
- package/src/nile-stepper/nile-stepper.test.ts +107 -0
- package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
- package/src/nile-tab/nile-tab.test.ts +106 -0
- package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
- package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
- package/src/nile-tag/nile-tag.test.ts +675 -0
- package/src/nile-textarea/nile-textarea.test.ts +104 -100
- package/src/nile-title/nile-title.test.ts +106 -0
- package/src/nile-toast/nile-toast.test.ts +625 -0
- package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
- package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
- package/vscode-html-custom-data.json +8 -3
- package/web-test-runner.config.mjs +4 -2
- package/dist/axe.min-2720cd56.esm.js +0 -1
- package/dist/axe.min-69d47269.cjs.js +0 -2
- package/dist/axe.min-69d47269.cjs.js.map +0 -1
- package/dist/css-tag-bb10c0fa.cjs.js +0 -6
- package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
- package/dist/css-tag-dc564feb.esm.js +0 -6
- package/dist/fixture-958445f8.cjs.js +0 -395
- package/dist/fixture-958445f8.cjs.js.map +0 -1
- package/dist/fixture-985bba12.esm.js +0 -569
- package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
- package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
- package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
- package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
- package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
- package/dist/nile-badge/nile-badge.test.esm.js +0 -1
- package/dist/nile-button/nile-button.test.cjs.js +0 -2
- package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
- package/dist/nile-button/nile-button.test.esm.js +0 -4
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
- package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
- package/dist/nile-card/nile-card.test.cjs.js +0 -2
- package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
- package/dist/nile-card/nile-card.test.esm.js +0 -51
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
- package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
- package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
- package/dist/nile-chip/nile-chip.test.esm.js +0 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
- package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
- package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
- package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
- package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
- package/dist/nile-hero/nile-hero.test.esm.js +0 -14
- package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
- package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
- package/dist/nile-icon/nile-icon.test.esm.js +0 -1
- package/dist/nile-input/nile-input.test.cjs.js +0 -2
- package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
- package/dist/nile-input/nile-input.test.esm.js +0 -17
- package/dist/nile-link/nile-link.test.cjs.js +0 -2
- package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
- package/dist/nile-link/nile-link.test.esm.js +0 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
- package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
- package/dist/nile-loader/nile-loader.test.esm.js +0 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
- package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
- package/dist/nile-popover/nile-popover.test.esm.js +0 -21
- package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
- package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
- package/dist/nile-popup/nile-popup.test.esm.js +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
- package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
- package/dist/nile-radio/nile-radio.test.esm.js +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
- package/dist/nile-select/nile-select.test.cjs.js +0 -2
- package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
- package/dist/nile-select/nile-select.test.esm.js +0 -55
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
- package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
- package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
- package/dist/sinon-esm-68c8e378.esm.js +0 -1
- package/dist/sinon-esm-97570c13.cjs.js +0 -2
- package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
|
@@ -1,86 +1,546 @@
|
|
|
1
1
|
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
-
import './nile-button';
|
|
2
|
+
import './nile-button';
|
|
3
3
|
describe('NileButton', () => {
|
|
4
|
-
|
|
4
|
+
// === RENDERING TESTS ===
|
|
5
|
+
it('1. should render without errors', async () => {
|
|
5
6
|
const el = await fixture(html `<nile-button></nile-button>`);
|
|
6
7
|
expect(el).to.exist;
|
|
8
|
+
});
|
|
9
|
+
it('2. should have a shadow root', async () => {
|
|
10
|
+
const el = await fixture(html `<nile-button></nile-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-button></nile-button>`);
|
|
15
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
16
|
+
expect(button.tagName).to.equal('BUTTON');
|
|
17
|
+
});
|
|
18
|
+
it('4. should render an anchor element when href is set', async () => {
|
|
19
|
+
const el = await fixture(html `<nile-button href="https://example.com"></nile-button>`);
|
|
20
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
21
|
+
expect(anchor.tagName).to.equal('A');
|
|
22
|
+
});
|
|
23
|
+
it('5. should render slot content', async () => {
|
|
24
|
+
const el = await fixture(html `<nile-button>Click Me</nile-button>`);
|
|
25
|
+
expect(el.textContent.trim()).to.equal('Click Me');
|
|
26
|
+
});
|
|
27
|
+
it('6. should render prefix slot', async () => {
|
|
28
|
+
const el = await fixture(html `<nile-button><span slot="prefix">P</span>Label</nile-button>`);
|
|
29
|
+
const prefixSlot = el.shadowRoot.querySelector('slot[name="prefix"]');
|
|
30
|
+
expect(prefixSlot).to.exist;
|
|
31
|
+
});
|
|
32
|
+
it('7. should render suffix slot', async () => {
|
|
33
|
+
const el = await fixture(html `<nile-button><span slot="suffix">S</span>Label</nile-button>`);
|
|
34
|
+
const suffixSlot = el.shadowRoot.querySelector('slot[name="suffix"]');
|
|
35
|
+
expect(suffixSlot).to.exist;
|
|
36
|
+
});
|
|
37
|
+
it('8. should render default slot for label', async () => {
|
|
38
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
39
|
+
const labelSlot = el.shadowRoot.querySelector('slot:not([name])');
|
|
40
|
+
expect(labelSlot).to.exist;
|
|
41
|
+
});
|
|
42
|
+
// === DEFAULT PROPERTIES ===
|
|
43
|
+
it('9. should have variant default to primary', async () => {
|
|
44
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
7
45
|
expect(el.variant).to.equal('primary');
|
|
46
|
+
});
|
|
47
|
+
it('10. should have size default to medium', async () => {
|
|
48
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
8
49
|
expect(el.size).to.equal('medium');
|
|
50
|
+
});
|
|
51
|
+
it('11. should have type default to button', async () => {
|
|
52
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
9
53
|
expect(el.type).to.equal('button');
|
|
54
|
+
});
|
|
55
|
+
it('12. should have disabled default to false', async () => {
|
|
56
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
10
57
|
expect(el.disabled).to.be.false;
|
|
58
|
+
});
|
|
59
|
+
it('13. should have loading default to false', async () => {
|
|
60
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
11
61
|
expect(el.loading).to.be.false;
|
|
12
62
|
});
|
|
13
|
-
it('should
|
|
14
|
-
const el = await fixture(html `<nile-button
|
|
63
|
+
it('14. should have caret default to false', async () => {
|
|
64
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
65
|
+
expect(el.caret).to.be.false;
|
|
66
|
+
});
|
|
67
|
+
it('15. should have outline default to false', async () => {
|
|
68
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
69
|
+
expect(el.outline).to.be.false;
|
|
70
|
+
});
|
|
71
|
+
it('16. should have pill default to false', async () => {
|
|
72
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
73
|
+
expect(el.pill).to.be.false;
|
|
74
|
+
});
|
|
75
|
+
it('17. should have circle default to false', async () => {
|
|
76
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
77
|
+
expect(el.circle).to.be.false;
|
|
78
|
+
});
|
|
79
|
+
it('18. should have name default to empty string', async () => {
|
|
80
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
81
|
+
expect(el.name).to.equal('');
|
|
82
|
+
});
|
|
83
|
+
it('19. should have value default to empty string', async () => {
|
|
84
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
85
|
+
expect(el.value).to.equal('');
|
|
86
|
+
});
|
|
87
|
+
it('20. should have href default to empty string', async () => {
|
|
88
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
89
|
+
expect(el.href).to.equal('');
|
|
90
|
+
});
|
|
91
|
+
it('21. should have hideBorder default to false', async () => {
|
|
92
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
93
|
+
expect(el.hideBorder).to.be.false;
|
|
94
|
+
});
|
|
95
|
+
it('22. should have title default to empty string', async () => {
|
|
96
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
97
|
+
expect(el.title).to.equal('');
|
|
98
|
+
});
|
|
99
|
+
// === VARIANT TESTS ===
|
|
100
|
+
it('23. should apply primary variant class', async () => {
|
|
101
|
+
const el = await fixture(html `<nile-button variant="primary"></nile-button>`);
|
|
102
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
103
|
+
expect(button.classList.contains('button--primary')).to.be.true;
|
|
104
|
+
});
|
|
105
|
+
it('24. should apply secondary variant class', async () => {
|
|
106
|
+
const el = await fixture(html `<nile-button variant="secondary"></nile-button>`);
|
|
15
107
|
const button = el.shadowRoot.querySelector('.button');
|
|
16
108
|
expect(button.classList.contains('button--secondary')).to.be.true;
|
|
17
|
-
expect(button.classList.contains('button--pill')).to.be.true;
|
|
18
|
-
expect(button.classList.contains('button--outline')).to.be.true;
|
|
19
|
-
expect(button.classList.contains('button--caret')).to.be.true;
|
|
20
109
|
});
|
|
21
|
-
it('should
|
|
110
|
+
it('25. should apply tertiary variant class', async () => {
|
|
111
|
+
const el = await fixture(html `<nile-button variant="tertiary"></nile-button>`);
|
|
112
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
113
|
+
expect(button.classList.contains('button--tertiary')).to.be.true;
|
|
114
|
+
});
|
|
115
|
+
it('26. should apply caution variant class', async () => {
|
|
116
|
+
const el = await fixture(html `<nile-button variant="caution"></nile-button>`);
|
|
117
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
118
|
+
expect(button.classList.contains('button--caution')).to.be.true;
|
|
119
|
+
});
|
|
120
|
+
it('27. should apply ghost variant class', async () => {
|
|
121
|
+
const el = await fixture(html `<nile-button variant="ghost"></nile-button>`);
|
|
122
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
123
|
+
expect(button.classList.contains('button--ghost')).to.be.true;
|
|
124
|
+
});
|
|
125
|
+
it('28. should apply destructive variant class', async () => {
|
|
126
|
+
const el = await fixture(html `<nile-button variant="destructive"></nile-button>`);
|
|
127
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
128
|
+
expect(button.classList.contains('button--destructive')).to.be.true;
|
|
129
|
+
});
|
|
130
|
+
it('29. should apply secondary-grey variant class', async () => {
|
|
131
|
+
const el = await fixture(html `<nile-button variant="secondary-grey"></nile-button>`);
|
|
132
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
133
|
+
expect(button.classList.contains('button--secondary-grey')).to.be.true;
|
|
134
|
+
});
|
|
135
|
+
it('30. should apply secondary-blue variant class', async () => {
|
|
136
|
+
const el = await fixture(html `<nile-button variant="secondary-blue"></nile-button>`);
|
|
137
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
138
|
+
expect(button.classList.contains('button--secondary-blue')).to.be.true;
|
|
139
|
+
});
|
|
140
|
+
it('31. should reflect variant attribute', async () => {
|
|
141
|
+
const el = await fixture(html `<nile-button variant="caution"></nile-button>`);
|
|
142
|
+
expect(el.getAttribute('variant')).to.equal('caution');
|
|
143
|
+
});
|
|
144
|
+
// === DISABLED STATE ===
|
|
145
|
+
it('32. should be disabled when disabled property is set', async () => {
|
|
22
146
|
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
23
147
|
const button = el.shadowRoot.querySelector('.button');
|
|
24
148
|
expect(button.hasAttribute('disabled')).to.be.true;
|
|
149
|
+
});
|
|
150
|
+
it('33. should have aria-disabled true when disabled', async () => {
|
|
151
|
+
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
152
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
25
153
|
expect(button.getAttribute('aria-disabled')).to.equal('true');
|
|
26
154
|
});
|
|
27
|
-
it('should
|
|
28
|
-
const el = await fixture(html `<nile-button
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
155
|
+
it('34. should have aria-disabled false when not disabled', async () => {
|
|
156
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
157
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
158
|
+
expect(button.getAttribute('aria-disabled')).to.equal('false');
|
|
159
|
+
});
|
|
160
|
+
it('35. should apply disabled class when disabled', async () => {
|
|
161
|
+
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
162
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
163
|
+
expect(button.classList.contains('button--disabled')).to.be.true;
|
|
164
|
+
});
|
|
165
|
+
it('36. should have tabindex -1 when disabled', async () => {
|
|
166
|
+
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
167
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
168
|
+
expect(button.getAttribute('tabindex')).to.equal('-1');
|
|
169
|
+
});
|
|
170
|
+
it('37. should have tabindex 0 when not disabled', async () => {
|
|
171
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
32
172
|
const button = el.shadowRoot.querySelector('.button');
|
|
33
|
-
expect(button.
|
|
34
|
-
|
|
35
|
-
|
|
173
|
+
expect(button.getAttribute('tabindex')).to.equal('0');
|
|
174
|
+
});
|
|
175
|
+
it('38. should prevent click events when disabled', async () => {
|
|
176
|
+
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
177
|
+
let clicked = false;
|
|
178
|
+
el.addEventListener('click', () => (clicked = true));
|
|
179
|
+
el.click();
|
|
180
|
+
expect(clicked).to.be.false;
|
|
36
181
|
});
|
|
37
|
-
it('should
|
|
182
|
+
it('39. should reflect disabled attribute', async () => {
|
|
183
|
+
const el = await fixture(html `<nile-button disabled></nile-button>`);
|
|
184
|
+
expect(el.hasAttribute('disabled')).to.be.true;
|
|
185
|
+
});
|
|
186
|
+
// === LOADING STATE ===
|
|
187
|
+
it('40. should show spinner when loading', async () => {
|
|
38
188
|
const el = await fixture(html `<nile-button loading></nile-button>`);
|
|
39
189
|
const spinner = el.shadowRoot.querySelector('nile-spinner');
|
|
40
190
|
expect(spinner).to.exist;
|
|
41
191
|
});
|
|
42
|
-
it('should
|
|
192
|
+
it('41. should not show spinner when not loading', async () => {
|
|
43
193
|
const el = await fixture(html `<nile-button></nile-button>`);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
el.addEventListener('nile-focus', () => (focusEventEmitted = true));
|
|
47
|
-
button.dispatchEvent(new FocusEvent('focus'));
|
|
48
|
-
expect(focusEventEmitted).to.be.true;
|
|
49
|
-
let blurEventEmitted = false;
|
|
50
|
-
el.addEventListener('nile-blur', () => (blurEventEmitted = true));
|
|
51
|
-
button.dispatchEvent(new FocusEvent('blur'));
|
|
52
|
-
expect(blurEventEmitted).to.be.true;
|
|
194
|
+
const spinner = el.shadowRoot.querySelector('nile-spinner');
|
|
195
|
+
expect(spinner).to.be.null;
|
|
53
196
|
});
|
|
54
|
-
it('should
|
|
55
|
-
const el = await fixture(html `<nile-button
|
|
197
|
+
it('42. should apply loading class when loading', async () => {
|
|
198
|
+
const el = await fixture(html `<nile-button loading></nile-button>`);
|
|
56
199
|
const button = el.shadowRoot.querySelector('.button');
|
|
200
|
+
expect(button.classList.contains('button--loading')).to.be.true;
|
|
201
|
+
});
|
|
202
|
+
it('43. should prevent click when loading', async () => {
|
|
203
|
+
const el = await fixture(html `<nile-button loading></nile-button>`);
|
|
57
204
|
let clicked = false;
|
|
58
205
|
el.addEventListener('click', () => (clicked = true));
|
|
59
206
|
el.click();
|
|
60
|
-
expect(clicked).to.be.
|
|
207
|
+
expect(clicked).to.be.false;
|
|
61
208
|
});
|
|
62
|
-
it('should
|
|
63
|
-
const el = await fixture(html `<nile-button
|
|
209
|
+
it('44. should reflect loading attribute', async () => {
|
|
210
|
+
const el = await fixture(html `<nile-button loading></nile-button>`);
|
|
211
|
+
expect(el.hasAttribute('loading')).to.be.true;
|
|
212
|
+
});
|
|
213
|
+
// === CARET ===
|
|
214
|
+
it('45. should show caret icon when caret is true', async () => {
|
|
215
|
+
const el = await fixture(html `<nile-button caret></nile-button>`);
|
|
216
|
+
const caret = el.shadowRoot.querySelector('nile-icon[part="caret"]');
|
|
217
|
+
expect(caret).to.exist;
|
|
218
|
+
});
|
|
219
|
+
it('46. should not show caret icon when caret is false', async () => {
|
|
220
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
221
|
+
const caret = el.shadowRoot.querySelector('nile-icon[part="caret"]');
|
|
222
|
+
expect(caret).to.be.null;
|
|
223
|
+
});
|
|
224
|
+
it('47. should apply caret class when caret is set', async () => {
|
|
225
|
+
const el = await fixture(html `<nile-button caret></nile-button>`);
|
|
64
226
|
const button = el.shadowRoot.querySelector('.button');
|
|
227
|
+
expect(button.classList.contains('button--caret')).to.be.true;
|
|
228
|
+
});
|
|
229
|
+
// === PILL ===
|
|
230
|
+
it('48. should apply pill class when pill is true', async () => {
|
|
231
|
+
const el = await fixture(html `<nile-button pill></nile-button>`);
|
|
232
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
233
|
+
expect(button.classList.contains('button--pill')).to.be.true;
|
|
234
|
+
});
|
|
235
|
+
it('49. should reflect pill attribute', async () => {
|
|
236
|
+
const el = await fixture(html `<nile-button pill></nile-button>`);
|
|
237
|
+
expect(el.hasAttribute('pill')).to.be.true;
|
|
238
|
+
});
|
|
239
|
+
// === CIRCLE ===
|
|
240
|
+
it('50. should apply circle class when circle is true', async () => {
|
|
241
|
+
const el = await fixture(html `<nile-button circle></nile-button>`);
|
|
242
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
243
|
+
expect(button.classList.contains('button--circle')).to.be.true;
|
|
244
|
+
});
|
|
245
|
+
it('51. should reflect circle attribute', async () => {
|
|
246
|
+
const el = await fixture(html `<nile-button circle></nile-button>`);
|
|
247
|
+
expect(el.hasAttribute('circle')).to.be.true;
|
|
248
|
+
});
|
|
249
|
+
// === OUTLINE ===
|
|
250
|
+
it('52. should apply outline class when outline is true', async () => {
|
|
251
|
+
const el = await fixture(html `<nile-button outline></nile-button>`);
|
|
252
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
253
|
+
expect(button.classList.contains('button--outline')).to.be.true;
|
|
254
|
+
});
|
|
255
|
+
it('53. should apply standard class when outline is false', async () => {
|
|
256
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
257
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
258
|
+
expect(button.classList.contains('button--standard')).to.be.true;
|
|
259
|
+
});
|
|
260
|
+
// === LINK MODE (href) ===
|
|
261
|
+
it('54. should set href attribute on anchor', async () => {
|
|
262
|
+
const el = await fixture(html `<nile-button href="https://example.com"></nile-button>`);
|
|
263
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
264
|
+
expect(anchor.getAttribute('href')).to.equal('https://example.com');
|
|
265
|
+
});
|
|
266
|
+
it('55. should set target on anchor', async () => {
|
|
267
|
+
const el = await fixture(html `<nile-button href="https://example.com" target="_blank"></nile-button>`);
|
|
268
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
269
|
+
expect(anchor.getAttribute('target')).to.equal('_blank');
|
|
270
|
+
});
|
|
271
|
+
it('56. should set role=button on anchor', async () => {
|
|
272
|
+
const el = await fixture(html `<nile-button href="https://example.com"></nile-button>`);
|
|
273
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
274
|
+
expect(anchor.getAttribute('role')).to.equal('button');
|
|
275
|
+
});
|
|
276
|
+
it('57. should set rel attribute on anchor', async () => {
|
|
277
|
+
const el = await fixture(html `<nile-button href="https://example.com"></nile-button>`);
|
|
278
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
279
|
+
expect(anchor.getAttribute('rel')).to.equal('noreferrer noopener');
|
|
280
|
+
});
|
|
281
|
+
it('58. should set download attribute on anchor when provided', async () => {
|
|
282
|
+
const el = await fixture(html `<nile-button href="https://example.com" download="file.pdf"></nile-button>`);
|
|
283
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
284
|
+
expect(anchor.getAttribute('download')).to.equal('file.pdf');
|
|
285
|
+
});
|
|
286
|
+
// === BUTTON TYPE ===
|
|
287
|
+
it('59. should set button type attribute', async () => {
|
|
288
|
+
const el = await fixture(html `<nile-button type="submit"></nile-button>`);
|
|
289
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
290
|
+
expect(button.getAttribute('type')).to.equal('submit');
|
|
291
|
+
});
|
|
292
|
+
it('60. should support type=reset', async () => {
|
|
293
|
+
const el = await fixture(html `<nile-button type="reset"></nile-button>`);
|
|
294
|
+
expect(el.type).to.equal('reset');
|
|
295
|
+
});
|
|
296
|
+
it('61. should set name attribute on button', async () => {
|
|
297
|
+
const el = await fixture(html `<nile-button name="myButton"></nile-button>`);
|
|
298
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
299
|
+
expect(button.getAttribute('name')).to.equal('myButton');
|
|
300
|
+
});
|
|
301
|
+
it('62. should set value attribute on button', async () => {
|
|
302
|
+
const el = await fixture(html `<nile-button value="myValue"></nile-button>`);
|
|
303
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
304
|
+
expect(button.getAttribute('value')).to.equal('myValue');
|
|
305
|
+
});
|
|
306
|
+
// === EVENTS ===
|
|
307
|
+
it('63. should emit nile-focus when focused', async () => {
|
|
308
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
309
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
310
|
+
let focusEmitted = false;
|
|
311
|
+
el.addEventListener('nile-focus', () => (focusEmitted = true));
|
|
312
|
+
button.dispatchEvent(new FocusEvent('focus'));
|
|
313
|
+
expect(focusEmitted).to.be.true;
|
|
314
|
+
});
|
|
315
|
+
it('64. should emit nile-blur when blurred', async () => {
|
|
316
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
317
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
318
|
+
let blurEmitted = false;
|
|
319
|
+
el.addEventListener('nile-blur', () => (blurEmitted = true));
|
|
320
|
+
button.dispatchEvent(new FocusEvent('blur'));
|
|
321
|
+
expect(blurEmitted).to.be.true;
|
|
322
|
+
});
|
|
323
|
+
it('65. should emit nile-init on connectedCallback', async () => {
|
|
324
|
+
let initEmitted = false;
|
|
325
|
+
const container = await fixture(html `<div></div>`);
|
|
326
|
+
const el = document.createElement('nile-button');
|
|
327
|
+
el.addEventListener('nile-init', () => (initEmitted = true));
|
|
328
|
+
container.appendChild(el);
|
|
329
|
+
await el.updateComplete;
|
|
330
|
+
expect(initEmitted).to.be.true;
|
|
331
|
+
});
|
|
332
|
+
it('66. should emit nile-destroy on disconnectedCallback', async () => {
|
|
333
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
334
|
+
let destroyEmitted = false;
|
|
335
|
+
el.addEventListener('nile-destroy', () => (destroyEmitted = true));
|
|
336
|
+
el.remove();
|
|
337
|
+
expect(destroyEmitted).to.be.true;
|
|
338
|
+
});
|
|
339
|
+
// === FOCUS/BLUR METHODS ===
|
|
340
|
+
it('67. should focus programmatically', async () => {
|
|
341
|
+
const el = await fixture(html `<nile-button>Test</nile-button>`);
|
|
342
|
+
el.focus();
|
|
343
|
+
await el.updateComplete;
|
|
344
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
345
|
+
expect(button.classList.contains('button--focused')).to.be.true;
|
|
346
|
+
});
|
|
347
|
+
it('68. should blur programmatically', async () => {
|
|
348
|
+
const el = await fixture(html `<nile-button>Test</nile-button>`);
|
|
65
349
|
el.focus();
|
|
66
350
|
await el.updateComplete;
|
|
67
|
-
const focusButton = el.shadowRoot.querySelector('.button--focused');
|
|
68
|
-
expect(focusButton.classList.contains('button--focused')).to.be.true;
|
|
69
351
|
el.blur();
|
|
70
352
|
await el.updateComplete;
|
|
71
|
-
const
|
|
72
|
-
expect(
|
|
353
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
354
|
+
expect(button.classList.contains('button--focused')).to.be.false;
|
|
73
355
|
});
|
|
74
|
-
it('should
|
|
356
|
+
it('69. should click programmatically', async () => {
|
|
357
|
+
const el = await fixture(html `<nile-button>Test</nile-button>`);
|
|
358
|
+
let clicked = false;
|
|
359
|
+
el.addEventListener('click', () => (clicked = true));
|
|
360
|
+
el.click();
|
|
361
|
+
expect(clicked).to.be.true;
|
|
362
|
+
});
|
|
363
|
+
// === VALIDATION ===
|
|
364
|
+
it('70. should set custom validation message', async () => {
|
|
75
365
|
const el = await fixture(html `<nile-button type="submit"></nile-button>`);
|
|
76
366
|
const form = document.createElement('form');
|
|
77
367
|
form.appendChild(el);
|
|
78
368
|
document.body.appendChild(form);
|
|
79
|
-
el.setCustomValidity('Invalid
|
|
80
|
-
expect(el.validationMessage).to.equal('Invalid
|
|
369
|
+
el.setCustomValidity('Invalid');
|
|
370
|
+
expect(el.validationMessage).to.equal('Invalid');
|
|
81
371
|
el.setCustomValidity('');
|
|
82
372
|
expect(el.validationMessage).to.equal('');
|
|
83
373
|
document.body.removeChild(form);
|
|
84
374
|
});
|
|
375
|
+
it('71. should check validity', async () => {
|
|
376
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
377
|
+
expect(el.checkValidity()).to.be.true;
|
|
378
|
+
});
|
|
379
|
+
it('72. should report validity', async () => {
|
|
380
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
381
|
+
expect(el.reportValidity()).to.be.true;
|
|
382
|
+
});
|
|
383
|
+
it('73. should get validity state', async () => {
|
|
384
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
385
|
+
expect(el.validity).to.exist;
|
|
386
|
+
expect(el.validity.valid).to.be.true;
|
|
387
|
+
});
|
|
388
|
+
// === FORM INTEGRATION ===
|
|
389
|
+
it('74. should return null getForm when not in a form', async () => {
|
|
390
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
391
|
+
expect(el.getForm()).to.be.null;
|
|
392
|
+
});
|
|
393
|
+
it('75. should set formAction property', async () => {
|
|
394
|
+
const el = await fixture(html `<nile-button formaction="/submit"></nile-button>`);
|
|
395
|
+
expect(el.formAction).to.equal('/submit');
|
|
396
|
+
});
|
|
397
|
+
it('76. should set formMethod property', async () => {
|
|
398
|
+
const el = await fixture(html `<nile-button formmethod="post"></nile-button>`);
|
|
399
|
+
expect(el.formMethod).to.equal('post');
|
|
400
|
+
});
|
|
401
|
+
it('77. should set formNoValidate property', async () => {
|
|
402
|
+
const el = await fixture(html `<nile-button formnovalidate></nile-button>`);
|
|
403
|
+
expect(el.formNoValidate).to.be.true;
|
|
404
|
+
});
|
|
405
|
+
it('78. should set formTarget property', async () => {
|
|
406
|
+
const el = await fixture(html `<nile-button formtarget="_blank"></nile-button>`);
|
|
407
|
+
expect(el.formTarget).to.equal('_blank');
|
|
408
|
+
});
|
|
409
|
+
it('79. should set formEnctype property', async () => {
|
|
410
|
+
const el = await fixture(html `<nile-button formenctype="multipart/form-data"></nile-button>`);
|
|
411
|
+
expect(el.formEnctype).to.equal('multipart/form-data');
|
|
412
|
+
});
|
|
413
|
+
// === HIDE BORDER ===
|
|
414
|
+
it('80. should apply hideborder class when hide-border is set', async () => {
|
|
415
|
+
const el = await fixture(html `<nile-button hide-border></nile-button>`);
|
|
416
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
417
|
+
expect(button.classList.contains('button--hideborder')).to.be.true;
|
|
418
|
+
});
|
|
419
|
+
it('81. should reflect hide-border attribute', async () => {
|
|
420
|
+
const el = await fixture(html `<nile-button hide-border></nile-button>`);
|
|
421
|
+
expect(el.hasAttribute('hide-border')).to.be.true;
|
|
422
|
+
});
|
|
423
|
+
// === TITLE ===
|
|
424
|
+
it('82. should set title on internal button', async () => {
|
|
425
|
+
const el = await fixture(html `<nile-button title="My Title"></nile-button>`);
|
|
426
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
427
|
+
expect(button.getAttribute('title')).to.equal('My Title');
|
|
428
|
+
});
|
|
429
|
+
// === DYNAMIC PROPERTY CHANGES ===
|
|
430
|
+
it('83. should update variant dynamically', async () => {
|
|
431
|
+
const el = await fixture(html `<nile-button variant="primary"></nile-button>`);
|
|
432
|
+
el.variant = 'secondary';
|
|
433
|
+
await el.updateComplete;
|
|
434
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
435
|
+
expect(button.classList.contains('button--secondary')).to.be.true;
|
|
436
|
+
});
|
|
437
|
+
it('84. should update disabled dynamically', async () => {
|
|
438
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
439
|
+
el.disabled = true;
|
|
440
|
+
await el.updateComplete;
|
|
441
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
442
|
+
expect(button.hasAttribute('disabled')).to.be.true;
|
|
443
|
+
});
|
|
444
|
+
it('85. should update loading dynamically', async () => {
|
|
445
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
446
|
+
el.loading = true;
|
|
447
|
+
await el.updateComplete;
|
|
448
|
+
const spinner = el.shadowRoot.querySelector('nile-spinner');
|
|
449
|
+
expect(spinner).to.exist;
|
|
450
|
+
});
|
|
451
|
+
it('86. should update caret dynamically', async () => {
|
|
452
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
453
|
+
el.caret = true;
|
|
454
|
+
await el.updateComplete;
|
|
455
|
+
const caret = el.shadowRoot.querySelector('nile-icon[part="caret"]');
|
|
456
|
+
expect(caret).to.exist;
|
|
457
|
+
});
|
|
458
|
+
it('87. should update pill dynamically', async () => {
|
|
459
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
460
|
+
el.pill = true;
|
|
461
|
+
await el.updateComplete;
|
|
462
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
463
|
+
expect(button.classList.contains('button--pill')).to.be.true;
|
|
464
|
+
});
|
|
465
|
+
it('88. should update circle dynamically', async () => {
|
|
466
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
467
|
+
el.circle = true;
|
|
468
|
+
await el.updateComplete;
|
|
469
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
470
|
+
expect(button.classList.contains('button--circle')).to.be.true;
|
|
471
|
+
});
|
|
472
|
+
it('89. should update outline dynamically', async () => {
|
|
473
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
474
|
+
el.outline = true;
|
|
475
|
+
await el.updateComplete;
|
|
476
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
477
|
+
expect(button.classList.contains('button--outline')).to.be.true;
|
|
478
|
+
});
|
|
479
|
+
it('90. should switch from button to anchor when href is set dynamically', async () => {
|
|
480
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
481
|
+
el.href = 'https://example.com';
|
|
482
|
+
await el.updateComplete;
|
|
483
|
+
const anchor = el.shadowRoot.querySelector('.button');
|
|
484
|
+
expect(anchor.tagName).to.equal('A');
|
|
485
|
+
});
|
|
486
|
+
// === CSS PARTS ===
|
|
487
|
+
it('91. should have base part on button', async () => {
|
|
488
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
489
|
+
const button = el.shadowRoot.querySelector('[part~="base"]');
|
|
490
|
+
expect(button).to.exist;
|
|
491
|
+
});
|
|
492
|
+
it('92. should have prefix part', async () => {
|
|
493
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
494
|
+
const prefix = el.shadowRoot.querySelector('[part~="prefix"]');
|
|
495
|
+
expect(prefix).to.exist;
|
|
496
|
+
});
|
|
497
|
+
it('93. should have label part', async () => {
|
|
498
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
499
|
+
const label = el.shadowRoot.querySelector('[part~="label"]');
|
|
500
|
+
expect(label).to.exist;
|
|
501
|
+
});
|
|
502
|
+
it('94. should have suffix part', async () => {
|
|
503
|
+
const el = await fixture(html `<nile-button></nile-button>`);
|
|
504
|
+
const suffix = el.shadowRoot.querySelector('[part~="suffix"]');
|
|
505
|
+
expect(suffix).to.exist;
|
|
506
|
+
});
|
|
507
|
+
it('95. should have caret part when caret is set', async () => {
|
|
508
|
+
const el = await fixture(html `<nile-button caret></nile-button>`);
|
|
509
|
+
const caret = el.shadowRoot.querySelector('[part~="caret"]');
|
|
510
|
+
expect(caret).to.exist;
|
|
511
|
+
});
|
|
512
|
+
// === COMBINED STATES ===
|
|
513
|
+
it('96. should handle disabled and loading together', async () => {
|
|
514
|
+
const el = await fixture(html `<nile-button disabled loading></nile-button>`);
|
|
515
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
516
|
+
expect(button.classList.contains('button--disabled')).to.be.true;
|
|
517
|
+
expect(button.classList.contains('button--loading')).to.be.true;
|
|
518
|
+
});
|
|
519
|
+
it('97. should handle pill and outline together', async () => {
|
|
520
|
+
const el = await fixture(html `<nile-button pill outline></nile-button>`);
|
|
521
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
522
|
+
expect(button.classList.contains('button--pill')).to.be.true;
|
|
523
|
+
expect(button.classList.contains('button--outline')).to.be.true;
|
|
524
|
+
});
|
|
525
|
+
it('98. should show caret on link button', async () => {
|
|
526
|
+
const el = await fixture(html `<nile-button href="https://example.com" caret></nile-button>`);
|
|
527
|
+
const caret = el.shadowRoot.querySelector('nile-icon[part="caret"]');
|
|
528
|
+
expect(caret).to.exist;
|
|
529
|
+
});
|
|
530
|
+
it('99. should show spinner on link button when loading', async () => {
|
|
531
|
+
const el = await fixture(html `<nile-button href="https://example.com" loading></nile-button>`);
|
|
532
|
+
const spinner = el.shadowRoot.querySelector('nile-spinner');
|
|
533
|
+
expect(spinner).to.exist;
|
|
534
|
+
});
|
|
535
|
+
it('100. should handle all visual modifiers simultaneously', async () => {
|
|
536
|
+
const el = await fixture(html `<nile-button variant="destructive" pill outline caret loading disabled></nile-button>`);
|
|
537
|
+
const button = el.shadowRoot.querySelector('.button');
|
|
538
|
+
expect(button.classList.contains('button--destructive')).to.be.true;
|
|
539
|
+
expect(button.classList.contains('button--pill')).to.be.true;
|
|
540
|
+
expect(button.classList.contains('button--outline')).to.be.true;
|
|
541
|
+
expect(button.classList.contains('button--caret')).to.be.true;
|
|
542
|
+
expect(button.classList.contains('button--loading')).to.be.true;
|
|
543
|
+
expect(button.classList.contains('button--disabled')).to.be.true;
|
|
544
|
+
});
|
|
85
545
|
});
|
|
86
546
|
//# sourceMappingURL=nile-button.test.js.map
|