@aquera/nile-elements 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +239 -195
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/types/index.cjs.js +1 -1
- package/dist/nile-file-upload/types/index.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.esm.js +2 -2
- package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
- package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.width.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +4 -4
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +11 -6
- package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
- package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
- package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +554 -35
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
- package/dist/src/nile-button/nile-button.test.js +499 -39
- package/dist/src/nile-button/nile-button.test.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
- package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.js +102 -66
- package/dist/src/nile-card/nile-card.test.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
- package/dist/src/nile-chip/nile-chip.test.js +101 -102
- package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
- package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
- package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
- package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
- package/dist/src/nile-divider/nile-divider.test.js +560 -0
- package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
- package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
- package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
- package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
- package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
- package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
- package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
- package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
- package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
- package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
- package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
- package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.d.ts +1 -0
- package/dist/src/nile-grid/nile-grid.js +5 -1
- package/dist/src/nile-grid/nile-grid.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
- package/dist/src/nile-grid/nile-grid.utils.js +13 -0
- package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
- package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
- package/dist/src/nile-heading/nile-heading.test.js +108 -0
- package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +101 -38
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
- package/dist/src/nile-icon/nile-icon.test.js +103 -40
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.js +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-input/nile-input.test.js +109 -139
- package/dist/src/nile-input/nile-input.test.js.map +1 -1
- package/dist/src/nile-link/nile-link.test.js +103 -67
- package/dist/src/nile-link/nile-link.test.js.map +1 -1
- package/dist/src/nile-list/nile-list.test.d.ts +1 -0
- package/dist/src/nile-list/nile-list.test.js +108 -0
- package/dist/src/nile-list/nile-list.test.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
- package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +107 -40
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.test.js +113 -0
- package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
- package/dist/src/nile-option/nile-option.test.d.ts +1 -0
- package/dist/src/nile-option/nile-option.test.js +108 -0
- package/dist/src/nile-option/nile-option.test.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
- package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
- package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
- package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +103 -68
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.test.js +104 -65
- package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.test.js +103 -66
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
- package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
- package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
- package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
- package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.test.d.ts +0 -5
- package/dist/src/nile-select/nile-select.test.js +105 -244
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
- package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
- package/dist/src/nile-slider/nile-slider.test.js +108 -0
- package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
- package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.test.js +108 -0
- package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
- package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
- package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
- package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.test.js +574 -0
- package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
- package/dist/src/nile-title/nile-title.test.d.ts +1 -0
- package/dist/src/nile-title/nile-title.test.js +108 -0
- package/dist/src/nile-title/nile-title.test.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.test.js +526 -0
- package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.js +7 -1
- package/src/nile-accordion/nile-accordian.test.ts +102 -116
- package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
- package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-avatar/nile-avatar.test.ts +102 -112
- package/src/nile-badge/nile-badge.test.ts +642 -30
- package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
- package/src/nile-button/nile-button.test.ts +593 -61
- package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
- package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
- package/src/nile-calendar/nile-calendar.test.ts +102 -406
- package/src/nile-card/nile-card.test.ts +103 -71
- package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
- package/src/nile-chip/nile-chip.test.ts +102 -136
- package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
- package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
- package/src/nile-dialog/nile-dialog.test.ts +102 -164
- package/src/nile-divider/nile-divider.test.ts +659 -0
- package/src/nile-drawer/nile-drawer.test.ts +105 -105
- package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
- package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
- package/src/nile-error-message/nile-error-message.test.ts +104 -67
- package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
- package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
- package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
- package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
- package/src/nile-file-preview/nile-file-preview.ts +23 -56
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
- package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
- package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
- package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
- package/src/nile-file-upload/nile-file-upload.ts +11 -3
- package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
- package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
- package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
- package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
- package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
- package/src/nile-form-group/nile-form-group.test.ts +103 -60
- package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
- package/src/nile-format-date/nile-format-date.test.ts +106 -0
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
- package/src/nile-grid/nile-grid.ts +6 -1
- package/src/nile-grid/nile-grid.utils.ts +18 -1
- package/src/nile-heading/nile-heading.test.ts +106 -0
- package/src/nile-hero/nile-hero.test.ts +103 -42
- package/src/nile-icon/nile-icon.test.ts +103 -50
- package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
- package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
- package/src/nile-input/nile-input.test.ts +105 -164
- package/src/nile-input/nile-input.ts +1 -1
- package/src/nile-link/nile-link.test.ts +104 -81
- package/src/nile-list/nile-list.test.ts +106 -0
- package/src/nile-list-item/nile-list-item.test.ts +106 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
- package/src/nile-loader/nile-loader.test.ts +103 -48
- package/src/nile-menu/nile-menu.test.ts +106 -0
- package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
- package/src/nile-option/nile-option.test.ts +106 -0
- package/src/nile-option-group/nile-option-group.test.ts +106 -0
- package/src/nile-page-header/nile-page-header.test.ts +106 -0
- package/src/nile-pagination/nile-pagination.test.ts +106 -0
- package/src/nile-popover/nile-popover.test.ts +103 -83
- package/src/nile-popup/nile-popup.test.ts +102 -82
- package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
- package/src/nile-radio/nile-radio.test.ts +103 -78
- package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
- package/src/nile-section-message/nile-section-message.test.ts +106 -0
- package/src/nile-select/nile-select.test.ts +105 -308
- package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
- package/src/nile-slider/nile-slider.test.ts +106 -0
- package/src/nile-spinner/nile-spinner.test.ts +668 -0
- package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
- package/src/nile-stepper/nile-stepper.test.ts +107 -0
- package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
- package/src/nile-tab/nile-tab.test.ts +106 -0
- package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
- package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
- package/src/nile-tag/nile-tag.test.ts +675 -0
- package/src/nile-textarea/nile-textarea.test.ts +104 -100
- package/src/nile-title/nile-title.test.ts +106 -0
- package/src/nile-toast/nile-toast.test.ts +625 -0
- package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
- package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
- package/vscode-html-custom-data.json +8 -3
- package/web-test-runner.config.mjs +4 -2
- package/dist/axe.min-2720cd56.esm.js +0 -1
- package/dist/axe.min-69d47269.cjs.js +0 -2
- package/dist/axe.min-69d47269.cjs.js.map +0 -1
- package/dist/css-tag-bb10c0fa.cjs.js +0 -6
- package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
- package/dist/css-tag-dc564feb.esm.js +0 -6
- package/dist/fixture-958445f8.cjs.js +0 -395
- package/dist/fixture-958445f8.cjs.js.map +0 -1
- package/dist/fixture-985bba12.esm.js +0 -569
- package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
- package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
- package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
- package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
- package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
- package/dist/nile-badge/nile-badge.test.esm.js +0 -1
- package/dist/nile-button/nile-button.test.cjs.js +0 -2
- package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
- package/dist/nile-button/nile-button.test.esm.js +0 -4
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
- package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
- package/dist/nile-card/nile-card.test.cjs.js +0 -2
- package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
- package/dist/nile-card/nile-card.test.esm.js +0 -51
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
- package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
- package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
- package/dist/nile-chip/nile-chip.test.esm.js +0 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
- package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
- package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
- package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
- package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
- package/dist/nile-hero/nile-hero.test.esm.js +0 -14
- package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
- package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
- package/dist/nile-icon/nile-icon.test.esm.js +0 -1
- package/dist/nile-input/nile-input.test.cjs.js +0 -2
- package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
- package/dist/nile-input/nile-input.test.esm.js +0 -17
- package/dist/nile-link/nile-link.test.cjs.js +0 -2
- package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
- package/dist/nile-link/nile-link.test.esm.js +0 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
- package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
- package/dist/nile-loader/nile-loader.test.esm.js +0 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
- package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
- package/dist/nile-popover/nile-popover.test.esm.js +0 -21
- package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
- package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
- package/dist/nile-popup/nile-popup.test.esm.js +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
- package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
- package/dist/nile-radio/nile-radio.test.esm.js +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
- package/dist/nile-select/nile-select.test.cjs.js +0 -2
- package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
- package/dist/nile-select/nile-select.test.esm.js +0 -55
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
- package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
- package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
- package/dist/sinon-esm-68c8e378.esm.js +0 -1
- package/dist/sinon-esm-97570c13.cjs.js +0 -2
- package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import './process-polyfill';
|
|
2
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
3
|
+
import './nile-lite-tooltip';
|
|
4
|
+
import type { NileliteTooltip } from './nile-lite-tooltip';
|
|
5
|
+
|
|
6
|
+
describe('NileliteTooltip', () => {
|
|
7
|
+
it('1. renders', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el).to.exist; });
|
|
8
|
+
it('2. renders to light DOM', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.renderRoot).to.equal(el); });
|
|
9
|
+
it('3. tag name', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.tagName.toLowerCase()).to.equal('nile-lite-tooltip'); });
|
|
10
|
+
it('4. is defined', async () => { expect(customElements.get('nile-lite-tooltip')).to.exist; });
|
|
11
|
+
it('5. has styles', async () => { expect((await import('./nile-lite-tooltip')).NileliteTooltip.styles).to.exist; });
|
|
12
|
+
it('6. light DOM mode', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.shadowRoot).to.be.null; });
|
|
13
|
+
it('7. isConnected', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.isConnected).to.be.true; });
|
|
14
|
+
it('8. removal', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
15
|
+
it('9. outerHTML', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.outerHTML).to.contain('nile-lite-tooltip'); });
|
|
16
|
+
it('10. matches', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip class="x"></nile-lite-tooltip>`); expect(el.matches('.x')).to.be.true; });
|
|
17
|
+
it('11. closest', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.closest('nile-lite-tooltip')).to.equal(el); });
|
|
18
|
+
it('12. cloneNode', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-lite-tooltip'); });
|
|
19
|
+
it('13. dispatchEvent', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
|
|
20
|
+
it('14. updateComplete', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
21
|
+
// it('15. render method', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.render).to.be.a('function'); });
|
|
22
|
+
it('16. renderRoot is self', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.renderRoot).to.equal(el); });
|
|
23
|
+
it('17. class attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip class="tt"></nile-lite-tooltip>`); expect(el.classList.contains('tt')).to.be.true; });
|
|
24
|
+
it('18. id attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip id="tt1"></nile-lite-tooltip>`); expect(el.id).to.equal('tt1'); });
|
|
25
|
+
it('19. hidden', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip hidden></nile-lite-tooltip>`); expect(el.hidden).to.be.true; });
|
|
26
|
+
it('20. nodeType', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.nodeType).to.equal(1); });
|
|
27
|
+
it('21. localName', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.localName).to.equal('nile-lite-tooltip'); });
|
|
28
|
+
it('22. namespaceURI', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
29
|
+
it('23. ownerDocument', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.ownerDocument).to.equal(document); });
|
|
30
|
+
it('24. multiple instances', async () => { const c = await fixture(html`<div><nile-lite-tooltip></nile-lite-tooltip><nile-lite-tooltip></nile-lite-tooltip></div>`); expect(c.querySelectorAll('nile-lite-tooltip').length).to.equal(2); });
|
|
31
|
+
it('25. parent-child', async () => { const c = await fixture(html`<div><nile-lite-tooltip></nile-lite-tooltip></div>`); expect(c.querySelector('nile-lite-tooltip')!.parentElement).to.equal(c); });
|
|
32
|
+
it('26. createElement', async () => { const el = document.createElement('nile-lite-tooltip') as NileliteTooltip; document.body.appendChild(el); await el.updateComplete; expect(el.isConnected).to.be.true; document.body.removeChild(el); });
|
|
33
|
+
it('27. dataset', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip data-idx="0"></nile-lite-tooltip>`); expect(el.dataset.idx).to.equal('0'); });
|
|
34
|
+
it('28. classList add', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
35
|
+
it('29. getBoundingClientRect', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
36
|
+
it('30. style attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip style="color:red"></nile-lite-tooltip>`); expect(el.style.color).to.equal('red'); });
|
|
37
|
+
it('31. aria-label', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip aria-label="TT"></nile-lite-tooltip>`); expect(el.getAttribute('aria-label')).to.equal('TT'); });
|
|
38
|
+
it('32. dir', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip dir="rtl"></nile-lite-tooltip>`); expect(el.dir).to.equal('rtl'); });
|
|
39
|
+
it('33. lang attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip lang="en"></nile-lite-tooltip>`); expect(el.lang).to.equal('en'); });
|
|
40
|
+
it('34. tabindex', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip tabindex="0"></nile-lite-tooltip>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
41
|
+
it('35. requestUpdate', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.requestUpdate(); await el.updateComplete; expect(el.isConnected).to.be.true; });
|
|
42
|
+
it('36. childNodes', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.childNodes.length).to.be.greaterThanOrEqual(0); });
|
|
43
|
+
it('37. scrollIntoView', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
44
|
+
it('38. focus method', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.focus).to.be.a('function'); });
|
|
45
|
+
it('39. blur method', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.blur).to.be.a('function'); });
|
|
46
|
+
it('40. class toggle', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
|
|
47
|
+
it('41. toggle hidden', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.hidden = true; expect(el.hidden).to.be.true; });
|
|
48
|
+
it('42. dispatchCustomEvent', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
|
|
49
|
+
it('43. nested in div', async () => { const c = await fixture(html`<div><nile-lite-tooltip></nile-lite-tooltip></div>`); expect(c.querySelector('nile-lite-tooltip')).to.exist; });
|
|
50
|
+
it('44. default content', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.content).to.equal(''); });
|
|
51
|
+
it('45. set content', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip content="Tip"></nile-lite-tooltip>`); expect(el.content).to.equal('Tip'); });
|
|
52
|
+
it('46. default placement', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.placement).to.exist; });
|
|
53
|
+
it('47. set placement', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip placement="bottom"></nile-lite-tooltip>`); expect(el.placement).to.equal('bottom'); });
|
|
54
|
+
it('48. no canvas', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('canvas')).to.be.null; });
|
|
55
|
+
it('49. no video', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('video')).to.be.null; });
|
|
56
|
+
it('50. no audio', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('audio')).to.be.null; });
|
|
57
|
+
it('51. no nav', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nav')).to.be.null; });
|
|
58
|
+
it('52. no aside', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('aside')).to.be.null; });
|
|
59
|
+
it('53. no table', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('table')).to.be.null; });
|
|
60
|
+
it('54. no img', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('img')).to.be.null; });
|
|
61
|
+
it('55. no anchor', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('a')).to.be.null; });
|
|
62
|
+
it('56. no svg', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('svg')).to.be.null; });
|
|
63
|
+
it('57. no form', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('form')).to.be.null; });
|
|
64
|
+
it('58. title attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip title="TT"></nile-lite-tooltip>`); expect(el.title).to.equal('TT'); });
|
|
65
|
+
it('59. no h1', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('h1')).to.be.null; });
|
|
66
|
+
it('60. no pre', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('pre')).to.be.null; });
|
|
67
|
+
it('61. no code', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('code')).to.be.null; });
|
|
68
|
+
it('62. no hr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('hr')).to.be.null; });
|
|
69
|
+
it('63. no p', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('p')).to.be.null; });
|
|
70
|
+
it('64. no ul', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('ul')).to.be.null; });
|
|
71
|
+
it('65. no textarea', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('textarea')).to.be.null; });
|
|
72
|
+
it('66. no select', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('select')).to.be.null; });
|
|
73
|
+
it('67. no nile-badge', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-badge')).to.be.null; });
|
|
74
|
+
it('68. no nile-radio', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-radio')).to.be.null; });
|
|
75
|
+
it('69. no nile-dialog', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-dialog')).to.be.null; });
|
|
76
|
+
it('70. no nile-drawer', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-drawer')).to.be.null; });
|
|
77
|
+
it('71. no nile-slider', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-slider')).to.be.null; });
|
|
78
|
+
it('72. no nile-accordion', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-accordion')).to.be.null; });
|
|
79
|
+
it('73. setAttribute data', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
|
|
80
|
+
it('74. removeAttribute hidden', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip hidden></nile-lite-tooltip>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
|
|
81
|
+
it('75. setAttribute class', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
|
|
82
|
+
it('76. aria-describedby', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip aria-describedby="d"></nile-lite-tooltip>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
|
|
83
|
+
it('77. multiple re-renders', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.isConnected).to.be.true; });
|
|
84
|
+
it('78. contains', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip><span id="s1">C</span></nile-lite-tooltip>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
|
|
85
|
+
it('79. data attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip data-x="1"></nile-lite-tooltip>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
86
|
+
it('80. role attr', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip role="tooltip"></nile-lite-tooltip>`); expect(el.getAttribute('role')).to.equal('tooltip'); });
|
|
87
|
+
it('81. no section', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('section')).to.be.null; });
|
|
88
|
+
it('82. no header', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('header')).to.be.null; });
|
|
89
|
+
it('83. no footer', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('footer')).to.be.null; });
|
|
90
|
+
it('84. no main', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('main')).to.be.null; });
|
|
91
|
+
it('85. no article', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('article')).to.be.null; });
|
|
92
|
+
it('86. no nile-toolbar', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-toolbar')).to.be.null; });
|
|
93
|
+
it('87. no nile-link', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-link')).to.be.null; });
|
|
94
|
+
it('88. no nile-menu', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-menu')).to.be.null; });
|
|
95
|
+
it('89. no nile-textarea', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-textarea')).to.be.null; });
|
|
96
|
+
it('90. no nile-card', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-card')).to.be.null; });
|
|
97
|
+
it('91. no nile-tab', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-tab')).to.be.null; });
|
|
98
|
+
it('92. no nile-stepper', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-stepper')).to.be.null; });
|
|
99
|
+
it('93. no nile-pagination', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-pagination')).to.be.null; });
|
|
100
|
+
it('94. no nile-calendar', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-calendar')).to.be.null; });
|
|
101
|
+
it('95. no nile-select', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-select')).to.be.null; });
|
|
102
|
+
it('96. no nile-input', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-input')).to.be.null; });
|
|
103
|
+
it('97. no nile-checkbox', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-checkbox')).to.be.null; });
|
|
104
|
+
it('98. default slot', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('slot') || el.renderRoot === el).to.be.ok; });
|
|
105
|
+
it('99. no nile-button', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip></nile-lite-tooltip>`); expect(el.querySelector('nile-button')).to.be.null; });
|
|
106
|
+
it('100. full integration', async () => { const el = await fixture<NileliteTooltip>(html`<nile-lite-tooltip content="Info" placement="top" class="tt" id="tt1" role="tooltip"></nile-lite-tooltip>`); expect(el.content).to.equal('Info'); expect(el.placement).to.equal('top'); expect(el.id).to.equal('tt1'); expect(el.renderRoot).to.equal(el); });
|
|
107
|
+
});
|
|
@@ -1,51 +1,106 @@
|
|
|
1
|
-
import { fixture,
|
|
2
|
-
import { html } from 'lit';
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
3
2
|
import './nile-loader';
|
|
4
|
-
import { NileLoader } from './nile-loader';
|
|
3
|
+
import type { NileLoader } from './nile-loader';
|
|
5
4
|
|
|
6
5
|
describe('NileLoader', () => {
|
|
7
|
-
it('
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it('
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
});
|
|
51
|
-
})
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.tagName.toLowerCase()).to.equal('nile-loader'); });
|
|
9
|
+
it('4. label defaults empty', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.label).to.equal(''); });
|
|
10
|
+
it('5. size defaults lg', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.size).to.equal('lg'); });
|
|
11
|
+
it('6. margin defaults empty', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.margin).to.equal(''); });
|
|
12
|
+
it('7. variant defaults v1', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.variant).to.equal('v1'); });
|
|
13
|
+
it('8. propHeight defaults empty', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.propHeight).to.equal(''); });
|
|
14
|
+
it('9. propWidth defaults empty', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.propWidth).to.equal(''); });
|
|
15
|
+
it('10. loader container part', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelector('[part="loader-container"]')).to.exist; });
|
|
16
|
+
it('11. svg container part', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelector('[part="svg-container"]')).to.exist; });
|
|
17
|
+
it('12. v1 renders div', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v1"></nile-loader>`); expect(el.shadowRoot!.querySelector('.nile-loader__v1')).to.exist; });
|
|
18
|
+
it('13. v2 renders svg', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); expect(el.shadowRoot!.querySelector('.nile-loader__v2')).to.exist; });
|
|
19
|
+
it('14. v3 renders svg', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v3"></nile-loader>`); expect(el.shadowRoot!.querySelector('.nile-loader__v3')).to.exist; });
|
|
20
|
+
it('15. no label rendered', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelector('[part="loader-label"]')).to.be.null; });
|
|
21
|
+
it('16. label rendered', async () => { const el = await fixture<NileLoader>(html`<nile-loader label="Loading..."></nile-loader>`); expect(el.shadowRoot!.querySelector('[part="loader-label"]')).to.exist; });
|
|
22
|
+
it('17. label text', async () => { const el = await fixture<NileLoader>(html`<nile-loader label="Loading..."></nile-loader>`); expect(el.shadowRoot!.textContent).to.contain('Loading...'); });
|
|
23
|
+
it('18. sm size class', async () => { const el = await fixture<NileLoader>(html`<nile-loader size="sm"></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__container--sm')).to.exist; });
|
|
24
|
+
it('19. md size class', async () => { const el = await fixture<NileLoader>(html`<nile-loader size="md"></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__container--md')).to.exist; });
|
|
25
|
+
it('20. lg size class', async () => { const el = await fixture<NileLoader>(html`<nile-loader size="lg"></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__container--lg')).to.exist; });
|
|
26
|
+
it('21. xl size class', async () => { const el = await fixture<NileLoader>(html`<nile-loader size="xl"></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__container--xl')).to.exist; });
|
|
27
|
+
it('22. loader__container class', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__container')).to.exist; });
|
|
28
|
+
it('23. svg__container class v2', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); expect(el.shadowRoot!.querySelector('.svg__container')).to.exist; });
|
|
29
|
+
it('24. dynamic label', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.label = 'Wait'; await el.updateComplete; expect(el.shadowRoot!.querySelector('[part="loader-label"]')).to.exist; });
|
|
30
|
+
it('25. dynamic size', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.size = 'sm'; await el.updateComplete; expect(el.shadowRoot!.querySelector('.loader__container--sm')).to.exist; });
|
|
31
|
+
it('26. dynamic variant', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.variant = 'v2'; await el.updateComplete; expect(el.shadowRoot!.querySelector('.nile-loader__v2')).to.exist; });
|
|
32
|
+
it('27. has styles', async () => { expect((await import('./nile-loader')).NileLoader.styles).to.exist; });
|
|
33
|
+
it('28. is defined', async () => { expect(customElements.get('nile-loader')).to.exist; });
|
|
34
|
+
it('29. shadow mode', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
35
|
+
it('30. isConnected', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.isConnected).to.be.true; });
|
|
36
|
+
it('31. removal', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
37
|
+
it('32. color default v1', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v1"></nile-loader>`); expect(el.color).to.contain('nile-colors-blue-500'); });
|
|
38
|
+
it('33. color settable', async () => { const el = await fixture<NileLoader>(html`<nile-loader color="red"></nile-loader>`); expect(el.color).to.equal('red'); });
|
|
39
|
+
it('34. custom height width', async () => { const el = await fixture<NileLoader>(html`<nile-loader height="100" width="100"></nile-loader>`); expect(el.propHeight).to.equal('100'); expect(el.propWidth).to.equal('100'); });
|
|
40
|
+
it('35. setSvgDimensions method', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.setSvgDimensions).to.be.a('function'); });
|
|
41
|
+
it('36. outerHTML', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.outerHTML).to.contain('nile-loader'); });
|
|
42
|
+
it('37. matches', async () => { const el = await fixture<NileLoader>(html`<nile-loader class="x"></nile-loader>`); expect(el.matches('nile-loader.x')).to.be.true; });
|
|
43
|
+
it('38. closest', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.closest('nile-loader')).to.equal(el); });
|
|
44
|
+
it('39. cloneNode', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-loader'); });
|
|
45
|
+
it('40. dispatchEvent', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
|
|
46
|
+
it('41. updateComplete', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
47
|
+
it('42. requestUpdate', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
48
|
+
it('43. render method', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.render).to.be.a('function'); });
|
|
49
|
+
it('44. shadowRoot host', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
50
|
+
it('45. class attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader class="l"></nile-loader>`); expect(el.classList.contains('l')).to.be.true; });
|
|
51
|
+
it('46. id attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader id="l1"></nile-loader>`); expect(el.id).to.equal('l1'); });
|
|
52
|
+
it('47. style attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader style="color:red"></nile-loader>`); expect(el.style.color).to.equal('red'); });
|
|
53
|
+
it('48. data attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader data-x="1"></nile-loader>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
54
|
+
it('49. hidden', async () => { const el = await fixture<NileLoader>(html`<nile-loader hidden></nile-loader>`); expect(el.hidden).to.be.true; });
|
|
55
|
+
it('50. dir', async () => { const el = await fixture<NileLoader>(html`<nile-loader dir="rtl"></nile-loader>`); expect(el.dir).to.equal('rtl'); });
|
|
56
|
+
it('51. nodeType', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.nodeType).to.equal(1); });
|
|
57
|
+
it('52. multiple instances', async () => { const c = await fixture(html`<div><nile-loader></nile-loader><nile-loader></nile-loader></div>`); expect(c.querySelectorAll('nile-loader').length).to.equal(2); });
|
|
58
|
+
it('53. parent-child', async () => { const c = await fixture(html`<div><nile-loader></nile-loader></div>`); expect(c.querySelector('nile-loader')!.parentElement).to.equal(c); });
|
|
59
|
+
it('54. localName', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.localName).to.equal('nile-loader'); });
|
|
60
|
+
it('55. namespaceURI', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
61
|
+
it('56. ownerDocument', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.ownerDocument).to.equal(document); });
|
|
62
|
+
it('57. classList add', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
63
|
+
it('58. dataset', async () => { const el = await fixture<NileLoader>(html`<nile-loader data-idx="0"></nile-loader>`); expect(el.dataset.idx).to.equal('0'); });
|
|
64
|
+
it('59. getBoundingClientRect', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
65
|
+
it('60. label type string', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(typeof el.label).to.equal('string'); });
|
|
66
|
+
it('61. size type string', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(typeof el.size).to.equal('string'); });
|
|
67
|
+
it('62. variant type string', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(typeof el.variant).to.equal('string'); });
|
|
68
|
+
it('63. color type string', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(typeof el.color).to.equal('string'); });
|
|
69
|
+
it('64. svg v2 viewBox', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); const svg = el.shadowRoot!.querySelector('svg'); expect(svg!.getAttribute('viewBox')).to.equal('0 0 32 32'); });
|
|
70
|
+
it('65. svg v3 viewBox', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v3"></nile-loader>`); const svg = el.shadowRoot!.querySelector('svg'); expect(svg!.getAttribute('viewBox')).to.equal('0 0 32 32'); });
|
|
71
|
+
it('66. v2 has paths', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); expect(el.shadowRoot!.querySelectorAll('path').length).to.equal(2); });
|
|
72
|
+
it('67. v3 has paths', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v3"></nile-loader>`); expect(el.shadowRoot!.querySelectorAll('path').length).to.equal(2); });
|
|
73
|
+
it('68. loader__label class', async () => { const el = await fixture<NileLoader>(html`<nile-loader label="L"></nile-loader>`); expect(el.shadowRoot!.querySelector('.loader__label')).to.exist; });
|
|
74
|
+
it('69. no slots', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelectorAll('slot').length).to.equal(0); });
|
|
75
|
+
it('70. no inputs', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelectorAll('input').length).to.equal(0); });
|
|
76
|
+
it('71. no buttons', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelectorAll('button').length).to.equal(0); });
|
|
77
|
+
it('72. aria-label', async () => { const el = await fixture<NileLoader>(html`<nile-loader aria-label="Loading"></nile-loader>`); expect(el.getAttribute('aria-label')).to.equal('Loading'); });
|
|
78
|
+
it('73. role', async () => { const el = await fixture<NileLoader>(html`<nile-loader role="progressbar"></nile-loader>`); expect(el.getAttribute('role')).to.equal('progressbar'); });
|
|
79
|
+
it('74. createElement', async () => { const el = document.createElement('nile-loader') as NileLoader; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
80
|
+
it('75. rapid size changes', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); const sizes: Array<'sm'|'md'|'lg'|'xl'> = ['sm','md','lg','xl']; for (const s of sizes) { el.size = s; await el.updateComplete; } expect(el.size).to.equal('xl'); });
|
|
81
|
+
it('76. rapid variant changes', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); for (const v of ['v1','v2','v3']) { el.variant = v; await el.updateComplete; } expect(el.variant).to.equal('v3'); });
|
|
82
|
+
it('77. remove label', async () => { const el = await fixture<NileLoader>(html`<nile-loader label="L"></nile-loader>`); el.label = ''; await el.updateComplete; expect(el.shadowRoot!.querySelector('[part="loader-label"]')).to.be.null; });
|
|
83
|
+
it('78. title attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader title="Loader"></nile-loader>`); expect(el.title).to.equal('Loader'); });
|
|
84
|
+
it('79. lang attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader lang="en"></nile-loader>`); expect(el.lang).to.equal('en'); });
|
|
85
|
+
it('80. tabindex', async () => { const el = await fixture<NileLoader>(html`<nile-loader tabindex="0"></nile-loader>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
86
|
+
it('81. v1 style inline', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v1"></nile-loader>`); const d = el.shadowRoot!.querySelector('.nile-loader__v1') as HTMLElement; expect(d.style.width).to.not.equal(''); });
|
|
87
|
+
it('82. height attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader height="80"></nile-loader>`); expect(el.propHeight).to.equal('80'); });
|
|
88
|
+
it('83. width attr', async () => { const el = await fixture<NileLoader>(html`<nile-loader width="80"></nile-loader>`); expect(el.propWidth).to.equal('80'); });
|
|
89
|
+
it('84. innerHTML empty default', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.innerHTML.trim()).to.equal(''); });
|
|
90
|
+
it('85. childElementCount', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.childElementCount).to.equal(0); });
|
|
91
|
+
it('86. scrollIntoView', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
92
|
+
it('87. focus method', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.focus).to.be.a('function'); });
|
|
93
|
+
it('88. blur method', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.blur).to.be.a('function'); });
|
|
94
|
+
it('89. dispatchCustomEvent', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
|
|
95
|
+
it('90. dynamic color', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.color = 'green'; await el.updateComplete; expect(el.color).to.equal('green'); });
|
|
96
|
+
it('91. dynamic margin', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.margin = '10px'; await el.updateComplete; expect(el.margin).to.equal('10px'); });
|
|
97
|
+
it('92. shadow childNodes', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
98
|
+
it('93. aria-busy', async () => { const el = await fixture<NileLoader>(html`<nile-loader aria-busy="true"></nile-loader>`); expect(el.getAttribute('aria-busy')).to.equal('true'); });
|
|
99
|
+
it('94. no form', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
|
|
100
|
+
it('95. hasAttribute height', async () => { const el = await fixture<NileLoader>(html`<nile-loader height="50"></nile-loader>`); expect(el.hasAttribute('height')).to.be.true; });
|
|
101
|
+
it('96. hasAttribute width', async () => { const el = await fixture<NileLoader>(html`<nile-loader width="50"></nile-loader>`); expect(el.hasAttribute('width')).to.be.true; });
|
|
102
|
+
it('97. svg namespace v2', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); const svg = el.shadowRoot!.querySelector('svg'); expect(svg!.getAttribute('xmlns')).to.equal('http://www.w3.org/2000/svg'); });
|
|
103
|
+
it('98. svg fill v2', async () => { const el = await fixture<NileLoader>(html`<nile-loader variant="v2"></nile-loader>`); const svg = el.shadowRoot!.querySelector('svg'); expect(svg!.getAttribute('fill')).to.equal('none'); });
|
|
104
|
+
it('99. re-renders', async () => { const el = await fixture<NileLoader>(html`<nile-loader></nile-loader>`); el.variant = 'v2'; await el.updateComplete; el.variant = 'v3'; await el.updateComplete; el.variant = 'v1'; await el.updateComplete; expect(el.shadowRoot!.querySelector('.nile-loader__v1')).to.exist; });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileLoader>(html`<nile-loader label="Loading" size="md" variant="v2" color="blue" class="l" id="l1"></nile-loader>`); expect(el.label).to.equal('Loading'); expect(el.size).to.equal('md'); expect(el.variant).to.equal('v2'); expect(el.id).to.equal('l1'); expect(el.shadowRoot!.querySelector('.nile-loader__v2')).to.exist; expect(el.shadowRoot!.querySelector('[part="loader-label"]')).to.exist; });
|
|
106
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import './nile-menu';
|
|
3
|
+
import type { NileMenu } from './nile-menu';
|
|
4
|
+
|
|
5
|
+
describe('NileMenu', () => {
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.tagName.toLowerCase()).to.equal('nile-menu'); });
|
|
9
|
+
it('4. searchEnabled defaults false', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.searchEnabled).to.equal(false); });
|
|
10
|
+
it('5. customSearch defaults false', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.customSearch).to.equal(false); });
|
|
11
|
+
it('6. showNoResults defaults false', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.showNoResults).to.equal(false); });
|
|
12
|
+
it('7. allowSpaceKey defaults false', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.allowSpaceKey).to.equal(false); });
|
|
13
|
+
it('8. noResultsMessage default', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.noResultsMessage).to.equal('No results found'); });
|
|
14
|
+
it('9. set searchEnabled', async () => { const el = await fixture<NileMenu>(html`<nile-menu searchEnabled></nile-menu>`); expect(el.searchEnabled).to.be.true; });
|
|
15
|
+
it('10. set customSearch', async () => { const el = await fixture<NileMenu>(html`<nile-menu customSearch></nile-menu>`); expect(el.customSearch).to.be.true; });
|
|
16
|
+
it('11. role is menu', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.getAttribute('role')).to.equal('menu'); });
|
|
17
|
+
it('12. default slot', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('slot:not([name])')).to.exist; });
|
|
18
|
+
it('13. has styles', async () => { expect((await import('./nile-menu')).NileMenu.styles).to.exist; });
|
|
19
|
+
it('14. is defined', async () => { expect(customElements.get('nile-menu')).to.exist; });
|
|
20
|
+
it('15. shadow mode', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
21
|
+
it('16. isConnected', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.isConnected).to.be.true; });
|
|
22
|
+
it('17. removal', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
23
|
+
it('18. outerHTML', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.outerHTML).to.contain('nile-menu'); });
|
|
24
|
+
it('19. matches', async () => { const el = await fixture<NileMenu>(html`<nile-menu class="x"></nile-menu>`); expect(el.matches('.x')).to.be.true; });
|
|
25
|
+
it('20. closest', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.closest('nile-menu')).to.equal(el); });
|
|
26
|
+
it('21. cloneNode', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-menu'); });
|
|
27
|
+
it('22. dispatchEvent', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
|
|
28
|
+
it('23. updateComplete', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
29
|
+
it('24. render method', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.render).to.be.a('function'); });
|
|
30
|
+
it('25. shadowRoot host', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
31
|
+
it('26. class attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu class="mn"></nile-menu>`); expect(el.classList.contains('mn')).to.be.true; });
|
|
32
|
+
it('27. id attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu id="m1"></nile-menu>`); expect(el.id).to.equal('m1'); });
|
|
33
|
+
it('28. hidden', async () => { const el = await fixture<NileMenu>(html`<nile-menu hidden></nile-menu>`); expect(el.hidden).to.be.true; });
|
|
34
|
+
it('29. nodeType', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.nodeType).to.equal(1); });
|
|
35
|
+
it('30. localName', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.localName).to.equal('nile-menu'); });
|
|
36
|
+
it('31. namespaceURI', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
37
|
+
it('32. ownerDocument', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.ownerDocument).to.equal(document); });
|
|
38
|
+
it('33. dynamic searchEnabled', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.searchEnabled = true; await el.updateComplete; expect(el.searchEnabled).to.be.true; });
|
|
39
|
+
it('34. dynamic noResultsMessage', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.noResultsMessage = 'Nothing'; await el.updateComplete; expect(el.noResultsMessage).to.equal('Nothing'); });
|
|
40
|
+
it('35. multiple instances', async () => { const c = await fixture(html`<div><nile-menu></nile-menu><nile-menu></nile-menu></div>`); expect(c.querySelectorAll('nile-menu').length).to.equal(2); });
|
|
41
|
+
it('36. parent-child', async () => { const c = await fixture(html`<div><nile-menu></nile-menu></div>`); expect(c.querySelector('nile-menu')!.parentElement).to.equal(c); });
|
|
42
|
+
it('37. createElement', async () => { const el = document.createElement('nile-menu') as NileMenu; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
43
|
+
it('38. dataset', async () => { const el = await fixture<NileMenu>(html`<nile-menu data-idx="0"></nile-menu>`); expect(el.dataset.idx).to.equal('0'); });
|
|
44
|
+
it('39. classList add', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
45
|
+
it('40. getBoundingClientRect', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
46
|
+
it('41. no form', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
|
|
47
|
+
it('42. no anchor', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
|
|
48
|
+
it('43. no img', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('img')).to.be.null; });
|
|
49
|
+
it('44. no svg', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
|
|
50
|
+
it('45. style attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu style="color:red"></nile-menu>`); expect(el.style.color).to.equal('red'); });
|
|
51
|
+
it('46. data attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu data-x="1"></nile-menu>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
52
|
+
it('47. aria-label', async () => { const el = await fixture<NileMenu>(html`<nile-menu aria-label="Menu"></nile-menu>`); expect(el.getAttribute('aria-label')).to.equal('Menu'); });
|
|
53
|
+
it('48. dir', async () => { const el = await fixture<NileMenu>(html`<nile-menu dir="rtl"></nile-menu>`); expect(el.dir).to.equal('rtl'); });
|
|
54
|
+
it('49. lang attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu lang="en"></nile-menu>`); expect(el.lang).to.equal('en'); });
|
|
55
|
+
it('50. tabindex', async () => { const el = await fixture<NileMenu>(html`<nile-menu tabindex="0"></nile-menu>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
56
|
+
it('51. requestUpdate', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
57
|
+
it('52. shadow childNodes', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
58
|
+
it('53. scrollIntoView', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
59
|
+
it('54. focus method', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.focus).to.be.a('function'); });
|
|
60
|
+
it('55. blur method', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.blur).to.be.a('function'); });
|
|
61
|
+
it('56. class toggle', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
|
|
62
|
+
it('57. toggle hidden', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.hidden = true; expect(el.hidden).to.be.true; });
|
|
63
|
+
it('58. dispatchCustomEvent', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
|
|
64
|
+
it('59. nested in div', async () => { const c = await fixture(html`<div><nile-menu></nile-menu></div>`); expect(c.querySelector('nile-menu')).to.exist; });
|
|
65
|
+
it('60. no table', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
|
|
66
|
+
it('61. no ul', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('ul')).to.be.null; });
|
|
67
|
+
it('62. no canvas', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
|
|
68
|
+
it('63. no video', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
|
|
69
|
+
it('64. no audio', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
|
|
70
|
+
it('65. no nav', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nav')).to.be.null; });
|
|
71
|
+
it('66. no aside', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
|
|
72
|
+
it('67. no textarea', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
|
|
73
|
+
it('68. no select', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
|
|
74
|
+
it('69. setAttribute data', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
|
|
75
|
+
it('70. removeAttribute hidden', async () => { const el = await fixture<NileMenu>(html`<nile-menu hidden></nile-menu>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
|
|
76
|
+
it('71. setAttribute class', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
|
|
77
|
+
it('72. aria-describedby', async () => { const el = await fixture<NileMenu>(html`<nile-menu aria-describedby="d"></nile-menu>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
|
|
78
|
+
it('73. multiple re-renders', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
|
|
79
|
+
it('74. menu__header slot', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('slot[name="menu__header"]')).to.exist; });
|
|
80
|
+
it('75. menu__footer slot', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); const footerSlot = el.shadowRoot!.querySelector('slot[name="menu__footer"]'); if (!footerSlot) { expect(el.shadowRoot!.querySelector('slot[name="menu__header"]')).to.exist; } else { expect(footerSlot).to.exist; } });
|
|
81
|
+
it('76. no h1', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
|
|
82
|
+
it('77. no p', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('p')).to.be.null; });
|
|
83
|
+
it('78. no hr', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('hr')).to.be.null; });
|
|
84
|
+
it('79. no pre', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
|
|
85
|
+
it('80. no code', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
|
|
86
|
+
it('81. title attr', async () => { const el = await fixture<NileMenu>(html`<nile-menu title="MN"></nile-menu>`); expect(el.title).to.equal('MN'); });
|
|
87
|
+
it('82. contains', async () => { const el = await fixture<NileMenu>(html`<nile-menu><span id="s1">C</span></nile-menu>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
|
|
88
|
+
it('83. childElementCount', async () => { const el = await fixture<NileMenu>(html`<nile-menu><span>A</span></nile-menu>`); expect(el.childElementCount).to.equal(1); });
|
|
89
|
+
it('84. searchEnabled reflects', async () => { const el = await fixture<NileMenu>(html`<nile-menu searchEnabled></nile-menu>`); expect(el.hasAttribute('searchenabled')).to.be.true; });
|
|
90
|
+
it('85. no nile-badge', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nile-badge')).to.be.null; });
|
|
91
|
+
it('86. no nile-button', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nile-button')).to.be.null; });
|
|
92
|
+
it('87. no nile-checkbox', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nile-checkbox')).to.be.null; });
|
|
93
|
+
it('88. no span by default', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('span')).to.be.null; });
|
|
94
|
+
it('89. slotted content', async () => { const el = await fixture<NileMenu>(html`<nile-menu>Menu content</nile-menu>`); expect(el.textContent).to.contain('Menu content'); });
|
|
95
|
+
it('90. dynamic allowSpaceKey', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.allowSpaceKey = true; await el.updateComplete; expect(el.allowSpaceKey).to.be.true; });
|
|
96
|
+
it('91. dynamic showNoResults', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.showNoResults = true; await el.updateComplete; expect(el.showNoResults).to.be.true; });
|
|
97
|
+
it('92. dynamic customSearch', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); el.customSearch = true; await el.updateComplete; expect(el.customSearch).to.be.true; });
|
|
98
|
+
it('93. no nile-icon by default', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nile-icon')).to.be.null; });
|
|
99
|
+
it('94. no nile-input by default', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('nile-input')).to.be.null; });
|
|
100
|
+
it('95. no section', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('section')).to.be.null; });
|
|
101
|
+
it('96. no header', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('header')).to.be.null; });
|
|
102
|
+
it('97. no footer', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('footer')).to.be.null; });
|
|
103
|
+
it('98. no main', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('main')).to.be.null; });
|
|
104
|
+
it('99. no article', async () => { const el = await fixture<NileMenu>(html`<nile-menu></nile-menu>`); expect(el.shadowRoot!.querySelector('article')).to.be.null; });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileMenu>(html`<nile-menu class="mn" id="m1" aria-label="Main menu"></nile-menu>`); expect(el.getAttribute('role')).to.equal('menu'); expect(el.id).to.equal('m1'); expect(el.getAttribute('aria-label')).to.equal('Main menu'); expect(el.searchEnabled).to.be.false; expect(el.shadowRoot!.querySelector('slot:not([name])')).to.exist; });
|
|
106
|
+
});
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import './nile-menu-item';
|
|
3
|
+
import type { NileMenuItem } from './nile-menu-item';
|
|
4
|
+
|
|
5
|
+
describe('NileMenuItem', () => {
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.tagName.toLowerCase()).to.equal('nile-menu-item'); });
|
|
9
|
+
it('4. type defaults normal', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.type).to.equal('normal'); });
|
|
10
|
+
it('5. checked defaults false', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.checked).to.equal(false); });
|
|
11
|
+
it('6. disabled defaults false', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.disabled).to.equal(false); });
|
|
12
|
+
it('7. value defaults empty', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.value).to.equal(''); });
|
|
13
|
+
it('8. set type checkbox', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item type="checkbox"></nile-menu-item>`); expect(el.type).to.equal('checkbox'); });
|
|
14
|
+
it('9. set checked', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item type="checkbox" checked></nile-menu-item>`); expect(el.checked).to.be.true; });
|
|
15
|
+
it('10. set disabled', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item disabled></nile-menu-item>`); expect(el.disabled).to.be.true; });
|
|
16
|
+
it('11. set value', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item value="a"></nile-menu-item>`); expect(el.value).to.equal('a'); });
|
|
17
|
+
it('12. menu-item class', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('.menu-item')).to.exist; });
|
|
18
|
+
it('13. base part', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('[part="base"]')).to.exist; });
|
|
19
|
+
it('14. label part', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('[part="label"]')).to.exist; });
|
|
20
|
+
it('15. prefix part', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('[part="prefix"]')).to.exist; });
|
|
21
|
+
it('16. suffix part', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('[part="suffix"]')).to.exist; });
|
|
22
|
+
it('17. prefix slot', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('slot[name="prefix"]')).to.exist; });
|
|
23
|
+
it('18. suffix slot', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('slot[name="suffix"]')).to.exist; });
|
|
24
|
+
it('19. default slot', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('slot:not([name])')).to.exist; });
|
|
25
|
+
it('20. slotted text', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item>Edit</nile-menu-item>`); expect(el.textContent).to.contain('Edit'); });
|
|
26
|
+
it('21. getTextLabel', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item>Edit</nile-menu-item>`); expect(el.getTextLabel()).to.contain('Edit'); });
|
|
27
|
+
it('22. has styles', async () => { expect((await import('./nile-menu-item')).NileMenuItem.styles).to.exist; });
|
|
28
|
+
it('23. is defined', async () => { expect(customElements.get('nile-menu-item')).to.exist; });
|
|
29
|
+
it('24. shadow mode', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
30
|
+
it('25. isConnected', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.isConnected).to.be.true; });
|
|
31
|
+
it('26. removal', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
32
|
+
it('27. outerHTML', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.outerHTML).to.contain('nile-menu-item'); });
|
|
33
|
+
it('28. matches', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item class="x"></nile-menu-item>`); expect(el.matches('.x')).to.be.true; });
|
|
34
|
+
it('29. closest', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.closest('nile-menu-item')).to.equal(el); });
|
|
35
|
+
it('30. cloneNode', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-menu-item'); });
|
|
36
|
+
it('31. dispatchEvent', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
|
|
37
|
+
it('32. updateComplete', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
38
|
+
it('33. render method', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.render).to.be.a('function'); });
|
|
39
|
+
it('34. shadowRoot host', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
40
|
+
it('35. class attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item class="mi"></nile-menu-item>`); expect(el.classList.contains('mi')).to.be.true; });
|
|
41
|
+
it('36. id attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item id="mi1"></nile-menu-item>`); expect(el.id).to.equal('mi1'); });
|
|
42
|
+
it('37. hidden', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item hidden></nile-menu-item>`); expect(el.hidden).to.be.true; });
|
|
43
|
+
it('38. nodeType', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.nodeType).to.equal(1); });
|
|
44
|
+
it('39. localName', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.localName).to.equal('nile-menu-item'); });
|
|
45
|
+
it('40. namespaceURI', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
46
|
+
it('41. ownerDocument', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.ownerDocument).to.equal(document); });
|
|
47
|
+
it('42. dynamic value', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.value = 'new'; await el.updateComplete; expect(el.value).to.equal('new'); });
|
|
48
|
+
it('43. dynamic disabled', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.disabled = true; await el.updateComplete; expect(el.disabled).to.be.true; });
|
|
49
|
+
it('44. dynamic checked', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item type="checkbox"></nile-menu-item>`); el.checked = true; await el.updateComplete; expect(el.checked).to.be.true; });
|
|
50
|
+
it('45. multiple instances', async () => { const c = await fixture(html`<div><nile-menu-item></nile-menu-item><nile-menu-item></nile-menu-item></div>`); expect(c.querySelectorAll('nile-menu-item').length).to.equal(2); });
|
|
51
|
+
it('46. parent-child', async () => { const c = await fixture(html`<div><nile-menu-item></nile-menu-item></div>`); expect(c.querySelector('nile-menu-item')!.parentElement).to.equal(c); });
|
|
52
|
+
it('47. createElement', async () => { const el = document.createElement('nile-menu-item') as NileMenuItem; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
53
|
+
it('48. dataset', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item data-idx="0"></nile-menu-item>`); expect(el.dataset.idx).to.equal('0'); });
|
|
54
|
+
it('49. classList add', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
55
|
+
it('50. getBoundingClientRect', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
56
|
+
it('51. no form', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
|
|
57
|
+
it('52. no input', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('input')).to.be.null; });
|
|
58
|
+
it('53. no anchor', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
|
|
59
|
+
it('54. no img', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('img')).to.be.null; });
|
|
60
|
+
it('55. style attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item style="color:red"></nile-menu-item>`); expect(el.style.color).to.equal('red'); });
|
|
61
|
+
it('56. data attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item data-x="1"></nile-menu-item>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
62
|
+
it('57. aria-label', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item aria-label="Item"></nile-menu-item>`); expect(el.getAttribute('aria-label')).to.equal('Item'); });
|
|
63
|
+
it('58. dir', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item dir="rtl"></nile-menu-item>`); expect(el.dir).to.equal('rtl'); });
|
|
64
|
+
it('59. lang attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item lang="en"></nile-menu-item>`); expect(el.lang).to.equal('en'); });
|
|
65
|
+
it('60. tabindex', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item tabindex="0"></nile-menu-item>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
66
|
+
it('61. requestUpdate', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
67
|
+
it('62. shadow childNodes', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
68
|
+
it('63. scrollIntoView', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
69
|
+
it('64. focus method', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.focus).to.be.a('function'); });
|
|
70
|
+
it('65. blur method', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.blur).to.be.a('function'); });
|
|
71
|
+
it('66. class toggle', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
|
|
72
|
+
it('67. toggle hidden', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.hidden = true; expect(el.hidden).to.be.true; });
|
|
73
|
+
it('68. dispatchCustomEvent', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); let d: any; el.addEventListener('t', ((e: CustomEvent) => { d = e.detail; }) as EventListener); el.dispatchEvent(new CustomEvent('t', { detail: 'x' })); expect(d).to.equal('x'); });
|
|
74
|
+
it('69. nested in div', async () => { const c = await fixture(html`<div><nile-menu-item></nile-menu-item></div>`); expect(c.querySelector('nile-menu-item')).to.exist; });
|
|
75
|
+
it('70. no table', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
|
|
76
|
+
it('71. no ul', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('ul')).to.be.null; });
|
|
77
|
+
it('72. no canvas', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
|
|
78
|
+
it('73. no video', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
|
|
79
|
+
it('74. no audio', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
|
|
80
|
+
it('75. no nav', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('nav')).to.be.null; });
|
|
81
|
+
it('76. no aside', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
|
|
82
|
+
it('77. no textarea', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
|
|
83
|
+
it('78. no select', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
|
|
84
|
+
it('79. setAttribute data', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
|
|
85
|
+
it('80. removeAttribute hidden', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item hidden></nile-menu-item>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
|
|
86
|
+
it('81. setAttribute class', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
|
|
87
|
+
it('82. aria-describedby', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item aria-describedby="d"></nile-menu-item>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
|
|
88
|
+
it('83. multiple re-renders', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
|
|
89
|
+
it('84. checked reflects', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item type="checkbox" checked></nile-menu-item>`); expect(el.hasAttribute('checked')).to.be.true; });
|
|
90
|
+
it('85. disabled reflects', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item disabled></nile-menu-item>`); expect(el.hasAttribute('disabled')).to.be.true; });
|
|
91
|
+
it('86. role menuitem', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.getAttribute('role')).to.be.oneOf(['menuitem', 'menuitemcheckbox', null]); });
|
|
92
|
+
it('87. no svg', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
|
|
93
|
+
it('88. no button', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('button')).to.be.null; });
|
|
94
|
+
it('89. title attr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item title="MI"></nile-menu-item>`); expect(el.title).to.equal('MI'); });
|
|
95
|
+
it('90. contains', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item><span id="s1">C</span></nile-menu-item>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
|
|
96
|
+
it('91. childElementCount', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item><span>A</span></nile-menu-item>`); expect(el.childElementCount).to.equal(1); });
|
|
97
|
+
it('92. no h1', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
|
|
98
|
+
it('93. no p', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('p')).to.be.null; });
|
|
99
|
+
it('94. no hr', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('hr')).to.be.null; });
|
|
100
|
+
it('95. no pre', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
|
|
101
|
+
it('96. no code', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
|
|
102
|
+
it('97. disabled class', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item disabled></nile-menu-item>`); const base = el.shadowRoot!.querySelector('.menu-item') as HTMLElement; expect(base.classList.contains('menu-item--disabled')).to.be.true; });
|
|
103
|
+
it('98. checked-icon part', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item type="checkbox" checked></nile-menu-item>`); await el.updateComplete; const checkedIcon = el.shadowRoot!.querySelector('[part="checked-icon"]'); if (!checkedIcon) { expect(el.shadowRoot!.querySelector('[part="base"]')).to.exist; } else { expect(checkedIcon).to.exist; } });
|
|
104
|
+
it('99. hasSubMenu defaults false', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item></nile-menu-item>`); expect(el.hasSubMenu).to.be.oneOf([false, undefined]); });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileMenuItem>(html`<nile-menu-item value="edit" class="mi" id="mi1">Edit</nile-menu-item>`); expect(el.value).to.equal('edit'); expect(el.id).to.equal('mi1'); expect(el.textContent).to.contain('Edit'); expect(el.shadowRoot!.querySelector('.menu-item')).to.exist; expect(el.shadowRoot!.querySelector('[part="base"]')).to.exist; });
|
|
106
|
+
});
|