@aquera/nile-elements 1.5.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +239 -195
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.cjs.js.map +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.css.esm.js +1 -1
- package/dist/nile-auto-complete/nile-auto-complete.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.css.esm.js +2 -2
- package/dist/nile-file-preview/nile-file-preview.esm.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.cjs.js.map +1 -1
- package/dist/nile-file-preview/nile-file-preview.template.esm.js +55 -25
- package/dist/nile-file-preview/utils/index.cjs.js +1 -1
- package/dist/nile-file-preview/utils/index.esm.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.cjs.js.map +1 -1
- package/dist/nile-file-preview/utils/nile-file-preview.util.esm.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.css.esm.js +15 -5
- package/dist/nile-file-upload/nile-file-upload.esm.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js +2 -2
- package/dist/nile-file-upload/nile-file-upload.template.cjs.js.map +1 -1
- package/dist/nile-file-upload/nile-file-upload.template.esm.js +36 -32
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.cjs.js.map +1 -1
- package/dist/nile-file-upload/types/file-upload.enums.esm.js +1 -1
- package/dist/nile-file-upload/types/index.cjs.js +1 -1
- package/dist/nile-file-upload/types/index.esm.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/drag-drop.util.esm.js +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js +4 -2
- package/dist/nile-file-upload/utils/file-validation.util.cjs.js.map +1 -1
- package/dist/nile-file-upload/utils/file-validation.util.esm.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.esm.js +3 -3
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.esm.js +2 -2
- package/dist/nile-grid/nile-grid.layout.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.layout.esm.js +1 -1
- package/dist/nile-grid/nile-grid.resize.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.resize.esm.js +1 -1
- package/dist/nile-grid/nile-grid.utils.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.utils.esm.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js +1 -1
- package/dist/nile-grid/nile-grid.width.cjs.js.map +1 -1
- package/dist/nile-grid/nile-grid.width.esm.js +1 -1
- package/dist/nile-input/nile-input.cjs.js +1 -1
- package/dist/nile-input/nile-input.cjs.js.map +1 -1
- package/dist/nile-input/nile-input.esm.js +1 -1
- package/dist/nile-popover/index.cjs.js +1 -1
- package/dist/nile-popover/index.esm.js +1 -1
- package/dist/nile-popover/nile-popover.cjs.js +4 -4
- package/dist/nile-popover/nile-popover.cjs.js.map +1 -1
- package/dist/nile-popover/nile-popover.esm.js +11 -6
- package/dist/src/nile-accordion/nile-accordian.test.js +101 -99
- package/dist/src/nile-accordion/nile-accordian.test.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.css.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.js.map +1 -1
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js +104 -112
- package/dist/src/nile-auto-complete/nile-auto-complete.test.js.map +1 -1
- package/dist/src/nile-avatar/nile-avatar.test.d.ts +0 -1
- package/dist/src/nile-avatar/nile-avatar.test.js +103 -87
- package/dist/src/nile-avatar/nile-avatar.test.js.map +1 -1
- package/dist/src/nile-badge/nile-badge.test.js +554 -35
- package/dist/src/nile-badge/nile-badge.test.js.map +1 -1
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.d.ts +2 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js +106 -0
- package/dist/src/nile-breadcrumb/nile-breadcrumb.test.js.map +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.d.ts +1 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js +108 -0
- package/dist/src/nile-breadcrumb-item/nile-breadcrumb-item.test.js.map +1 -0
- package/dist/src/nile-button/nile-button.test.js +499 -39
- package/dist/src/nile-button/nile-button.test.js.map +1 -1
- package/dist/src/nile-button-filter/nile-button-filter.test.d.ts +1 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js +108 -0
- package/dist/src/nile-button-filter/nile-button-filter.test.js.map +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.d.ts +1 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js +108 -0
- package/dist/src/nile-button-toggle/nile-button-toggle.test.js.map +1 -0
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.d.ts +1 -1
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js +105 -104
- package/dist/src/nile-button-toggle-group/nile-button-toggle-group.test.js.map +1 -1
- package/dist/src/nile-calendar/nile-calendar.test.d.ts +0 -6
- package/dist/src/nile-calendar/nile-calendar.test.js +103 -318
- package/dist/src/nile-calendar/nile-calendar.test.js.map +1 -1
- package/dist/src/nile-card/nile-card.test.js +102 -66
- package/dist/src/nile-card/nile-card.test.js.map +1 -1
- package/dist/src/nile-checkbox/nile-checkbox.test.js +547 -108
- package/dist/src/nile-checkbox/nile-checkbox.test.js.map +1 -1
- package/dist/src/nile-chip/nile-chip.test.d.ts +0 -2
- package/dist/src/nile-chip/nile-chip.test.js +101 -102
- package/dist/src/nile-chip/nile-chip.test.js.map +1 -1
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.d.ts +1 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js +108 -0
- package/dist/src/nile-circular-progressbar/nile-circular-progressbar.test.js.map +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.d.ts +1 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js +108 -0
- package/dist/src/nile-date-picker/nile-date-picker.test.js.map +1 -0
- package/dist/src/nile-dialog/nile-dialog.test.d.ts +0 -1
- package/dist/src/nile-dialog/nile-dialog.test.js +104 -126
- package/dist/src/nile-dialog/nile-dialog.test.js.map +1 -1
- package/dist/src/nile-divider/nile-divider.test.d.ts +1 -0
- package/dist/src/nile-divider/nile-divider.test.js +560 -0
- package/dist/src/nile-divider/nile-divider.test.js.map +1 -0
- package/dist/src/nile-drawer/nile-drawer.test.js +106 -86
- package/dist/src/nile-drawer/nile-drawer.test.js.map +1 -1
- package/dist/src/nile-dropdown/nile-dropdown.test.js +104 -148
- package/dist/src/nile-dropdown/nile-dropdown.test.js.map +1 -1
- package/dist/src/nile-empty-state/nile-empty-state.test.js +107 -59
- package/dist/src/nile-empty-state/nile-empty-state.test.js.map +1 -1
- package/dist/src/nile-error-message/nile-error-message.test.js +105 -55
- package/dist/src/nile-error-message/nile-error-message.test.js.map +1 -1
- package/dist/src/nile-error-notification/nile-error-notification.test.d.ts +1 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js +108 -0
- package/dist/src/nile-error-notification/nile-error-notification.test.js.map +1 -0
- package/dist/src/nile-file-preview/nile-file-preview.css.js +2 -2
- package/dist/src/nile-file-preview/nile-file-preview.css.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.d.ts +1 -4
- package/dist/src/nile-file-preview/nile-file-preview.js +21 -47
- package/dist/src/nile-file-preview/nile-file-preview.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.template.d.ts +6 -6
- package/dist/src/nile-file-preview/nile-file-preview.template.js +53 -23
- package/dist/src/nile-file-preview/nile-file-preview.template.js.map +1 -1
- package/dist/src/nile-file-preview/nile-file-preview.test.d.ts +0 -6
- package/dist/src/nile-file-preview/nile-file-preview.test.js +106 -28
- package/dist/src/nile-file-preview/nile-file-preview.test.js.map +1 -1
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.d.ts +3 -2
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js +32 -7
- package/dist/src/nile-file-preview/utils/nile-file-preview.util.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.css.js +15 -5
- package/dist/src/nile-file-upload/nile-file-upload.css.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.d.ts +4 -1
- package/dist/src/nile-file-upload/nile-file-upload.js +13 -1
- package/dist/src/nile-file-upload/nile-file-upload.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.template.js +19 -15
- package/dist/src/nile-file-upload/nile-file-upload.template.js.map +1 -1
- package/dist/src/nile-file-upload/nile-file-upload.test.d.ts +0 -6
- package/dist/src/nile-file-upload/nile-file-upload.test.js +106 -28
- package/dist/src/nile-file-upload/nile-file-upload.test.js.map +1 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.d.ts +17 -3
- package/dist/src/nile-file-upload/types/file-upload.enums.js +17 -1
- package/dist/src/nile-file-upload/types/file-upload.enums.js.map +1 -1
- package/dist/src/nile-file-upload/utils/drag-drop.util.d.ts +2 -0
- package/dist/src/nile-file-upload/utils/drag-drop.util.js +14 -8
- package/dist/src/nile-file-upload/utils/drag-drop.util.js.map +1 -1
- package/dist/src/nile-file-upload/utils/file-validation.util.js +89 -10
- package/dist/src/nile-file-upload/utils/file-validation.util.js.map +1 -1
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js +102 -77
- package/dist/src/nile-filter-chip/nile-filter-chip.test.js.map +1 -1
- package/dist/src/nile-form-error-message/nile-form-error-message.test.d.ts +1 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js +108 -0
- package/dist/src/nile-form-error-message/nile-form-error-message.test.js.map +1 -0
- package/dist/src/nile-form-group/nile-form-group.test.js +104 -51
- package/dist/src/nile-form-group/nile-form-group.test.js.map +1 -1
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js +104 -84
- package/dist/src/nile-form-help-text/nile-form-help-text.test.js.map +1 -1
- package/dist/src/nile-format-date/nile-format-date.test.d.ts +1 -0
- package/dist/src/nile-format-date/nile-format-date.test.js +108 -0
- package/dist/src/nile-format-date/nile-format-date.test.js.map +1 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js +6 -5
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.js.map +1 -1
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.d.ts +14 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js +24 -0
- package/dist/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.d.ts +1 -0
- package/dist/src/nile-grid/nile-grid.js +5 -1
- package/dist/src/nile-grid/nile-grid.js.map +1 -1
- package/dist/src/nile-grid/nile-grid.utils.d.ts +6 -0
- package/dist/src/nile-grid/nile-grid.utils.js +13 -0
- package/dist/src/nile-grid/nile-grid.utils.js.map +1 -1
- package/dist/src/nile-heading/nile-heading.test.d.ts +1 -0
- package/dist/src/nile-heading/nile-heading.test.js +108 -0
- package/dist/src/nile-heading/nile-heading.test.js.map +1 -0
- package/dist/src/nile-hero/nile-hero.test.js +101 -38
- package/dist/src/nile-hero/nile-hero.test.js.map +1 -1
- package/dist/src/nile-icon/nile-icon.test.js +103 -40
- package/dist/src/nile-icon/nile-icon.test.js.map +1 -1
- package/dist/src/nile-icon-button/nile-icon-button.test.d.ts +1 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js +568 -0
- package/dist/src/nile-icon-button/nile-icon-button.test.js.map +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.d.ts +1 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js +108 -0
- package/dist/src/nile-inline-edit/nile-inline-edit.test.js.map +1 -0
- package/dist/src/nile-input/nile-input.js +1 -1
- package/dist/src/nile-input/nile-input.js.map +1 -1
- package/dist/src/nile-input/nile-input.test.js +109 -139
- package/dist/src/nile-input/nile-input.test.js.map +1 -1
- package/dist/src/nile-link/nile-link.test.js +103 -67
- package/dist/src/nile-link/nile-link.test.js.map +1 -1
- package/dist/src/nile-list/nile-list.test.d.ts +1 -0
- package/dist/src/nile-list/nile-list.test.js +108 -0
- package/dist/src/nile-list/nile-list.test.js.map +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.d.ts +1 -0
- package/dist/src/nile-list-item/nile-list-item.test.js +108 -0
- package/dist/src/nile-list-item/nile-list-item.test.js.map +1 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.d.ts +2 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js +109 -0
- package/dist/src/nile-lite-tooltip/nile-lite-tooltip.test.js.map +1 -0
- package/dist/src/nile-loader/nile-loader.test.js +107 -40
- package/dist/src/nile-loader/nile-loader.test.js.map +1 -1
- package/dist/src/nile-menu/nile-menu.test.d.ts +1 -0
- package/dist/src/nile-menu/nile-menu.test.js +113 -0
- package/dist/src/nile-menu/nile-menu.test.js.map +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.d.ts +1 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js +113 -0
- package/dist/src/nile-menu-item/nile-menu-item.test.js.map +1 -0
- package/dist/src/nile-option/nile-option.test.d.ts +1 -0
- package/dist/src/nile-option/nile-option.test.js +108 -0
- package/dist/src/nile-option/nile-option.test.js.map +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.d.ts +1 -0
- package/dist/src/nile-option-group/nile-option-group.test.js +108 -0
- package/dist/src/nile-option-group/nile-option-group.test.js.map +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.d.ts +1 -0
- package/dist/src/nile-page-header/nile-page-header.test.js +108 -0
- package/dist/src/nile-page-header/nile-page-header.test.js.map +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.d.ts +1 -0
- package/dist/src/nile-pagination/nile-pagination.test.js +108 -0
- package/dist/src/nile-pagination/nile-pagination.test.js.map +1 -0
- package/dist/src/nile-popover/nile-popover.test.js +103 -68
- package/dist/src/nile-popover/nile-popover.test.js.map +1 -1
- package/dist/src/nile-popup/nile-popup.test.js +104 -65
- package/dist/src/nile-popup/nile-popup.test.js.map +1 -1
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js +104 -44
- package/dist/src/nile-progress-bar/nile-progress-bar.test.js.map +1 -1
- package/dist/src/nile-radio/nile-radio.test.js +103 -66
- package/dist/src/nile-radio/nile-radio.test.js.map +1 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.d.ts +0 -1
- package/dist/src/nile-radio-group/nile-radio-group.test.js +105 -171
- package/dist/src/nile-radio-group/nile-radio-group.test.js.map +1 -1
- package/dist/src/nile-section-message/nile-section-message.test.d.ts +1 -0
- package/dist/src/nile-section-message/nile-section-message.test.js +108 -0
- package/dist/src/nile-section-message/nile-section-message.test.js.map +1 -0
- package/dist/src/nile-select/nile-select.test.d.ts +0 -5
- package/dist/src/nile-select/nile-select.test.js +105 -244
- package/dist/src/nile-select/nile-select.test.js.map +1 -1
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.d.ts +1 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js +108 -0
- package/dist/src/nile-skeleton-loader/nile-skeleton-loader.test.js.map +1 -0
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js +104 -50
- package/dist/src/nile-slide-toggle/nile-slide-toggle.test.js.map +1 -1
- package/dist/src/nile-slider/nile-slider.test.d.ts +1 -0
- package/dist/src/nile-slider/nile-slider.test.js +108 -0
- package/dist/src/nile-slider/nile-slider.test.js.map +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.d.ts +1 -0
- package/dist/src/nile-spinner/nile-spinner.test.js +569 -0
- package/dist/src/nile-spinner/nile-spinner.test.js.map +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.d.ts +1 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js +108 -0
- package/dist/src/nile-split-panel/nile-split-panel.test.js.map +1 -0
- package/dist/src/nile-stepper/nile-stepper.test.d.ts +2 -0
- package/dist/src/nile-stepper/nile-stepper.test.js +109 -0
- package/dist/src/nile-stepper/nile-stepper.test.js.map +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.d.ts +1 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js +108 -0
- package/dist/src/nile-stepper-item/nile-stepper-item.test.js.map +1 -0
- package/dist/src/nile-tab/nile-tab.test.d.ts +1 -0
- package/dist/src/nile-tab/nile-tab.test.js +108 -0
- package/dist/src/nile-tab/nile-tab.test.js.map +1 -0
- package/dist/src/nile-tab-group/nile-tab-group.test.js +105 -172
- package/dist/src/nile-tab-group/nile-tab-group.test.js.map +1 -1
- package/dist/src/nile-tab-panel/nile-tab-panel.test.d.ts +1 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js +108 -0
- package/dist/src/nile-tab-panel/nile-tab-panel.test.js.map +1 -0
- package/dist/src/nile-tag/nile-tag.test.d.ts +1 -0
- package/dist/src/nile-tag/nile-tag.test.js +574 -0
- package/dist/src/nile-tag/nile-tag.test.js.map +1 -0
- package/dist/src/nile-textarea/nile-textarea.test.d.ts +1 -1
- package/dist/src/nile-textarea/nile-textarea.test.js +105 -84
- package/dist/src/nile-textarea/nile-textarea.test.js.map +1 -1
- package/dist/src/nile-title/nile-title.test.d.ts +1 -0
- package/dist/src/nile-title/nile-title.test.js +108 -0
- package/dist/src/nile-title/nile-title.test.js.map +1 -0
- package/dist/src/nile-toast/nile-toast.test.d.ts +1 -0
- package/dist/src/nile-toast/nile-toast.test.js +526 -0
- package/dist/src/nile-toast/nile-toast.test.js.map +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.d.ts +1 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js +108 -0
- package/dist/src/nile-toolbar/nile-toolbar.test.js.map +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.d.ts +1 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js +546 -0
- package/dist/src/nile-tooltip/nile-tooltip.test.js.map +1 -0
- package/dist/src/nile-virtual-select/nile-virtual-select.test.d.ts +1 -7
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js +105 -628
- package/dist/src/nile-virtual-select/nile-virtual-select.test.js.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/rollup.config.js +7 -1
- package/src/nile-accordion/nile-accordian.test.ts +102 -116
- package/src/nile-auto-complete/nile-auto-complete.css.ts +1 -1
- package/src/nile-auto-complete/nile-auto-complete.test.ts +102 -145
- package/src/nile-auto-complete/nile-auto-complete.ts +1 -1
- package/src/nile-avatar/nile-avatar.test.ts +102 -112
- package/src/nile-badge/nile-badge.test.ts +642 -30
- package/src/nile-breadcrumb/nile-breadcrumb.test.ts +107 -0
- package/src/nile-breadcrumb-item/nile-breadcrumb-item.test.ts +106 -0
- package/src/nile-button/nile-button.test.ts +593 -61
- package/src/nile-button-filter/nile-button-filter.test.ts +106 -0
- package/src/nile-button-toggle/nile-button-toggle.test.ts +106 -0
- package/src/nile-button-toggle-group/nile-button-toggle-group.test.ts +104 -126
- package/src/nile-calendar/nile-calendar.test.ts +102 -406
- package/src/nile-card/nile-card.test.ts +103 -71
- package/src/nile-checkbox/nile-checkbox.test.ts +614 -108
- package/src/nile-chip/nile-chip.test.ts +102 -136
- package/src/nile-circular-progressbar/nile-circular-progressbar.test.ts +106 -0
- package/src/nile-date-picker/nile-date-picker.test.ts +106 -0
- package/src/nile-dialog/nile-dialog.test.ts +102 -164
- package/src/nile-divider/nile-divider.test.ts +659 -0
- package/src/nile-drawer/nile-drawer.test.ts +105 -105
- package/src/nile-dropdown/nile-dropdown.test.ts +102 -190
- package/src/nile-empty-state/nile-empty-state.test.ts +104 -67
- package/src/nile-error-message/nile-error-message.test.ts +104 -67
- package/src/nile-error-notification/nile-error-notification.test.ts +106 -0
- package/src/nile-file-preview/nile-file-preview.css.ts +2 -2
- package/src/nile-file-preview/nile-file-preview.template.ts +59 -23
- package/src/nile-file-preview/nile-file-preview.test.ts +105 -37
- package/src/nile-file-preview/nile-file-preview.ts +23 -56
- package/src/nile-file-preview/utils/nile-file-preview.util.ts +37 -8
- package/src/nile-file-upload/nile-file-upload.css.ts +15 -5
- package/src/nile-file-upload/nile-file-upload.template.ts +22 -18
- package/src/nile-file-upload/nile-file-upload.test.ts +105 -37
- package/src/nile-file-upload/nile-file-upload.ts +11 -3
- package/src/nile-file-upload/types/file-upload.enums.ts +20 -4
- package/src/nile-file-upload/utils/drag-drop.util.ts +20 -11
- package/src/nile-file-upload/utils/file-validation.util.ts +104 -22
- package/src/nile-filter-chip/nile-filter-chip.test.ts +103 -89
- package/src/nile-form-error-message/nile-form-error-message.test.ts +106 -0
- package/src/nile-form-group/nile-form-group.test.ts +103 -60
- package/src/nile-form-help-text/nile-form-help-text.test.ts +102 -106
- package/src/nile-format-date/nile-format-date.test.ts +106 -0
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.ts +7 -5
- package/src/nile-grid/nile-grid-head-item/nile-grid-head-item.utils.ts +28 -0
- package/src/nile-grid/nile-grid.ts +6 -1
- package/src/nile-grid/nile-grid.utils.ts +18 -1
- package/src/nile-heading/nile-heading.test.ts +106 -0
- package/src/nile-hero/nile-hero.test.ts +103 -42
- package/src/nile-icon/nile-icon.test.ts +103 -50
- package/src/nile-icon-button/nile-icon-button.test.ts +667 -0
- package/src/nile-inline-edit/nile-inline-edit.test.ts +106 -0
- package/src/nile-input/nile-input.test.ts +105 -164
- package/src/nile-input/nile-input.ts +1 -1
- package/src/nile-link/nile-link.test.ts +104 -81
- package/src/nile-list/nile-list.test.ts +106 -0
- package/src/nile-list-item/nile-list-item.test.ts +106 -0
- package/src/nile-lite-tooltip/nile-lite-tooltip.test.ts +107 -0
- package/src/nile-loader/nile-loader.test.ts +103 -48
- package/src/nile-menu/nile-menu.test.ts +106 -0
- package/src/nile-menu-item/nile-menu-item.test.ts +106 -0
- package/src/nile-option/nile-option.test.ts +106 -0
- package/src/nile-option-group/nile-option-group.test.ts +106 -0
- package/src/nile-page-header/nile-page-header.test.ts +106 -0
- package/src/nile-pagination/nile-pagination.test.ts +106 -0
- package/src/nile-popover/nile-popover.test.ts +103 -83
- package/src/nile-popup/nile-popup.test.ts +102 -82
- package/src/nile-progress-bar/nile-progress-bar.test.ts +103 -52
- package/src/nile-radio/nile-radio.test.ts +103 -78
- package/src/nile-radio-group/nile-radio-group.test.ts +104 -213
- package/src/nile-section-message/nile-section-message.test.ts +106 -0
- package/src/nile-select/nile-select.test.ts +105 -308
- package/src/nile-skeleton-loader/nile-skeleton-loader.test.ts +106 -0
- package/src/nile-slide-toggle/nile-slide-toggle.test.ts +103 -58
- package/src/nile-slider/nile-slider.test.ts +106 -0
- package/src/nile-spinner/nile-spinner.test.ts +668 -0
- package/src/nile-split-panel/nile-split-panel.test.ts +106 -0
- package/src/nile-stepper/nile-stepper.test.ts +107 -0
- package/src/nile-stepper-item/nile-stepper-item.test.ts +106 -0
- package/src/nile-tab/nile-tab.test.ts +106 -0
- package/src/nile-tab-group/nile-tab-group.test.ts +104 -211
- package/src/nile-tab-panel/nile-tab-panel.test.ts +106 -0
- package/src/nile-tag/nile-tag.test.ts +675 -0
- package/src/nile-textarea/nile-textarea.test.ts +104 -100
- package/src/nile-title/nile-title.test.ts +106 -0
- package/src/nile-toast/nile-toast.test.ts +625 -0
- package/src/nile-toolbar/nile-toolbar.test.ts +106 -0
- package/src/nile-tooltip/nile-tooltip.test.ts +645 -0
- package/src/nile-virtual-select/nile-virtual-select.test.ts +104 -772
- package/vscode-html-custom-data.json +8 -3
- package/web-test-runner.config.mjs +4 -2
- package/dist/axe.min-2720cd56.esm.js +0 -1
- package/dist/axe.min-69d47269.cjs.js +0 -2
- package/dist/axe.min-69d47269.cjs.js.map +0 -1
- package/dist/css-tag-bb10c0fa.cjs.js +0 -6
- package/dist/css-tag-bb10c0fa.cjs.js.map +0 -1
- package/dist/css-tag-dc564feb.esm.js +0 -6
- package/dist/fixture-958445f8.cjs.js +0 -395
- package/dist/fixture-958445f8.cjs.js.map +0 -1
- package/dist/fixture-985bba12.esm.js +0 -569
- package/dist/nile-accordion/nile-accordian.test.cjs.js +0 -2
- package/dist/nile-accordion/nile-accordian.test.cjs.js.map +0 -1
- package/dist/nile-accordion/nile-accordian.test.esm.js +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js +0 -2
- package/dist/nile-auto-complete/nile-auto-complete.test.cjs.js.map +0 -1
- package/dist/nile-auto-complete/nile-auto-complete.test.esm.js +0 -9
- package/dist/nile-avatar/nile-avatar.test.cjs.js +0 -2
- package/dist/nile-avatar/nile-avatar.test.cjs.js.map +0 -1
- package/dist/nile-avatar/nile-avatar.test.esm.js +0 -11
- package/dist/nile-badge/nile-badge.test.cjs.js +0 -2
- package/dist/nile-badge/nile-badge.test.cjs.js.map +0 -1
- package/dist/nile-badge/nile-badge.test.esm.js +0 -1
- package/dist/nile-button/nile-button.test.cjs.js +0 -2
- package/dist/nile-button/nile-button.test.cjs.js.map +0 -1
- package/dist/nile-button/nile-button.test.esm.js +0 -4
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js +0 -2
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.cjs.js.map +0 -1
- package/dist/nile-button-toggle-group/nile-button-toggle-group.test.esm.js +0 -49
- package/dist/nile-calendar/nile-calendar.test.cjs.js +0 -2
- package/dist/nile-calendar/nile-calendar.test.cjs.js.map +0 -1
- package/dist/nile-calendar/nile-calendar.test.esm.js +0 -11
- package/dist/nile-card/nile-card.test.cjs.js +0 -2
- package/dist/nile-card/nile-card.test.cjs.js.map +0 -1
- package/dist/nile-card/nile-card.test.esm.js +0 -51
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js +0 -2
- package/dist/nile-checkbox/nile-checkbox.test.cjs.js.map +0 -1
- package/dist/nile-checkbox/nile-checkbox.test.esm.js +0 -17
- package/dist/nile-chip/nile-chip.test.cjs.js +0 -2
- package/dist/nile-chip/nile-chip.test.cjs.js.map +0 -1
- package/dist/nile-chip/nile-chip.test.esm.js +0 -1
- package/dist/nile-dialog/nile-dialog.test.cjs.js +0 -2
- package/dist/nile-dialog/nile-dialog.test.cjs.js.map +0 -1
- package/dist/nile-dialog/nile-dialog.test.esm.js +0 -7
- package/dist/nile-drawer/nile-drawer.test.cjs.js +0 -2
- package/dist/nile-drawer/nile-drawer.test.cjs.js.map +0 -1
- package/dist/nile-drawer/nile-drawer.test.esm.js +0 -17
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js +0 -2
- package/dist/nile-dropdown/nile-dropdown.test.cjs.js.map +0 -1
- package/dist/nile-dropdown/nile-dropdown.test.esm.js +0 -28
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js +0 -2
- package/dist/nile-empty-state/nile-empty-state.test.cjs.js.map +0 -1
- package/dist/nile-empty-state/nile-empty-state.test.esm.js +0 -9
- package/dist/nile-error-message/nile-error-message.test.cjs.js +0 -2
- package/dist/nile-error-message/nile-error-message.test.cjs.js.map +0 -1
- package/dist/nile-error-message/nile-error-message.test.esm.js +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js +0 -2
- package/dist/nile-file-preview/nile-file-preview.test.cjs.js.map +0 -1
- package/dist/nile-file-preview/nile-file-preview.test.esm.js +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js +0 -2
- package/dist/nile-file-upload/nile-file-upload.test.cjs.js.map +0 -1
- package/dist/nile-file-upload/nile-file-upload.test.esm.js +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js +0 -2
- package/dist/nile-filter-chip/nile-filter-chip.test.cjs.js.map +0 -1
- package/dist/nile-filter-chip/nile-filter-chip.test.esm.js +0 -20
- package/dist/nile-form-group/nile-form-group.test.cjs.js +0 -2
- package/dist/nile-form-group/nile-form-group.test.cjs.js.map +0 -1
- package/dist/nile-form-group/nile-form-group.test.esm.js +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js +0 -2
- package/dist/nile-form-help-text/nile-form-help-text.test.cjs.js.map +0 -1
- package/dist/nile-form-help-text/nile-form-help-text.test.esm.js +0 -1
- package/dist/nile-hero/nile-hero.test.cjs.js +0 -2
- package/dist/nile-hero/nile-hero.test.cjs.js.map +0 -1
- package/dist/nile-hero/nile-hero.test.esm.js +0 -14
- package/dist/nile-icon/nile-icon.test.cjs.js +0 -2
- package/dist/nile-icon/nile-icon.test.cjs.js.map +0 -1
- package/dist/nile-icon/nile-icon.test.esm.js +0 -1
- package/dist/nile-input/nile-input.test.cjs.js +0 -2
- package/dist/nile-input/nile-input.test.cjs.js.map +0 -1
- package/dist/nile-input/nile-input.test.esm.js +0 -17
- package/dist/nile-link/nile-link.test.cjs.js +0 -2
- package/dist/nile-link/nile-link.test.cjs.js.map +0 -1
- package/dist/nile-link/nile-link.test.esm.js +0 -1
- package/dist/nile-loader/nile-loader.test.cjs.js +0 -2
- package/dist/nile-loader/nile-loader.test.cjs.js.map +0 -1
- package/dist/nile-loader/nile-loader.test.esm.js +0 -1
- package/dist/nile-popover/nile-popover.test.cjs.js +0 -2
- package/dist/nile-popover/nile-popover.test.cjs.js.map +0 -1
- package/dist/nile-popover/nile-popover.test.esm.js +0 -21
- package/dist/nile-popup/nile-popup.test.cjs.js +0 -2
- package/dist/nile-popup/nile-popup.test.cjs.js.map +0 -1
- package/dist/nile-popup/nile-popup.test.esm.js +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js +0 -2
- package/dist/nile-progress-bar/nile-progress-bar.test.cjs.js.map +0 -1
- package/dist/nile-progress-bar/nile-progress-bar.test.esm.js +0 -1
- package/dist/nile-radio/nile-radio.test.cjs.js +0 -2
- package/dist/nile-radio/nile-radio.test.cjs.js.map +0 -1
- package/dist/nile-radio/nile-radio.test.esm.js +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js +0 -2
- package/dist/nile-radio-group/nile-radio-group.test.cjs.js.map +0 -1
- package/dist/nile-radio-group/nile-radio-group.test.esm.js +0 -57
- package/dist/nile-select/nile-select.test.cjs.js +0 -2
- package/dist/nile-select/nile-select.test.cjs.js.map +0 -1
- package/dist/nile-select/nile-select.test.esm.js +0 -55
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js +0 -2
- package/dist/nile-slide-toggle/nile-slide-toggle.test.cjs.js.map +0 -1
- package/dist/nile-slide-toggle/nile-slide-toggle.test.esm.js +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js +0 -2
- package/dist/nile-tab-group/nile-tab-group.test.cjs.js.map +0 -1
- package/dist/nile-tab-group/nile-tab-group.test.esm.js +0 -65
- package/dist/nile-textarea/nile-textarea.test.cjs.js +0 -2
- package/dist/nile-textarea/nile-textarea.test.cjs.js.map +0 -1
- package/dist/nile-textarea/nile-textarea.test.esm.js +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js +0 -2
- package/dist/nile-virtual-select/nile-virtual-select.test.cjs.js.map +0 -1
- package/dist/nile-virtual-select/nile-virtual-select.test.esm.js +0 -93
- package/dist/scopedElementsWrapper-31107e48.esm.js +0 -1
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js +0 -2
- package/dist/scopedElementsWrapper-9b188ea6.cjs.js.map +0 -1
- package/dist/sinon-esm-68c8e378.esm.js +0 -1
- package/dist/sinon-esm-97570c13.cjs.js +0 -2
- package/dist/sinon-esm-97570c13.cjs.js.map +0 -1
|
@@ -1,48 +1,660 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { expect, fixture, html, elementUpdated } from '@open-wc/testing';
|
|
2
2
|
import './nile-badge';
|
|
3
|
+
import NileBadge from './nile-badge';
|
|
3
4
|
|
|
4
5
|
describe('NileBadge', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
expect(el
|
|
6
|
+
// === RENDERING ===
|
|
7
|
+
it('1. should render without errors', async () => {
|
|
8
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
9
|
+
expect(el).to.exist;
|
|
9
10
|
});
|
|
10
11
|
|
|
11
|
-
it('should
|
|
12
|
-
const el = await fixture(html`<nile-badge
|
|
13
|
-
|
|
14
|
-
expect(badge).to.have.class('badge--success');
|
|
12
|
+
it('2. should have a shadow root', async () => {
|
|
13
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
14
|
+
expect(el.shadowRoot).to.not.be.null;
|
|
15
15
|
});
|
|
16
16
|
|
|
17
|
-
it('should
|
|
18
|
-
const el = await fixture(html`<nile-badge
|
|
19
|
-
const
|
|
20
|
-
expect(
|
|
17
|
+
it('3. should render a span as base element', async () => {
|
|
18
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
19
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
20
|
+
expect(span).to.exist;
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
it('should
|
|
24
|
-
const el = await fixture(html`<nile-badge
|
|
25
|
-
|
|
26
|
-
expect(badge).to.have.class('badge--pill-outline');
|
|
23
|
+
it('4. should render slot content', async () => {
|
|
24
|
+
const el = await fixture<NileBadge>(html`<nile-badge>Badge Text</nile-badge>`);
|
|
25
|
+
expect(el.textContent!.trim()).to.equal('Badge Text');
|
|
27
26
|
});
|
|
28
27
|
|
|
29
|
-
it('should
|
|
30
|
-
const el = await fixture(html`<nile-badge
|
|
31
|
-
const
|
|
32
|
-
expect(
|
|
28
|
+
it('5. should render default slot', async () => {
|
|
29
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
30
|
+
const slot = el.shadowRoot!.querySelector('slot');
|
|
31
|
+
expect(slot).to.exist;
|
|
33
32
|
});
|
|
34
33
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const
|
|
38
|
-
expect(
|
|
39
|
-
expect(badge).to.have.class('badge--rounded');
|
|
34
|
+
// === DEFAULT PROPERTIES ===
|
|
35
|
+
it('6. should have variant default to normal', async () => {
|
|
36
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
37
|
+
expect(el.variant).to.equal('normal');
|
|
40
38
|
});
|
|
41
39
|
|
|
42
|
-
it('should
|
|
43
|
-
const el = await fixture(html`<nile-badge
|
|
44
|
-
expect(el.
|
|
40
|
+
it('7. should have rounded default to false', async () => {
|
|
41
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
42
|
+
expect(el.rounded).to.be.false;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('8. should have pilltype default to badge-color', async () => {
|
|
46
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
47
|
+
expect(el.pilltype).to.equal('badge-color');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// === VARIANT TESTS ===
|
|
51
|
+
it('9. should apply primary variant class', async () => {
|
|
52
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary"></nile-badge>`);
|
|
53
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
54
|
+
expect(span!.classList.contains('badge--primary')).to.be.true;
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('10. should apply success variant class', async () => {
|
|
58
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success"></nile-badge>`);
|
|
59
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
60
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('11. should apply normal variant class', async () => {
|
|
64
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="normal"></nile-badge>`);
|
|
65
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
66
|
+
expect(span!.classList.contains('badge--normal')).to.be.true;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('12. should apply warning variant class', async () => {
|
|
70
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="warning"></nile-badge>`);
|
|
71
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
72
|
+
expect(span!.classList.contains('badge--warning')).to.be.true;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
it('13. should apply error variant class', async () => {
|
|
76
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="error"></nile-badge>`);
|
|
77
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
78
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('14. should apply info variant class', async () => {
|
|
82
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="info"></nile-badge>`);
|
|
83
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
84
|
+
expect(span!.classList.contains('badge--info')).to.be.true;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('15. should apply gray variant class', async () => {
|
|
88
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="gray"></nile-badge>`);
|
|
89
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
90
|
+
expect(span!.classList.contains('badge--gray')).to.be.true;
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it('16. should apply brand variant class', async () => {
|
|
94
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="brand"></nile-badge>`);
|
|
95
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
96
|
+
expect(span!.classList.contains('badge--brand')).to.be.true;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('17. should apply blue-light variant class', async () => {
|
|
100
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="blue-light"></nile-badge>`);
|
|
101
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
102
|
+
expect(span!.classList.contains('badge--blue-light')).to.be.true;
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
it('18. should apply blue variant class', async () => {
|
|
106
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="blue"></nile-badge>`);
|
|
107
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
108
|
+
expect(span!.classList.contains('badge--blue')).to.be.true;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('19. should apply indigo variant class', async () => {
|
|
112
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="indigo"></nile-badge>`);
|
|
113
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
114
|
+
expect(span!.classList.contains('badge--indigo')).to.be.true;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('20. should apply purple variant class', async () => {
|
|
118
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="purple"></nile-badge>`);
|
|
119
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
120
|
+
expect(span!.classList.contains('badge--purple')).to.be.true;
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('21. should apply pink variant class', async () => {
|
|
124
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="pink"></nile-badge>`);
|
|
125
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
126
|
+
expect(span!.classList.contains('badge--pink')).to.be.true;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('22. should apply orange variant class', async () => {
|
|
130
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="orange"></nile-badge>`);
|
|
131
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
132
|
+
expect(span!.classList.contains('badge--orange')).to.be.true;
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('23. should apply gray-blue variant class', async () => {
|
|
136
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="gray-blue"></nile-badge>`);
|
|
137
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
138
|
+
expect(span!.classList.contains('badge--gray-blue')).to.be.true;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
it('24. should reflect variant attribute', async () => {
|
|
142
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success"></nile-badge>`);
|
|
143
|
+
expect(el.getAttribute('variant')).to.equal('success');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// === ROUNDED ===
|
|
147
|
+
it('25. should apply rounded class when rounded is true', async () => {
|
|
148
|
+
const el = await fixture<NileBadge>(html`<nile-badge rounded></nile-badge>`);
|
|
149
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
150
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('26. should not apply rounded class when rounded is false', async () => {
|
|
154
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
155
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
156
|
+
expect(span!.classList.contains('badge--rounded')).to.be.false;
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
it('27. should reflect rounded attribute', async () => {
|
|
160
|
+
const el = await fixture<NileBadge>(html`<nile-badge rounded></nile-badge>`);
|
|
45
161
|
expect(el.hasAttribute('rounded')).to.be.true;
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
// === PILLTYPE ===
|
|
165
|
+
it('28. should apply badge-color pilltype class by default', async () => {
|
|
166
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
167
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
168
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('29. should apply pill-outline pilltype class', async () => {
|
|
172
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-outline"></nile-badge>`);
|
|
173
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
174
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('30. should apply pill-color pilltype class', async () => {
|
|
178
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-color"></nile-badge>`);
|
|
179
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
180
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
it('31. should auto-round when pilltype is pill-outline', async () => {
|
|
184
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-outline"></nile-badge>`);
|
|
185
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
186
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
it('32. should auto-round when pilltype is pill-color', async () => {
|
|
190
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-color"></nile-badge>`);
|
|
191
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
192
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('33. should reflect pilltype attribute', async () => {
|
|
196
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-outline"></nile-badge>`);
|
|
46
197
|
expect(el.getAttribute('pilltype')).to.equal('pill-outline');
|
|
47
198
|
});
|
|
48
|
-
|
|
199
|
+
|
|
200
|
+
// === CSS PARTS ===
|
|
201
|
+
it('34. should have base part', async () => {
|
|
202
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
203
|
+
const base = el.shadowRoot!.querySelector('[part~="base"]');
|
|
204
|
+
expect(base).to.exist;
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('35. should have content part', async () => {
|
|
208
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
209
|
+
const content = el.shadowRoot!.querySelector('[part~="content"]');
|
|
210
|
+
expect(content).to.exist;
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// === DYNAMIC PROPERTY CHANGES ===
|
|
214
|
+
it('36. should update variant dynamically', async () => {
|
|
215
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="normal"></nile-badge>`);
|
|
216
|
+
el.variant = 'success';
|
|
217
|
+
await el.updateComplete;
|
|
218
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
219
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
it('37. should update rounded dynamically', async () => {
|
|
223
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
224
|
+
el.rounded = true;
|
|
225
|
+
await el.updateComplete;
|
|
226
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
227
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it('38. should update pilltype dynamically', async () => {
|
|
231
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
232
|
+
el.pilltype = 'pill-outline';
|
|
233
|
+
await el.updateComplete;
|
|
234
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
235
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
// === CLASS COMBINATIONS ===
|
|
239
|
+
it('39. should have badge class always', async () => {
|
|
240
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
241
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
242
|
+
expect(span!.classList.contains('badge')).to.be.true;
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
it('40. should handle variant + rounded', async () => {
|
|
246
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="error" rounded></nile-badge>`);
|
|
247
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
248
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
249
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
it('41. should handle variant + pilltype', async () => {
|
|
253
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success" pilltype="pill-outline"></nile-badge>`);
|
|
254
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
255
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
256
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it('42. should handle all properties together', async () => {
|
|
260
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="warning" rounded pilltype="pill-outline"></nile-badge>`);
|
|
261
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
262
|
+
expect(span!.classList.contains('badge--warning')).to.be.true;
|
|
263
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
264
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// === ALL VARIANTS CLASS VERIFICATION ===
|
|
268
|
+
it('43. should not have other variant classes when primary', async () => {
|
|
269
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary"></nile-badge>`);
|
|
270
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
271
|
+
expect(span!.classList.contains('badge--primary')).to.be.true;
|
|
272
|
+
expect(span!.classList.contains('badge--success')).to.be.false;
|
|
273
|
+
expect(span!.classList.contains('badge--error')).to.be.false;
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
it('44. should switch variant classes on change', async () => {
|
|
277
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary"></nile-badge>`);
|
|
278
|
+
el.variant = 'error';
|
|
279
|
+
await el.updateComplete;
|
|
280
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
281
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
282
|
+
expect(span!.classList.contains('badge--primary')).to.be.false;
|
|
283
|
+
});
|
|
284
|
+
|
|
285
|
+
// === CONTENT RENDERING ===
|
|
286
|
+
it('45. should render HTML content in slot', async () => {
|
|
287
|
+
const el = await fixture<NileBadge>(html`<nile-badge><strong>Bold</strong></nile-badge>`);
|
|
288
|
+
const strong = el.querySelector('strong');
|
|
289
|
+
expect(strong).to.exist;
|
|
290
|
+
expect(strong!.textContent).to.equal('Bold');
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
it('46. should render multiple elements in slot', async () => {
|
|
294
|
+
const el = await fixture<NileBadge>(html`<nile-badge><span>A</span><span>B</span></nile-badge>`);
|
|
295
|
+
const spans = el.querySelectorAll('span');
|
|
296
|
+
expect(spans.length).to.equal(2);
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
it('47. should handle empty content', async () => {
|
|
300
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
301
|
+
expect(el.textContent!.trim()).to.equal('');
|
|
302
|
+
});
|
|
303
|
+
|
|
304
|
+
// === BADGE CLASS ===
|
|
305
|
+
it('48. should have badge__content class on slot', async () => {
|
|
306
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
307
|
+
const contentSlot = el.shadowRoot!.querySelector('.badge__content');
|
|
308
|
+
expect(contentSlot).to.exist;
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
// === REPEATED UPDATES ===
|
|
312
|
+
it('49. should handle multiple variant changes', async () => {
|
|
313
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
314
|
+
const variants: Array<'primary' | 'success' | 'error' | 'warning' | 'info'> = ['primary', 'success', 'error', 'warning', 'info'];
|
|
315
|
+
for (const v of variants) {
|
|
316
|
+
el.variant = v;
|
|
317
|
+
await el.updateComplete;
|
|
318
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
319
|
+
expect(span!.classList.contains(`badge--${v}`)).to.be.true;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
322
|
+
|
|
323
|
+
it('50. should handle toggling rounded', async () => {
|
|
324
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
325
|
+
el.rounded = true;
|
|
326
|
+
await el.updateComplete;
|
|
327
|
+
let span = el.shadowRoot!.querySelector('span');
|
|
328
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
329
|
+
el.rounded = false;
|
|
330
|
+
await el.updateComplete;
|
|
331
|
+
span = el.shadowRoot!.querySelector('span');
|
|
332
|
+
expect(span!.classList.contains('badge--rounded')).to.be.false;
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// === ADDITIONAL VARIANT COMBINATIONS ===
|
|
336
|
+
it('51. primary variant reflects attribute', async () => {
|
|
337
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary"></nile-badge>`);
|
|
338
|
+
expect(el.getAttribute('variant')).to.equal('primary');
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('52. success variant reflects attribute', async () => {
|
|
342
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success"></nile-badge>`);
|
|
343
|
+
expect(el.getAttribute('variant')).to.equal('success');
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
it('53. normal variant reflects attribute', async () => {
|
|
347
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="normal"></nile-badge>`);
|
|
348
|
+
expect(el.getAttribute('variant')).to.equal('normal');
|
|
349
|
+
});
|
|
350
|
+
|
|
351
|
+
it('54. warning variant reflects attribute', async () => {
|
|
352
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="warning"></nile-badge>`);
|
|
353
|
+
expect(el.getAttribute('variant')).to.equal('warning');
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it('55. error variant reflects attribute', async () => {
|
|
357
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="error"></nile-badge>`);
|
|
358
|
+
expect(el.getAttribute('variant')).to.equal('error');
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('56. info variant reflects attribute', async () => {
|
|
362
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="info"></nile-badge>`);
|
|
363
|
+
expect(el.getAttribute('variant')).to.equal('info');
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it('57. gray variant reflects attribute', async () => {
|
|
367
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="gray"></nile-badge>`);
|
|
368
|
+
expect(el.getAttribute('variant')).to.equal('gray');
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
it('58. brand variant reflects attribute', async () => {
|
|
372
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="brand"></nile-badge>`);
|
|
373
|
+
expect(el.getAttribute('variant')).to.equal('brand');
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
it('59. blue-light variant reflects attribute', async () => {
|
|
377
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="blue-light"></nile-badge>`);
|
|
378
|
+
expect(el.getAttribute('variant')).to.equal('blue-light');
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
it('60. blue variant reflects attribute', async () => {
|
|
382
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="blue"></nile-badge>`);
|
|
383
|
+
expect(el.getAttribute('variant')).to.equal('blue');
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
it('61. indigo variant reflects attribute', async () => {
|
|
387
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="indigo"></nile-badge>`);
|
|
388
|
+
expect(el.getAttribute('variant')).to.equal('indigo');
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
it('62. purple variant reflects attribute', async () => {
|
|
392
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="purple"></nile-badge>`);
|
|
393
|
+
expect(el.getAttribute('variant')).to.equal('purple');
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
it('63. pink variant reflects attribute', async () => {
|
|
397
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="pink"></nile-badge>`);
|
|
398
|
+
expect(el.getAttribute('variant')).to.equal('pink');
|
|
399
|
+
});
|
|
400
|
+
|
|
401
|
+
it('64. orange variant reflects attribute', async () => {
|
|
402
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="orange"></nile-badge>`);
|
|
403
|
+
expect(el.getAttribute('variant')).to.equal('orange');
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
it('65. gray-blue variant reflects attribute', async () => {
|
|
407
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="gray-blue"></nile-badge>`);
|
|
408
|
+
expect(el.getAttribute('variant')).to.equal('gray-blue');
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// === PILLTYPE VARIATIONS ===
|
|
412
|
+
it('66. badge-color pilltype reflects attribute', async () => {
|
|
413
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="badge-color"></nile-badge>`);
|
|
414
|
+
expect(el.getAttribute('pilltype')).to.equal('badge-color');
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
it('67. pill-outline pilltype reflects attribute', async () => {
|
|
418
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-outline"></nile-badge>`);
|
|
419
|
+
expect(el.getAttribute('pilltype')).to.equal('pill-outline');
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it('68. pill-color pilltype reflects attribute', async () => {
|
|
423
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-color"></nile-badge>`);
|
|
424
|
+
expect(el.getAttribute('pilltype')).to.equal('pill-color');
|
|
425
|
+
});
|
|
426
|
+
|
|
427
|
+
// === DYNAMIC PILLTYPE UPDATES ===
|
|
428
|
+
it('69. should switch from badge-color to pill-outline', async () => {
|
|
429
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="badge-color"></nile-badge>`);
|
|
430
|
+
el.pilltype = 'pill-outline';
|
|
431
|
+
await el.updateComplete;
|
|
432
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
433
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
434
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.false;
|
|
435
|
+
});
|
|
436
|
+
|
|
437
|
+
it('70. should switch from pill-outline to pill-color', async () => {
|
|
438
|
+
const el = await fixture<NileBadge>(html`<nile-badge pilltype="pill-outline"></nile-badge>`);
|
|
439
|
+
el.pilltype = 'pill-color';
|
|
440
|
+
await el.updateComplete;
|
|
441
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
442
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.false;
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// === EACH VARIANT WITH ROUNDED ===
|
|
446
|
+
it('71. primary variant with rounded', async () => {
|
|
447
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary" rounded></nile-badge>`);
|
|
448
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
449
|
+
expect(span!.classList.contains('badge--primary')).to.be.true;
|
|
450
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
it('72. success variant with rounded', async () => {
|
|
454
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success" rounded></nile-badge>`);
|
|
455
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
456
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
457
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
it('73. error variant with rounded', async () => {
|
|
461
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="error" rounded></nile-badge>`);
|
|
462
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
463
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
464
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
it('74. warning variant with rounded', async () => {
|
|
468
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="warning" rounded></nile-badge>`);
|
|
469
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
470
|
+
expect(span!.classList.contains('badge--warning')).to.be.true;
|
|
471
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
it('75. info variant with rounded', async () => {
|
|
475
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="info" rounded></nile-badge>`);
|
|
476
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
477
|
+
expect(span!.classList.contains('badge--info')).to.be.true;
|
|
478
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
479
|
+
});
|
|
480
|
+
|
|
481
|
+
// === EACH VARIANT WITH PILL-OUTLINE ===
|
|
482
|
+
it('76. primary with pill-outline', async () => {
|
|
483
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary" pilltype="pill-outline"></nile-badge>`);
|
|
484
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
485
|
+
expect(span!.classList.contains('badge--primary')).to.be.true;
|
|
486
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
487
|
+
expect(span!.classList.contains('badge--rounded')).to.be.true;
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
it('77. success with pill-outline', async () => {
|
|
491
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success" pilltype="pill-outline"></nile-badge>`);
|
|
492
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
493
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
494
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
it('78. error with pill-outline', async () => {
|
|
498
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="error" pilltype="pill-outline"></nile-badge>`);
|
|
499
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
500
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
501
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
it('79. warning with pill-outline', async () => {
|
|
505
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="warning" pilltype="pill-outline"></nile-badge>`);
|
|
506
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
507
|
+
expect(span!.classList.contains('badge--warning')).to.be.true;
|
|
508
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
it('80. info with pill-outline', async () => {
|
|
512
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="info" pilltype="pill-outline"></nile-badge>`);
|
|
513
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
514
|
+
expect(span!.classList.contains('badge--info')).to.be.true;
|
|
515
|
+
expect(span!.classList.contains('badge--pill-outline')).to.be.true;
|
|
516
|
+
});
|
|
517
|
+
|
|
518
|
+
// === EACH VARIANT WITH BADGE-COLOR ===
|
|
519
|
+
it('81. primary with badge-color', async () => {
|
|
520
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="primary" pilltype="badge-color"></nile-badge>`);
|
|
521
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
522
|
+
expect(span!.classList.contains('badge--primary')).to.be.true;
|
|
523
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
it('82. success with badge-color', async () => {
|
|
527
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="success" pilltype="badge-color"></nile-badge>`);
|
|
528
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
529
|
+
expect(span!.classList.contains('badge--success')).to.be.true;
|
|
530
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
it('83. blue with badge-color', async () => {
|
|
534
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="blue" pilltype="badge-color"></nile-badge>`);
|
|
535
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
536
|
+
expect(span!.classList.contains('badge--blue')).to.be.true;
|
|
537
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
538
|
+
});
|
|
539
|
+
|
|
540
|
+
it('84. indigo with badge-color', async () => {
|
|
541
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="indigo" pilltype="badge-color"></nile-badge>`);
|
|
542
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
543
|
+
expect(span!.classList.contains('badge--indigo')).to.be.true;
|
|
544
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
it('85. purple with badge-color', async () => {
|
|
548
|
+
const el = await fixture<NileBadge>(html`<nile-badge variant="purple" pilltype="badge-color"></nile-badge>`);
|
|
549
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
550
|
+
expect(span!.classList.contains('badge--purple')).to.be.true;
|
|
551
|
+
expect(span!.classList.contains('badge--badge-color')).to.be.true;
|
|
552
|
+
});
|
|
553
|
+
|
|
554
|
+
// === MULTIPLE DYNAMIC UPDATES ===
|
|
555
|
+
it('86. should cycle through all pilltypes', async () => {
|
|
556
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
557
|
+
const pilltypes: Array<'badge-color' | 'pill-outline' | 'pill-color'> = ['badge-color', 'pill-outline', 'pill-color'];
|
|
558
|
+
for (const pt of pilltypes) {
|
|
559
|
+
el.pilltype = pt;
|
|
560
|
+
await el.updateComplete;
|
|
561
|
+
expect(el.pilltype).to.equal(pt);
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
it('87. should handle setting variant to each value', async () => {
|
|
566
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
567
|
+
const variants: Array<'primary' | 'success' | 'normal' | 'warning' | 'error' | 'info' | 'gray' | 'brand'> = ['primary', 'success', 'normal', 'warning', 'error', 'info', 'gray', 'brand'];
|
|
568
|
+
for (const v of variants) {
|
|
569
|
+
el.variant = v;
|
|
570
|
+
await el.updateComplete;
|
|
571
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
572
|
+
expect(span!.classList.contains(`badge--${v}`)).to.be.true;
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// === SLOT STRUCTURE ===
|
|
577
|
+
it('88. slot should be inside span', async () => {
|
|
578
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
579
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
580
|
+
const slot = span!.querySelector('slot');
|
|
581
|
+
expect(slot).to.exist;
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
// === ELEMENT INSTANCE ===
|
|
585
|
+
it('89. should be instance of NileBadge', async () => {
|
|
586
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
587
|
+
expect(el).to.be.instanceOf(NileBadge);
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
it('90. should have correct tag name', async () => {
|
|
591
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
592
|
+
expect(el.tagName.toLowerCase()).to.equal('nile-badge');
|
|
593
|
+
});
|
|
594
|
+
|
|
595
|
+
// === ATTRIBUTE SETTING ===
|
|
596
|
+
it('91. should set variant via setAttribute', async () => {
|
|
597
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
598
|
+
el.setAttribute('variant', 'error');
|
|
599
|
+
await el.updateComplete;
|
|
600
|
+
expect(el.variant).to.equal('error');
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
it('92. should set rounded via setAttribute', async () => {
|
|
604
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
605
|
+
el.setAttribute('rounded', '');
|
|
606
|
+
await el.updateComplete;
|
|
607
|
+
expect(el.rounded).to.be.true;
|
|
608
|
+
});
|
|
609
|
+
|
|
610
|
+
it('93. should remove rounded attribute', async () => {
|
|
611
|
+
const el = await fixture<NileBadge>(html`<nile-badge rounded></nile-badge>`);
|
|
612
|
+
el.removeAttribute('rounded');
|
|
613
|
+
await el.updateComplete;
|
|
614
|
+
expect(el.rounded).to.be.false;
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
it('94. should set pilltype via setAttribute', async () => {
|
|
618
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
619
|
+
el.setAttribute('pilltype', 'pill-outline');
|
|
620
|
+
await el.updateComplete;
|
|
621
|
+
expect(el.pilltype).to.equal('pill-outline');
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// === STYLES ===
|
|
625
|
+
it('95. should have static styles', async () => {
|
|
626
|
+
expect(NileBadge.styles).to.exist;
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// === RENDERING STRESS ===
|
|
630
|
+
it('96. should render consistently after multiple rapid updates', async () => {
|
|
631
|
+
const el = await fixture<NileBadge>(html`<nile-badge></nile-badge>`);
|
|
632
|
+
el.variant = 'primary';
|
|
633
|
+
el.variant = 'success';
|
|
634
|
+
el.variant = 'error';
|
|
635
|
+
await el.updateComplete;
|
|
636
|
+
const span = el.shadowRoot!.querySelector('span');
|
|
637
|
+
expect(span!.classList.contains('badge--error')).to.be.true;
|
|
638
|
+
});
|
|
639
|
+
|
|
640
|
+
it('97. should render long text content', async () => {
|
|
641
|
+
const longText = 'A'.repeat(1000);
|
|
642
|
+
const el = await fixture<NileBadge>(html`<nile-badge>${longText}</nile-badge>`);
|
|
643
|
+
expect(el.textContent!.trim()).to.equal(longText);
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
it('98. should render special characters', async () => {
|
|
647
|
+
const el = await fixture<NileBadge>(html`<nile-badge><script></nile-badge>`);
|
|
648
|
+
expect(el.textContent).to.contain('<script>');
|
|
649
|
+
});
|
|
650
|
+
|
|
651
|
+
it('99. should handle numeric content', async () => {
|
|
652
|
+
const el = await fixture<NileBadge>(html`<nile-badge>42</nile-badge>`);
|
|
653
|
+
expect(el.textContent!.trim()).to.equal('42');
|
|
654
|
+
});
|
|
655
|
+
|
|
656
|
+
it('100. should handle unicode content', async () => {
|
|
657
|
+
const el = await fixture<NileBadge>(html`<nile-badge>\u2713 Done</nile-badge>`);
|
|
658
|
+
expect(el.textContent).to.contain('\u2713');
|
|
659
|
+
});
|
|
660
|
+
});
|