@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,106 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import './nile-format-date';
|
|
3
|
+
import type { NileFormatDate } from './nile-format-date';
|
|
4
|
+
|
|
5
|
+
describe('NileFormatDate', () => {
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.tagName.toLowerCase()).to.equal('nile-format-date'); });
|
|
9
|
+
it('4. date defaults to Date', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.date).to.be.instanceOf(Date); });
|
|
10
|
+
it('5. hourFormat defaults auto', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.hourFormat).to.equal('auto'); });
|
|
11
|
+
it('6. dateSeparator defaults -', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.dateSeparator).to.equal('-'); });
|
|
12
|
+
it('7. set date string', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date date="2023-01-15"></nile-format-date>`); expect(el.date).to.exist; });
|
|
13
|
+
it('8. set hour-format 12', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date hour-format="12"></nile-format-date>`); expect(el.hourFormat).to.equal('12'); });
|
|
14
|
+
it('9. set hour-format 24', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date hour-format="24"></nile-format-date>`); expect(el.hourFormat).to.equal('24'); });
|
|
15
|
+
it('10. set date-separator /', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date date-separator="/"></nile-format-date>`); expect(el.dateSeparator).to.equal('/'); });
|
|
16
|
+
it('11. renders time element', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('time')).to.exist; });
|
|
17
|
+
it('12. time has datetime attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); const time = el.shadowRoot!.querySelector('time'); expect(time?.hasAttribute('datetime')).to.be.true; });
|
|
18
|
+
it('13. formatDate method', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.formatDate).to.be.a('function'); });
|
|
19
|
+
it('14. formatDate returns string', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.formatDate(new Date())).to.be.a('string'); });
|
|
20
|
+
it('15. set year', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date year="numeric"></nile-format-date>`); expect(el.year).to.equal('numeric'); });
|
|
21
|
+
it('16. set month', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date month="long"></nile-format-date>`); expect(el.month).to.equal('long'); });
|
|
22
|
+
it('17. set day', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date day="numeric"></nile-format-date>`); expect(el.day).to.equal('numeric'); });
|
|
23
|
+
it('18. set weekday', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date weekday="long"></nile-format-date>`); expect(el.weekday).to.equal('long'); });
|
|
24
|
+
it('19. set hour', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date hour="numeric"></nile-format-date>`); expect(el.hour).to.equal('numeric'); });
|
|
25
|
+
it('20. set minute', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date minute="numeric"></nile-format-date>`); expect(el.minute).to.equal('numeric'); });
|
|
26
|
+
it('21. set second', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date second="numeric"></nile-format-date>`); expect(el.second).to.equal('numeric'); });
|
|
27
|
+
it('22. has styles', async () => { expect((await import('./nile-format-date')).NileFormatDate.styles).to.exist; });
|
|
28
|
+
it('23. is defined', async () => { expect(customElements.get('nile-format-date')).to.exist; });
|
|
29
|
+
it('24. shadow mode', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
30
|
+
it('25. isConnected', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.isConnected).to.be.true; });
|
|
31
|
+
it('26. removal', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
32
|
+
it('27. outerHTML', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.outerHTML).to.contain('nile-format-date'); });
|
|
33
|
+
it('28. matches', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date class="x"></nile-format-date>`); expect(el.matches('.x')).to.be.true; });
|
|
34
|
+
it('29. closest', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.closest('nile-format-date')).to.equal(el); });
|
|
35
|
+
it('30. cloneNode', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-format-date'); });
|
|
36
|
+
it('31. dispatchEvent', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); 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<NileFormatDate>(html`<nile-format-date></nile-format-date>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
38
|
+
it('33. render method', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.render).to.be.a('function'); });
|
|
39
|
+
it('34. shadowRoot host', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
40
|
+
it('35. class attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date class="fd"></nile-format-date>`); expect(el.classList.contains('fd')).to.be.true; });
|
|
41
|
+
it('36. id attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date id="fd1"></nile-format-date>`); expect(el.id).to.equal('fd1'); });
|
|
42
|
+
it('37. hidden', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date hidden></nile-format-date>`); expect(el.hidden).to.be.true; });
|
|
43
|
+
it('38. nodeType', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.nodeType).to.equal(1); });
|
|
44
|
+
it('39. localName', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.localName).to.equal('nile-format-date'); });
|
|
45
|
+
it('40. namespaceURI', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
46
|
+
it('41. ownerDocument', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.ownerDocument).to.equal(document); });
|
|
47
|
+
it('42. dynamic date', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.date = '2023-06-15'; await el.updateComplete; const time = el.shadowRoot!.querySelector('time'); expect(time?.getAttribute('datetime')).to.contain('2023-06-15'); });
|
|
48
|
+
it('43. dynamic hourFormat', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.hourFormat = '24'; await el.updateComplete; expect(el.hourFormat).to.equal('24'); });
|
|
49
|
+
it('44. multiple instances', async () => { const c = await fixture(html`<div><nile-format-date></nile-format-date><nile-format-date></nile-format-date></div>`); expect(c.querySelectorAll('nile-format-date').length).to.equal(2); });
|
|
50
|
+
it('45. parent-child', async () => { const c = await fixture(html`<div><nile-format-date></nile-format-date></div>`); expect(c.querySelector('nile-format-date')!.parentElement).to.equal(c); });
|
|
51
|
+
it('46. createElement', async () => { const el = document.createElement('nile-format-date') as NileFormatDate; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
52
|
+
it('47. dataset', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date data-idx="0"></nile-format-date>`); expect(el.dataset.idx).to.equal('0'); });
|
|
53
|
+
it('48. classList add', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
54
|
+
it('49. getBoundingClientRect', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
55
|
+
it('50. no form', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
|
|
56
|
+
it('51. no input', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('input')).to.be.null; });
|
|
57
|
+
it('52. no button', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('button')).to.be.null; });
|
|
58
|
+
it('53. no anchor', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
|
|
59
|
+
it('54. no img', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('img')).to.be.null; });
|
|
60
|
+
it('55. no svg', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
|
|
61
|
+
it('56. style attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date style="color:red"></nile-format-date>`); expect(el.style.color).to.equal('red'); });
|
|
62
|
+
it('57. data attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date data-x="1"></nile-format-date>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
63
|
+
it('58. aria-label', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date aria-label="Date"></nile-format-date>`); expect(el.getAttribute('aria-label')).to.equal('Date'); });
|
|
64
|
+
it('59. role', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date role="time"></nile-format-date>`); expect(el.getAttribute('role')).to.equal('time'); });
|
|
65
|
+
it('60. dir', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date dir="rtl"></nile-format-date>`); expect(el.dir).to.equal('rtl'); });
|
|
66
|
+
it('61. lang attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date lang="en"></nile-format-date>`); expect(el.lang).to.equal('en'); });
|
|
67
|
+
it('62. tabindex', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date tabindex="0"></nile-format-date>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
68
|
+
it('63. requestUpdate', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
69
|
+
it('64. shadow childNodes', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
70
|
+
it('65. scrollIntoView', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
71
|
+
it('66. focus method', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.focus).to.be.a('function'); });
|
|
72
|
+
it('67. blur method', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.blur).to.be.a('function'); });
|
|
73
|
+
it('68. class toggle', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.classList.toggle('a'); expect(el.classList.contains('a')).to.be.true; });
|
|
74
|
+
it('69. toggle hidden', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.hidden = true; expect(el.hidden).to.be.true; });
|
|
75
|
+
it('70. dispatchCustomEvent', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); 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'); });
|
|
76
|
+
it('71. nested in div', async () => { const c = await fixture(html`<div><nile-format-date></nile-format-date></div>`); expect(c.querySelector('nile-format-date')).to.exist; });
|
|
77
|
+
it('72. no table', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
|
|
78
|
+
it('73. no ul', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('ul')).to.be.null; });
|
|
79
|
+
it('74. no canvas', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
|
|
80
|
+
it('75. no video', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
|
|
81
|
+
it('76. no audio', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
|
|
82
|
+
it('77. no nav', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('nav')).to.be.null; });
|
|
83
|
+
it('78. no aside', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
|
|
84
|
+
it('79. no textarea', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
|
|
85
|
+
it('80. no select', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
|
|
86
|
+
it('81. setAttribute data', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.setAttribute('data-test', '1'); expect(el.dataset.test).to.equal('1'); });
|
|
87
|
+
it('82. removeAttribute hidden', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date hidden></nile-format-date>`); el.removeAttribute('hidden'); expect(el.hidden).to.be.false; });
|
|
88
|
+
it('83. setAttribute class', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); el.setAttribute('class', 'test'); expect(el.classList.contains('test')).to.be.true; });
|
|
89
|
+
it('84. aria-describedby', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date aria-describedby="d"></nile-format-date>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
|
|
90
|
+
it('85. multiple re-renders', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); for (let i = 0; i < 3; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
|
|
91
|
+
it('86. invalid date returns undefined', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date date="invalid"></nile-format-date>`); expect(el.shadowRoot!.querySelector('time')).to.be.null; });
|
|
92
|
+
it('87. set era', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date era="long"></nile-format-date>`); expect(el.era).to.equal('long'); });
|
|
93
|
+
it('88. set time-zone-name', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date time-zone-name="short"></nile-format-date>`); expect(el.timeZoneName).to.equal('short'); });
|
|
94
|
+
it('89. set time-zone', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date time-zone="UTC"></nile-format-date>`); expect(el.timeZone).to.equal('UTC'); });
|
|
95
|
+
it('90. no div', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('div')).to.be.null; });
|
|
96
|
+
it('91. no span', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('span')).to.be.null; });
|
|
97
|
+
it('92. no slot', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('slot')).to.be.null; });
|
|
98
|
+
it('93. title attr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date title="FD"></nile-format-date>`); expect(el.title).to.equal('FD'); });
|
|
99
|
+
it('94. no h1', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
|
|
100
|
+
it('95. no p', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('p')).to.be.null; });
|
|
101
|
+
it('96. no hr', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('hr')).to.be.null; });
|
|
102
|
+
it('97. no pre', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
|
|
103
|
+
it('98. no code', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
|
|
104
|
+
it('99. formatDate with specific date', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date></nile-format-date>`); const result = el.formatDate('2023-01-15', { day: '2-digit', month: '2-digit', year: 'numeric' }); expect(result).to.be.a('string'); expect(result.length).to.be.greaterThan(0); });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileFormatDate>(html`<nile-format-date date="2023-06-15" year="numeric" month="long" day="numeric" class="fd" id="fd1"></nile-format-date>`); expect(el.year).to.equal('numeric'); expect(el.month).to.equal('long'); expect(el.day).to.equal('numeric'); expect(el.id).to.equal('fd1'); expect(el.shadowRoot!.querySelector('time')).to.exist; });
|
|
106
|
+
});
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
initHeadResize,
|
|
14
14
|
headResizeMove,
|
|
15
15
|
headResizeDone,
|
|
16
|
+
addListeners,
|
|
17
|
+
removeListeners,
|
|
16
18
|
} from './nile-grid-head-item.utils';
|
|
17
19
|
import { NileGrid } from '../nile-grid';
|
|
18
20
|
|
|
@@ -55,11 +57,11 @@ export class NileGridHeadItem extends NileElement {
|
|
|
55
57
|
|
|
56
58
|
const { target, col } = result;
|
|
57
59
|
const move = (e: PointerEvent) => headResizeMove(el, col, startWRef.value, downXRef.value, e, nileGrid);
|
|
58
|
-
const done = () =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
target
|
|
60
|
+
const done = (e: PointerEvent) => {
|
|
61
|
+
headResizeDone(el, col, e, target, move);
|
|
62
|
+
removeListeners(target, move, done);
|
|
63
|
+
}
|
|
64
|
+
addListeners(target, move, done);
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
disconnectedCallback() {
|
|
@@ -91,3 +91,31 @@ export function headResizeDone(
|
|
|
91
91
|
new CustomEvent('nile-resize-end', { bubbles: true, composed: true, detail: { col: col } })
|
|
92
92
|
);
|
|
93
93
|
}
|
|
94
|
+
|
|
95
|
+
/** addListeners
|
|
96
|
+
* @param target Target element
|
|
97
|
+
* @param move Pointer move handler
|
|
98
|
+
* @param done Pointer up handler
|
|
99
|
+
* @returns void
|
|
100
|
+
*/
|
|
101
|
+
export function addListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void) {
|
|
102
|
+
target.addEventListener('pointermove', move);
|
|
103
|
+
target.addEventListener('pointerup', done);
|
|
104
|
+
target.addEventListener('pointercancel', done);
|
|
105
|
+
|
|
106
|
+
window.addEventListener('pointerup', done, { once: true });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** removeListeners
|
|
110
|
+
* @param target Target element
|
|
111
|
+
* @param move Pointer move handler
|
|
112
|
+
* @param done Pointer up handler
|
|
113
|
+
* @returns void
|
|
114
|
+
*/
|
|
115
|
+
export function removeListeners(target: HTMLElement, move: (e: PointerEvent) => void, done: (e: PointerEvent) => void) {
|
|
116
|
+
target.removeEventListener('pointermove', move);
|
|
117
|
+
target.removeEventListener('pointerup', done);
|
|
118
|
+
target.removeEventListener('pointercancel', done);
|
|
119
|
+
|
|
120
|
+
window.removeEventListener('pointerup', done);
|
|
121
|
+
}
|
|
@@ -10,7 +10,7 @@ import { customElement, property, query, state } from 'lit/decorators.js';
|
|
|
10
10
|
import { styles } from './nile-grid.css';
|
|
11
11
|
import NileElement from '../internal/nile-element';
|
|
12
12
|
import { syncStickyShadows, layout } from './nile-grid.layout';
|
|
13
|
-
import { listenToEventListeners, removeEventListeners, getHead, getBody } from './nile-grid.utils';
|
|
13
|
+
import { listenToEventListeners, removeEventListeners, getHead, getBody, copyArrayValuesInPlace } from './nile-grid.utils';
|
|
14
14
|
import { computeNewWidth, resizeWithScroll, resizeNoScroll, updateResizeGuides } from './nile-grid.resize';
|
|
15
15
|
import { PrefixColumn } from './types/nile-grid.types';
|
|
16
16
|
|
|
@@ -122,6 +122,8 @@ export class NileGrid extends NileElement {
|
|
|
122
122
|
/** To throttle sticky shadow updates */
|
|
123
123
|
private shadowRaf = 0;
|
|
124
124
|
|
|
125
|
+
public resizeBaseColumnWidths: number[] = [];
|
|
126
|
+
|
|
125
127
|
constructor() {
|
|
126
128
|
super();
|
|
127
129
|
}
|
|
@@ -172,6 +174,9 @@ export class NileGrid extends NileElement {
|
|
|
172
174
|
col: number;
|
|
173
175
|
widthPx: number;
|
|
174
176
|
};
|
|
177
|
+
if (!this.resizeBaseColumnWidths) return;
|
|
178
|
+
|
|
179
|
+
copyArrayValuesInPlace(this.columnWidths, this.resizeBaseColumnWidths);
|
|
175
180
|
const { prevW, newW, delta0 } = computeNewWidth({
|
|
176
181
|
target: e.target as HTMLElement,
|
|
177
182
|
col,
|
|
@@ -17,11 +17,13 @@ export const listenToEventListeners = (
|
|
|
17
17
|
nileGrid.addEventListener('nile-column-resize', onResize);
|
|
18
18
|
nileGrid.addEventListener('nile-resize-start', (e) => {
|
|
19
19
|
e.stopPropagation();
|
|
20
|
+
nileGrid.resizeBaseColumnWidths = [...nileGrid.columnWidths];
|
|
20
21
|
nileGrid.resizeStart.style.display = 'block';
|
|
21
22
|
});
|
|
22
23
|
nileGrid.addEventListener('nile-resize-end', (e: CustomEvent) => {
|
|
23
24
|
e.stopPropagation();
|
|
24
25
|
applyAfterResize(nileGrid, (e as CustomEvent).detail!.col);
|
|
26
|
+
nileGrid.resizeBaseColumnWidths = [];
|
|
25
27
|
nileGrid.resizeStart.style.display = 'none';
|
|
26
28
|
nileGrid.resizeEnd.style.display = 'none';
|
|
27
29
|
});
|
|
@@ -97,4 +99,19 @@ export const scrollEventHandler = (el: NileGrid) => {
|
|
|
97
99
|
top: el.scrollTop
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
|
-
};
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/** copyArrayValuesInPlace
|
|
105
|
+
* @param target Target array
|
|
106
|
+
* @param source Source array
|
|
107
|
+
* @returns void
|
|
108
|
+
*/
|
|
109
|
+
export function copyArrayValuesInPlace(
|
|
110
|
+
target: number[],
|
|
111
|
+
source: number[]
|
|
112
|
+
) {
|
|
113
|
+
const count = Math.min(target.length, source.length);
|
|
114
|
+
for (let i = 0; i < count; i++) {
|
|
115
|
+
target[i] = source[i];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
|
+
import './index';
|
|
3
|
+
import type { NileHeading } from './index';
|
|
4
|
+
|
|
5
|
+
describe('NileHeading', () => {
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.tagName.toLowerCase()).to.equal('nile-heading'); });
|
|
9
|
+
it('4. name defaults empty', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.name).to.equal(''); });
|
|
10
|
+
it('5. size defaults header-1', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.size).to.equal('header-1'); });
|
|
11
|
+
it('6. slot', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('slot')).to.exist; });
|
|
12
|
+
it('7. slotted content', async () => { const el = await fixture<NileHeading>(html`<nile-heading>Hello World</nile-heading>`); expect(el.textContent).to.contain('Hello World'); });
|
|
13
|
+
it('8. size reflected', async () => { const el = await fixture<NileHeading>(html`<nile-heading size="header-2"></nile-heading>`); expect(el.getAttribute('size')).to.equal('header-2'); });
|
|
14
|
+
it('9. dynamic name', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.name = 'Test'; await el.updateComplete; expect(el.name).to.equal('Test'); });
|
|
15
|
+
it('10. dynamic size', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.size = 'header-2'; await el.updateComplete; expect(el.getAttribute('size')).to.equal('header-2'); });
|
|
16
|
+
it('11. has styles', async () => { expect((await import('./index')).NileHeading.styles).to.exist; });
|
|
17
|
+
it('12. is defined', async () => { expect(customElements.get('nile-heading')).to.exist; });
|
|
18
|
+
it('13. shadow mode', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
19
|
+
it('14. isConnected', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.isConnected).to.be.true; });
|
|
20
|
+
it('15. removal', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
21
|
+
it('16. outerHTML', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.outerHTML).to.contain('nile-heading'); });
|
|
22
|
+
it('17. matches', async () => { const el = await fixture<NileHeading>(html`<nile-heading class="x"></nile-heading>`); expect(el.matches('nile-heading.x')).to.be.true; });
|
|
23
|
+
it('18. closest', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.closest('nile-heading')).to.equal(el); });
|
|
24
|
+
it('19. cloneNode', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-heading'); });
|
|
25
|
+
it('20. dispatchEvent', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); let f = false; el.addEventListener('c', () => (f = true)); el.dispatchEvent(new Event('c')); expect(f).to.be.true; });
|
|
26
|
+
it('21. updateComplete', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
27
|
+
it('22. requestUpdate', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
28
|
+
it('23. render method', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.render).to.be.a('function'); });
|
|
29
|
+
it('24. shadowRoot host', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
30
|
+
it('25. class attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading class="h"></nile-heading>`); expect(el.classList.contains('h')).to.be.true; });
|
|
31
|
+
it('26. id attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading id="h1"></nile-heading>`); expect(el.id).to.equal('h1'); });
|
|
32
|
+
it('27. style attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading style="color:red"></nile-heading>`); expect(el.style.color).to.equal('red'); });
|
|
33
|
+
it('28. data attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading data-x="1"></nile-heading>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
34
|
+
it('29. hidden', async () => { const el = await fixture<NileHeading>(html`<nile-heading hidden></nile-heading>`); expect(el.hidden).to.be.true; });
|
|
35
|
+
it('30. dir', async () => { const el = await fixture<NileHeading>(html`<nile-heading dir="rtl"></nile-heading>`); expect(el.dir).to.equal('rtl'); });
|
|
36
|
+
it('31. nodeType', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.nodeType).to.equal(1); });
|
|
37
|
+
it('32. multiple instances', async () => { const c = await fixture(html`<div><nile-heading></nile-heading><nile-heading></nile-heading></div>`); expect(c.querySelectorAll('nile-heading').length).to.equal(2); });
|
|
38
|
+
it('33. parent-child', async () => { const c = await fixture(html`<div><nile-heading></nile-heading></div>`); expect(c.querySelector('nile-heading')!.parentElement).to.equal(c); });
|
|
39
|
+
it('34. localName', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.localName).to.equal('nile-heading'); });
|
|
40
|
+
it('35. namespaceURI', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
41
|
+
it('36. ownerDocument', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.ownerDocument).to.equal(document); });
|
|
42
|
+
it('37. classList add', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
43
|
+
it('38. dataset', async () => { const el = await fixture<NileHeading>(html`<nile-heading data-idx="0"></nile-heading>`); expect(el.dataset.idx).to.equal('0'); });
|
|
44
|
+
it('39. getBoundingClientRect', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
45
|
+
it('40. name type', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(typeof el.name).to.equal('string'); });
|
|
46
|
+
it('41. size type', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(typeof el.size).to.equal('string'); });
|
|
47
|
+
it('42. no inputs', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelectorAll('input').length).to.equal(0); });
|
|
48
|
+
it('43. no buttons', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelectorAll('button').length).to.equal(0); });
|
|
49
|
+
it('44. slot count', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelectorAll('slot').length).to.equal(1); });
|
|
50
|
+
it('45. aria-label', async () => { const el = await fixture<NileHeading>(html`<nile-heading aria-label="Title"></nile-heading>`); expect(el.getAttribute('aria-label')).to.equal('Title'); });
|
|
51
|
+
it('46. role', async () => { const el = await fixture<NileHeading>(html`<nile-heading role="heading"></nile-heading>`); expect(el.getAttribute('role')).to.equal('heading'); });
|
|
52
|
+
it('47. createElement', async () => { const el = document.createElement('nile-heading') as NileHeading; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
53
|
+
it('48. lang attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading lang="en"></nile-heading>`); expect(el.lang).to.equal('en'); });
|
|
54
|
+
it('49. tabindex', async () => { const el = await fixture<NileHeading>(html`<nile-heading tabindex="0"></nile-heading>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
55
|
+
it('50. children survived update', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span id="s1">Title</span></nile-heading>`); el.name = 'N'; await el.updateComplete; expect(el.querySelector('#s1')).to.exist; });
|
|
56
|
+
it('51. nested elements', async () => { const el = await fixture<NileHeading>(html`<nile-heading><strong>Bold</strong></nile-heading>`); expect(el.querySelector('strong')).to.exist; });
|
|
57
|
+
it('52. childElementCount', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span>A</span></nile-heading>`); expect(el.childElementCount).to.equal(1); });
|
|
58
|
+
it('53. firstElementChild', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span>A</span></nile-heading>`); expect(el.firstElementChild!.tagName.toLowerCase()).to.equal('span'); });
|
|
59
|
+
it('54. text content', async () => { const el = await fixture<NileHeading>(html`<nile-heading>Test</nile-heading>`); expect(el.textContent).to.contain('Test'); });
|
|
60
|
+
it('55. no children default', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.childElementCount).to.equal(0); });
|
|
61
|
+
it('56. no form', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('form')).to.be.null; });
|
|
62
|
+
it('57. no anchor', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('a')).to.be.null; });
|
|
63
|
+
it('58. no img', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('img')).to.be.null; });
|
|
64
|
+
it('59. no svg', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('svg')).to.be.null; });
|
|
65
|
+
it('60. shadow childNodes', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
66
|
+
it('61. scrollIntoView', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.scrollIntoView).to.be.a('function'); });
|
|
67
|
+
it('62. focus method', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.focus).to.be.a('function'); });
|
|
68
|
+
it('63. blur method', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.blur).to.be.a('function'); });
|
|
69
|
+
it('64. dispatchCustomEvent', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); 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'); });
|
|
70
|
+
it('65. class toggle', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.classList.toggle('active'); expect(el.classList.contains('active')).to.be.true; });
|
|
71
|
+
it('66. toggle hidden', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.hidden = true; expect(el.hidden).to.be.true; });
|
|
72
|
+
it('67. innerHTML', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.innerHTML = '<p>New</p>'; expect(el.querySelector('p')!.textContent).to.equal('New'); });
|
|
73
|
+
it('68. setAttribute size', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.setAttribute('size', 'header-3'); await el.updateComplete; expect(el.size).to.equal('header-3'); });
|
|
74
|
+
it('69. removeAttribute size', async () => { const el = await fixture<NileHeading>(html`<nile-heading size="header-2"></nile-heading>`); el.removeAttribute('size'); await el.updateComplete; expect(el.getAttribute('size')).to.be.null; });
|
|
75
|
+
it('70. hasAttribute size', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.hasAttribute('size')).to.be.true; });
|
|
76
|
+
it('71. rapid size changes', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.size = 'header-2'; await el.updateComplete; el.size = 'header-3'; await el.updateComplete; expect(el.size).to.equal('header-3'); });
|
|
77
|
+
it('72. no video', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('video')).to.be.null; });
|
|
78
|
+
it('73. no audio', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('audio')).to.be.null; });
|
|
79
|
+
it('74. no canvas', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('canvas')).to.be.null; });
|
|
80
|
+
it('75. no table', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('table')).to.be.null; });
|
|
81
|
+
it('76. no ul', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('ul')).to.be.null; });
|
|
82
|
+
it('77. re-renders', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); el.name = 'A'; await el.updateComplete; el.name = 'B'; await el.updateComplete; expect(el.name).to.equal('B'); });
|
|
83
|
+
it('78. nested in div', async () => { const c = await fixture(html`<div><nile-heading>Title</nile-heading></div>`); expect(c.querySelector('nile-heading')).to.exist; });
|
|
84
|
+
it('79. contains check', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span id="s1">T</span></nile-heading>`); expect(el.contains(el.querySelector('#s1'))).to.be.true; });
|
|
85
|
+
it('80. children array', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span>A</span><span>B</span></nile-heading>`); expect(el.children.length).to.equal(2); });
|
|
86
|
+
it('81. lastElementChild', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span>A</span><div>B</div></nile-heading>`); expect(el.lastElementChild!.tagName.toLowerCase()).to.equal('div'); });
|
|
87
|
+
it('82. append child', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); const s = document.createElement('span'); el.appendChild(s); expect(el.querySelector('span')).to.exist; });
|
|
88
|
+
it('83. remove child', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span id="s1">T</span></nile-heading>`); el.removeChild(el.querySelector('#s1')!); expect(el.querySelector('#s1')).to.be.null; });
|
|
89
|
+
it('84. replaceChildren', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span>Old</span></nile-heading>`); const p = document.createElement('p'); el.replaceChildren(p); expect(el.querySelector('p')).to.exist; expect(el.querySelector('span')).to.be.null; });
|
|
90
|
+
it('85. textContent empty default', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.textContent!.trim()).to.equal(''); });
|
|
91
|
+
it('86. no nav', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('nav')).to.be.null; });
|
|
92
|
+
it('87. no aside', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('aside')).to.be.null; });
|
|
93
|
+
it('88. no select', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('select')).to.be.null; });
|
|
94
|
+
it('89. no textarea', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('textarea')).to.be.null; });
|
|
95
|
+
it('90. aria-level', async () => { const el = await fixture<NileHeading>(html`<nile-heading aria-level="1"></nile-heading>`); expect(el.getAttribute('aria-level')).to.equal('1'); });
|
|
96
|
+
it('91. aria-describedby', async () => { const el = await fixture<NileHeading>(html`<nile-heading aria-describedby="d"></nile-heading>`); expect(el.getAttribute('aria-describedby')).to.equal('d'); });
|
|
97
|
+
it('92. title attr', async () => { const el = await fixture<NileHeading>(html`<nile-heading title="T"></nile-heading>`); expect(el.title).to.equal('T'); });
|
|
98
|
+
it('93. insertBefore', async () => { const el = await fixture<NileHeading>(html`<nile-heading><span id="s1">B</span></nile-heading>`); const p = document.createElement('p'); el.insertBefore(p, el.querySelector('#s1')!); expect(el.firstElementChild!.tagName.toLowerCase()).to.equal('p'); });
|
|
99
|
+
it('94. no pre', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('pre')).to.be.null; });
|
|
100
|
+
it('95. no code', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('code')).to.be.null; });
|
|
101
|
+
it('96. no h1 in shadow', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('h1')).to.be.null; });
|
|
102
|
+
it('97. no div in shadow', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); expect(el.shadowRoot!.querySelector('div')).to.be.null; });
|
|
103
|
+
it('98. only slot in shadow', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); const all = el.shadowRoot!.querySelectorAll('*'); const tagNames = Array.from(all).map(e => e.tagName.toLowerCase()); expect(tagNames).to.include('slot'); });
|
|
104
|
+
it('99. multiple re-renders', async () => { const el = await fixture<NileHeading>(html`<nile-heading></nile-heading>`); for (let i = 0; i < 5; i++) { el.requestUpdate(); await el.updateComplete; } expect(el.shadowRoot).to.not.be.null; });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileHeading>(html`<nile-heading size="header-1" name="Title" class="h" id="h1" role="heading" aria-label="Main heading">Main Title</nile-heading>`); expect(el.name).to.equal('Title'); expect(el.size).to.equal('header-1'); expect(el.id).to.equal('h1'); expect(el.textContent).to.contain('Main Title'); expect(el.shadowRoot!.querySelector('slot')).to.exist; });
|
|
106
|
+
});
|
|
@@ -1,45 +1,106 @@
|
|
|
1
|
-
import { fixture, html
|
|
1
|
+
import { expect, fixture, html } from '@open-wc/testing';
|
|
2
2
|
import './nile-hero';
|
|
3
|
-
import { NileHero } from './nile-hero';
|
|
3
|
+
import type { NileHero } from './nile-hero';
|
|
4
4
|
|
|
5
5
|
describe('NileHero', () => {
|
|
6
|
-
it('renders
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it('
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
45
|
-
})
|
|
6
|
+
it('1. renders', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el).to.exist; });
|
|
7
|
+
it('2. shadow root', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot).to.not.be.null; });
|
|
8
|
+
it('3. tag name', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.tagName.toLowerCase()).to.equal('nile-hero'); });
|
|
9
|
+
it('4. icon default', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.icon).to.contain('nile-icon-action'); });
|
|
10
|
+
it('5. collapse defaults false', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.collapse).to.be.false; });
|
|
11
|
+
it('6. imgSrc defaults empty', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.imgSrc).to.equal(''); });
|
|
12
|
+
it('7. heroText defaults empty', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.heroText).to.equal(''); });
|
|
13
|
+
it('8. container part', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('[part="nile__hero__container"]')).to.exist; });
|
|
14
|
+
it('9. header part', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('[part="nile__hero__header"]')).to.exist; });
|
|
15
|
+
it('10. hero__container class', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__container')).to.exist; });
|
|
16
|
+
it('11. expanded class default', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__container--expanded')).to.exist; });
|
|
17
|
+
it('12. collapsed class', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__container--collapsed')).to.exist; });
|
|
18
|
+
it('13. hero-header element', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('nile-hero-header')).to.exist; });
|
|
19
|
+
it('14. nile-icon', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('nile-icon')).to.exist; });
|
|
20
|
+
it('15. slot', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('slot')).to.exist; });
|
|
21
|
+
it('16. img element', async () => { const el = await fixture<NileHero>(html`<nile-hero img-src="test.png"></nile-hero>`); expect(el.shadowRoot!.querySelector('img')).to.exist; });
|
|
22
|
+
it('17. hero__img class', async () => { const el = await fixture<NileHero>(html`<nile-hero img-src="t.png"></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__img')).to.exist; });
|
|
23
|
+
it('18. hero__slot class', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__slot')).to.exist; });
|
|
24
|
+
it('19. hero__slot__container', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__slot__container')).to.exist; });
|
|
25
|
+
it('20. hero__img__container', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('#hero__img__container')).to.exist; });
|
|
26
|
+
it('21. icon__container', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.icon__container')).to.exist; });
|
|
27
|
+
it('22. icon reflected', async () => { const el = await fixture<NileHero>(html`<nile-hero icon="star"></nile-hero>`); expect(el.getAttribute('icon')).to.equal('star'); });
|
|
28
|
+
it('23. collapse reflected', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); expect(el.hasAttribute('collapse')).to.be.true; });
|
|
29
|
+
it('24. img-src reflected', async () => { const el = await fixture<NileHero>(html`<nile-hero img-src="a.png"></nile-hero>`); expect(el.getAttribute('img-src')).to.equal('a.png'); });
|
|
30
|
+
it('25. hero-text reflected', async () => { const el = await fixture<NileHero>(html`<nile-hero hero-text="Hello"></nile-hero>`); expect(el.getAttribute('hero-text')).to.equal('Hello'); });
|
|
31
|
+
it('26. dynamic collapse', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.collapse = true; await el.updateComplete; expect(el.shadowRoot!.querySelector('.hero__container--collapsed')).to.exist; });
|
|
32
|
+
it('27. dynamic icon', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.icon = 'home'; await el.updateComplete; const icon = el.shadowRoot!.querySelector('nile-icon'); expect(icon!.getAttribute('name')).to.equal('home'); });
|
|
33
|
+
it('28. dynamic imgSrc', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.imgSrc = 'new.png'; await el.updateComplete; const img = el.shadowRoot!.querySelector('img') as HTMLImageElement; expect(img.src).to.contain('new.png'); });
|
|
34
|
+
it('29. dynamic heroText', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.heroText = 'New Text'; await el.updateComplete; const h = el.shadowRoot!.querySelector('nile-hero-header'); expect(h!.getAttribute('hero-text')).to.equal('New Text'); });
|
|
35
|
+
it('30. has styles', async () => { expect((await import('./nile-hero')).NileHero.styles).to.exist; });
|
|
36
|
+
it('31. is defined', async () => { expect(customElements.get('nile-hero')).to.exist; });
|
|
37
|
+
it('32. shadow mode', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.mode).to.equal('open'); });
|
|
38
|
+
it('33. isConnected', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.isConnected).to.be.true; });
|
|
39
|
+
it('34. removal', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.remove(); expect(el.isConnected).to.be.false; });
|
|
40
|
+
it('35. outerHTML', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.outerHTML).to.contain('nile-hero'); });
|
|
41
|
+
it('36. matches', async () => { const el = await fixture<NileHero>(html`<nile-hero class="x"></nile-hero>`); expect(el.matches('nile-hero.x')).to.be.true; });
|
|
42
|
+
it('37. closest', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.closest('nile-hero')).to.equal(el); });
|
|
43
|
+
it('38. cloneNode', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect((el.cloneNode(true) as Element).tagName.toLowerCase()).to.equal('nile-hero'); });
|
|
44
|
+
it('39. getBoundingClientRect', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.getBoundingClientRect()).to.exist; });
|
|
45
|
+
it('40. dispatchEvent', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); 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<NileHero>(html`<nile-hero></nile-hero>`); const r = await el.updateComplete; expect(r).to.not.be.undefined; });
|
|
47
|
+
it('42. requestUpdate', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.requestUpdate(); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; });
|
|
48
|
+
it('43. render method', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.render).to.be.a('function'); });
|
|
49
|
+
it('44. shadowRoot host', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.host).to.equal(el); });
|
|
50
|
+
it('45. class attr', async () => { const el = await fixture<NileHero>(html`<nile-hero class="h"></nile-hero>`); expect(el.classList.contains('h')).to.be.true; });
|
|
51
|
+
it('46. id attr', async () => { const el = await fixture<NileHero>(html`<nile-hero id="h1"></nile-hero>`); expect(el.id).to.equal('h1'); });
|
|
52
|
+
it('47. style attr', async () => { const el = await fixture<NileHero>(html`<nile-hero style="color:red"></nile-hero>`); expect(el.style.color).to.equal('red'); });
|
|
53
|
+
it('48. data attr', async () => { const el = await fixture<NileHero>(html`<nile-hero data-x="1"></nile-hero>`); expect(el.getAttribute('data-x')).to.equal('1'); });
|
|
54
|
+
it('49. hidden', async () => { const el = await fixture<NileHero>(html`<nile-hero hidden></nile-hero>`); expect(el.hidden).to.be.true; });
|
|
55
|
+
it('50. dir', async () => { const el = await fixture<NileHero>(html`<nile-hero dir="rtl"></nile-hero>`); expect(el.dir).to.equal('rtl'); });
|
|
56
|
+
it('51. nodeType', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.nodeType).to.equal(1); });
|
|
57
|
+
it('52. multiple instances', async () => { const c = await fixture(html`<div><nile-hero></nile-hero><nile-hero></nile-hero></div>`); expect(c.querySelectorAll('nile-hero').length).to.equal(2); });
|
|
58
|
+
it('53. parent-child', async () => { const c = await fixture(html`<div><nile-hero></nile-hero></div>`); expect(c.querySelector('nile-hero')!.parentElement).to.equal(c); });
|
|
59
|
+
it('54. localName', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.localName).to.equal('nile-hero'); });
|
|
60
|
+
it('55. namespaceURI', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.namespaceURI).to.equal('http://www.w3.org/1999/xhtml'); });
|
|
61
|
+
it('56. ownerDocument', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.ownerDocument).to.equal(document); });
|
|
62
|
+
it('57. collapsed opacity', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); const slotContainer = el.shadowRoot!.querySelector('.hero__slot__container') as HTMLElement; expect(slotContainer.style.opacity).to.equal('0'); });
|
|
63
|
+
it('58. expanded opacity', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); const slotContainer = el.shadowRoot!.querySelector('.hero__slot__container') as HTMLElement; expect(slotContainer.style.opacity).to.equal('1'); });
|
|
64
|
+
it('59. header opacity collapsed', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); const h = el.shadowRoot!.querySelector('nile-hero-header') as HTMLElement; expect(h.style.opacity).to.equal('1'); });
|
|
65
|
+
it('60. header opacity expanded', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); const h = el.shadowRoot!.querySelector('nile-hero-header') as HTMLElement; expect(h.style.opacity).to.equal('0'); });
|
|
66
|
+
it('61. img container opacity collapsed', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); const c = el.shadowRoot!.querySelector('#hero__img__container') as HTMLElement; expect(c.style.opacity).to.equal('0'); });
|
|
67
|
+
it('62. img container opacity expanded', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); const c = el.shadowRoot!.querySelector('#hero__img__container') as HTMLElement; expect(c.style.opacity).to.equal('1'); });
|
|
68
|
+
it('63. hero-header gets hero-text', async () => { const el = await fixture<NileHero>(html`<nile-hero hero-text="Banner"></nile-hero>`); const h = el.shadowRoot!.querySelector('nile-hero-header'); expect(h!.getAttribute('hero-text')).to.equal('Banner'); });
|
|
69
|
+
it('64. hero-header gets icon', async () => { const el = await fixture<NileHero>(html`<nile-hero icon="star"></nile-hero>`); const h = el.shadowRoot!.querySelector('nile-hero-header'); expect(h!.getAttribute('icon')).to.equal('star'); });
|
|
70
|
+
it('65. nile-icon size', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); const icon = el.shadowRoot!.querySelector('.icon__container nile-icon'); expect(icon!.getAttribute('size')).to.equal('16'); });
|
|
71
|
+
it('66. slotted content', async () => { const el = await fixture<NileHero>(html`<nile-hero><p>Content</p></nile-hero>`); expect(el.querySelector('p')).to.exist; });
|
|
72
|
+
it('67. classList add', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.classList.add('z'); expect(el.classList.contains('z')).to.be.true; });
|
|
73
|
+
it('68. dataset', async () => { const el = await fixture<NileHero>(html`<nile-hero data-idx="0"></nile-hero>`); expect(el.dataset.idx).to.equal('0'); });
|
|
74
|
+
it('69. hasAttribute collapse', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); expect(el.hasAttribute('collapse')).to.be.true; });
|
|
75
|
+
it('70. removeAttribute collapse', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); el.removeAttribute('collapse'); await el.updateComplete; expect(el.collapse).to.be.false; });
|
|
76
|
+
it('71. setAttribute collapse', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.setAttribute('collapse', ''); await el.updateComplete; expect(el.collapse).to.be.true; });
|
|
77
|
+
it('72. icon type string', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(typeof el.icon).to.equal('string'); });
|
|
78
|
+
it('73. collapse type boolean', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(typeof el.collapse).to.equal('boolean'); });
|
|
79
|
+
it('74. imgSrc type string', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(typeof el.imgSrc).to.equal('string'); });
|
|
80
|
+
it('75. heroText type string', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(typeof el.heroText).to.equal('string'); });
|
|
81
|
+
it('76. toggle collapse', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.collapse = true; await el.updateComplete; el.collapse = false; await el.updateComplete; expect(el.shadowRoot!.querySelector('.hero__container--expanded')).to.exist; });
|
|
82
|
+
it('77. no form', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelectorAll('form').length).to.equal(0); });
|
|
83
|
+
it('78. no input', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelectorAll('input').length).to.equal(0); });
|
|
84
|
+
it('79. no button', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelectorAll('button').length).to.equal(0); });
|
|
85
|
+
it('80. aria-label', async () => { const el = await fixture<NileHero>(html`<nile-hero aria-label="Hero Section"></nile-hero>`); expect(el.getAttribute('aria-label')).to.equal('Hero Section'); });
|
|
86
|
+
it('81. tabindex', async () => { const el = await fixture<NileHero>(html`<nile-hero tabindex="0"></nile-hero>`); expect(el.getAttribute('tabindex')).to.equal('0'); });
|
|
87
|
+
it('82. role', async () => { const el = await fixture<NileHero>(html`<nile-hero role="banner"></nile-hero>`); expect(el.getAttribute('role')).to.equal('banner'); });
|
|
88
|
+
it('83. createElement', async () => { const el = document.createElement('nile-hero') as NileHero; document.body.appendChild(el); await el.updateComplete; expect(el.shadowRoot).to.not.be.null; document.body.removeChild(el); });
|
|
89
|
+
it('84. setAttribute icon', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.setAttribute('icon', 'arrow'); await el.updateComplete; expect(el.icon).to.equal('arrow'); });
|
|
90
|
+
it('85. setAttribute imgSrc', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.setAttribute('img-src', 'x.png'); await el.updateComplete; expect(el.imgSrc).to.equal('x.png'); });
|
|
91
|
+
it('86. setAttribute heroText', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.setAttribute('hero-text', 'Title'); await el.updateComplete; expect(el.heroText).to.equal('Title'); });
|
|
92
|
+
it('87. img src attr', async () => { const el = await fixture<NileHero>(html`<nile-hero img-src="t.png"></nile-hero>`); const img = el.shadowRoot!.querySelector('img') as HTMLImageElement; expect(img.src).to.contain('t.png'); });
|
|
93
|
+
it('88. hero-header collapsed class', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__header--collapsed')).to.exist; });
|
|
94
|
+
it('89. no expanded and collapsed together', async () => { const el = await fixture<NileHero>(html`<nile-hero collapse></nile-hero>`); expect(el.shadowRoot!.querySelector('.hero__container--expanded')).to.be.null; });
|
|
95
|
+
it('90. text content', async () => { const el = await fixture<NileHero>(html`<nile-hero>Hello World</nile-hero>`); expect(el.textContent).to.contain('Hello World'); });
|
|
96
|
+
it('91. children', async () => { const el = await fixture<NileHero>(html`<nile-hero><span>A</span></nile-hero>`); expect(el.children.length).to.equal(1); });
|
|
97
|
+
it('92. childElementCount', async () => { const el = await fixture<NileHero>(html`<nile-hero><span>A</span><span>B</span></nile-hero>`); expect(el.childElementCount).to.equal(2); });
|
|
98
|
+
it('93. firstElementChild', async () => { const el = await fixture<NileHero>(html`<nile-hero><span>A</span></nile-hero>`); expect(el.firstElementChild!.tagName.toLowerCase()).to.equal('span'); });
|
|
99
|
+
it('94. no childElements default', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.childElementCount).to.equal(0); });
|
|
100
|
+
it('95. shadow childNodes', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); expect(el.shadowRoot!.childNodes.length).to.be.greaterThan(0); });
|
|
101
|
+
it('96. title attr', async () => { const el = await fixture<NileHero>(html`<nile-hero title="T"></nile-hero>`); expect(el.title).to.equal('T'); });
|
|
102
|
+
it('97. lang attr', async () => { const el = await fixture<NileHero>(html`<nile-hero lang="en"></nile-hero>`); expect(el.lang).to.equal('en'); });
|
|
103
|
+
it('98. dynamic all props', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.icon = 'star'; el.collapse = true; el.imgSrc = 'a.png'; el.heroText = 'Banner'; await el.updateComplete; expect(el.shadowRoot!.querySelector('.hero__container--collapsed')).to.exist; });
|
|
104
|
+
it('99. re-renders', async () => { const el = await fixture<NileHero>(html`<nile-hero></nile-hero>`); el.collapse = true; await el.updateComplete; el.collapse = false; await el.updateComplete; el.collapse = true; await el.updateComplete; expect(el.shadowRoot!.querySelector('.hero__container--collapsed')).to.exist; });
|
|
105
|
+
it('100. full integration', async () => { const el = await fixture<NileHero>(html`<nile-hero icon="star" hero-text="Banner" img-src="img.png" class="h" id="h1" collapse><p>Content</p></nile-hero>`); expect(el.icon).to.equal('star'); expect(el.heroText).to.equal('Banner'); expect(el.imgSrc).to.equal('img.png'); expect(el.collapse).to.be.true; expect(el.id).to.equal('h1'); expect(el.shadowRoot!.querySelector('.hero__container--collapsed')).to.exist; expect(el.querySelector('p')).to.exist; });
|
|
106
|
+
});
|