From af586fe7545ed1bd280ac3a77c27a7fa5a6b3930 Mon Sep 17 00:00:00 2001 From: shleewhite Date: Fri, 24 Oct 2025 15:13:26 -0400 Subject: [PATCH 01/43] feat: run codemod to convert tests to gjs --- showcase/package.json | 6 +- .../{index-test.js => index-test.gjs} | 235 ++++++++++-------- .../{td-test.js => td-test.gjs} | 18 +- .../{th-sort-test.js => th-sort-test.gjs} | 46 ++-- .../{th-test.js => th-test.gjs} | 88 ++----- .../{tr-test.js => tr-test.gjs} | 57 ++--- .../alert/{index-test.js => index-test.gjs} | 124 ++++----- .../{copyright-test.js => copyright-test.gjs} | 8 +- .../{index-test.js => index-test.gjs} | 18 +- .../{item-test.js => item-test.gjs} | 6 +- ...gal-links-test.js => legal-links-test.gjs} | 19 +- .../{link-test.js => link-test.gjs} | 18 +- ...atus-link-test.js => status-link-test.gjs} | 36 ++- .../{index-test.js => index-test.gjs} | 60 ++--- .../{home-link-test.js => home-link-test.gjs} | 32 +-- .../{index-test.js => index-test.gjs} | 80 +++--- .../{index-test.js => index-test.gjs} | 99 +++----- .../{back-link-test.js => back-link-test.gjs} | 14 +- .../list/{index-test.js => index-test.gjs} | 18 +- .../list/{item-test.js => item-test.gjs} | 10 +- .../list/{link-test.js => link-test.gjs} | 27 +- .../portal/{index-test.js => index-test.gjs} | 91 +++---- .../{body-test.js => body-test.gjs} | 14 +- .../{footer-test.js => footer-test.gjs} | 20 +- .../{header-test.js => header-test.gjs} | 12 +- .../{index-test.js => index-test.gjs} | 48 ++-- .../{media-test.js => media-test.gjs} | 8 +- .../{index-test.js => index-test.gjs} | 16 +- .../badge/{index-test.js => index-test.gjs} | 20 +- .../{index-test.js => index-test.gjs} | 14 +- .../{item-test.js => item-test.gjs} | 14 +- ...truncation-test.js => truncation-test.gjs} | 14 +- .../{index-test.js => index-test.gjs} | 15 +- .../button/{index-test.js => index-test.gjs} | 50 ++-- .../{container-test.js => container-test.gjs} | 30 +-- .../{index-test.js => index-test.gjs} | 210 ++++++++-------- ...scription-test.js => description-test.gjs} | 6 +- ...on-test.js => full-screen-button-test.gjs} | 8 +- .../{title-test.js => title-test.gjs} | 10 +- .../button/{index-test.js => index-test.gjs} | 35 ++- .../snippet/{index-test.js => index-test.gjs} | 23 +- .../{body-test.js => body-test.gjs} | 18 +- ...scription-test.js => description-test.gjs} | 18 +- .../{footer-test.js => footer-test.gjs} | 32 +-- .../{header-test.js => header-test.gjs} | 64 ++--- .../{overlay-test.js => overlay-test.gjs} | 4 +- .../{wrapper-test.js => wrapper-test.gjs} | 30 ++- .../{index-test.js => index-test.gjs} | 85 +++---- .../{index-test.js => index-test.gjs} | 6 +- .../{index-test.js => index-test.gjs} | 143 +++++------ .../{checkbox-test.js => checkbox-test.gjs} | 20 +- .../{checkmark-test.js => checkmark-test.gjs} | 22 +- .../{copy-item-test.js => copy-item-test.gjs} | 6 +- ...scription-test.js => description-test.gjs} | 6 +- .../{generic-test.js => generic-test.gjs} | 6 +- ...teractive-test.js => interactive-test.gjs} | 50 ++-- .../{radio-test.js => radio-test.gjs} | 20 +- .../{separator-test.js => separator-test.gjs} | 8 +- .../{title-test.js => title-test.gjs} | 6 +- .../{button-test.js => button-test.gjs} | 32 +-- .../toggle/{icon-test.js => icon-test.gjs} | 37 ++- .../flyout/{index-test.js => index-test.gjs} | 134 +++++----- .../{index-test.js => index-test.gjs} | 37 +-- .../checkbox/{base-test.js => base-test.gjs} | 6 +- .../{field-test.js => field-test.gjs} | 18 +- .../{group-test.js => group-test.gjs} | 30 +-- .../divider/{index-test.js => index-test.gjs} | 8 +- .../error/{index-test.js => index-test.gjs} | 14 +- .../field/{index-test.js => index-test.gjs} | 40 +-- .../{index-test.js => index-test.gjs} | 24 +- .../{base-test.js => base-test.gjs} | 6 +- .../{field-test.js => field-test.gjs} | 32 +-- .../footer/{index-test.js => index-test.gjs} | 10 +- .../{index-test.js => index-test.gjs} | 6 +- .../header/{index-test.js => index-test.gjs} | 10 +- .../title/{index-test.js => index-test.gjs} | 16 +- .../{index-test.js => index-test.gjs} | 12 +- .../form/{index-test.js => index-test.gjs} | 18 +- ...button-test.js => add-row-button-test.gjs} | 12 +- ...ton-test.js => delete-row-button-test.gjs} | 28 +-- .../{field-test.js => field-test.gjs} | 78 +++--- .../{generic-test.js => generic-test.gjs} | 20 +- .../{index-test.js => index-test.gjs} | 71 ++---- .../label/{index-test.js => index-test.gjs} | 26 +- .../legend/{index-test.js => index-test.gjs} | 18 +- .../{base-test.js => base-test.gjs} | 22 +- .../{field-test.js => field-test.gjs} | 56 ++--- .../{group-test.js => group-test.gjs} | 52 ++-- .../{index-test.js => index-test.gjs} | 28 +-- .../radio/{base-test.js => base-test.gjs} | 4 +- .../radio/{field-test.js => field-test.gjs} | 22 +- .../radio/{group-test.js => group-test.gjs} | 34 +-- .../header/{index-test.js => index-test.gjs} | 12 +- .../section/{index-test.js => index-test.gjs} | 12 +- .../{index-test.js => index-test.gjs} | 14 +- .../item/{index-test.js => index-test.gjs} | 10 +- .../select/{base-test.js => base-test.gjs} | 12 +- .../select/{field-test.js => field-test.gjs} | 38 +-- .../multiple/{base-test.js => base-test.gjs} | 33 +-- .../{field-test.js => field-test.gjs} | 31 ++- .../single/{base-test.js => base-test.gjs} | 23 +- .../single/{field-test.js => field-test.gjs} | 31 ++- .../{base-test.js => base-test.gjs} | 20 +- .../{field-test.js => field-test.gjs} | 56 ++--- .../textarea/{base-test.js => base-test.gjs} | 14 +- .../{field-test.js => field-test.gjs} | 54 ++-- .../toggle/{base-test.js => base-test.gjs} | 6 +- .../toggle/{field-test.js => field-test.gjs} | 22 +- .../toggle/{group-test.js => group-test.gjs} | 22 +- .../{index-test.js => index-test.gjs} | 10 +- .../{index-test.js => index-test.gjs} | 30 +-- .../icon/{index-test.js => index-test.gjs} | 42 ++-- .../{index-test.js => index-test.gjs} | 29 +-- .../flex/{index-test.js => index-test.gjs} | 35 +-- .../flex/{item-test.js => item-test.gjs} | 35 +-- .../grid/{index-test.js => index-test.gjs} | 39 +-- .../grid/{item-test.js => item-test.gjs} | 21 +- .../link/{inline-test.js => inline-test.gjs} | 24 +- ...standalone-test.js => standalone-test.gjs} | 36 +-- .../{index-test.js => index-test.gjs} | 53 ++-- .../modal/{index-test.js => index-test.gjs} | 143 +++++------ .../{index-test.js => index-test.gjs} | 20 +- .../{compact-test.js => compact-test.gjs} | 65 ++--- .../{info-test.js => info-test.gjs} | 20 +- .../nav/{arrow-test.js => arrow-test.gjs} | 46 ++-- .../{ellipsis-test.js => ellipsis-test.gjs} | 8 +- .../nav/{number-test.js => number-test.gjs} | 30 +-- .../{numbered-test.js => numbered-test.gjs} | 162 ++++++------ ...elector-test.js => size-selector-test.gjs} | 56 ++--- .../{index-test.js => index-test.gjs} | 121 +++++---- .../reveal/{index-test.js => index-test.gjs} | 50 ++-- .../{bubble-test.js => bubble-test.gjs} | 56 ++--- .../{index-test.js => index-test.gjs} | 53 ++-- .../{toggle-test.js => toggle-test.gjs} | 46 ++-- .../{index-test.js => index-test.gjs} | 10 +- .../{index-test.js => index-test.gjs} | 10 +- .../side-nav/{base-test.js => base-test.gjs} | 12 +- .../{home-link-test.js => home-link-test.gjs} | 10 +- ...on-button-test.js => icon-button-test.gjs} | 14 +- .../header/{index-test.js => index-test.gjs} | 12 +- .../{index-test.js => index-test.gjs} | 116 ++++----- .../{back-link-test.js => back-link-test.gjs} | 12 +- .../list/{index-test.js => index-test.gjs} | 18 +- .../list/{item-test.js => item-test.gjs} | 12 +- .../list/{link-test.js => link-test.gjs} | 22 +- .../portal/{index-test.js => index-test.gjs} | 84 +++---- .../{list-step-test.js => list-step-test.gjs} | 89 +++---- .../stepper/{list-test.js => list-test.gjs} | 22 +- .../{nav-panel-test.js => nav-panel-test.gjs} | 14 +- .../{nav-step-test.js => nav-step-test.gjs} | 37 ++- .../hds/stepper/{nav-test.js => nav-test.gjs} | 80 ++---- ...icator-test.js => step-indicator-test.gjs} | 16 +- ...icator-test.js => task-indicator-test.gjs} | 14 +- .../hds/table/{td-test.js => td-test.gjs} | 8 +- .../{th-sort-test.js => th-sort-test.gjs} | 36 +-- .../hds/table/{th-test.js => th-test.gjs} | 25 +- .../hds/table/{tr-test.js => tr-test.gjs} | 26 +- .../tabs/{index-test.js => index-test.gjs} | 87 +++---- .../hds/tag/{index-test.js => index-test.gjs} | 37 ++- .../hds/text/{body-test.js => body-test.gjs} | 14 +- .../hds/text/{code-test.js => code-test.gjs} | 14 +- .../{display-test.js => display-test.gjs} | 18 +- .../text/{index-test.js => index-test.gjs} | 30 +-- .../time/{index-test.js => index-test.gjs} | 147 ++++++----- .../toast/{index-test.js => index-test.gjs} | 6 +- ...button-test.js => tooltip-button-test.gjs} | 41 ++- ...fier-test.js => tooltip-modifier-test.gjs} | 4 +- .../helpers/{hds-t-test.js => hds-t-test.gjs} | 10 +- ...test.js => hds-anchored-position-test.gjs} | 19 +- ...ipboard-test.js => hds-clipboard-test.gjs} | 101 ++------ ...nt-test.js => hds-register-event-test.gjs} | 6 +- 171 files changed, 2831 insertions(+), 3224 deletions(-) rename showcase/tests/integration/components/hds/accordion/{index-test.js => index-test.gjs} (76%) rename showcase/tests/integration/components/hds/advanced-table/{td-test.js => td-test.gjs} (78%) rename showcase/tests/integration/components/hds/advanced-table/{th-sort-test.js => th-sort-test.gjs} (75%) rename showcase/tests/integration/components/hds/advanced-table/{th-test.js => th-test.gjs} (75%) rename showcase/tests/integration/components/hds/advanced-table/{tr-test.js => tr-test.gjs} (72%) rename showcase/tests/integration/components/hds/alert/{index-test.js => index-test.gjs} (73%) rename showcase/tests/integration/components/hds/app-footer/{copyright-test.js => copyright-test.gjs} (74%) rename showcase/tests/integration/components/hds/app-footer/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/app-footer/{item-test.js => item-test.gjs} (74%) rename showcase/tests/integration/components/hds/app-footer/{legal-links-test.js => legal-links-test.gjs} (81%) rename showcase/tests/integration/components/hds/app-footer/{link-test.js => link-test.gjs} (70%) rename showcase/tests/integration/components/hds/app-footer/{status-link-test.js => status-link-test.gjs} (77%) rename showcase/tests/integration/components/hds/app-frame/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/app-header/{home-link-test.js => home-link-test.gjs} (73%) rename showcase/tests/integration/components/hds/app-header/{index-test.js => index-test.gjs} (75%) rename showcase/tests/integration/components/hds/app-side-nav/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/app-side-nav/list/{back-link-test.js => back-link-test.gjs} (78%) rename showcase/tests/integration/components/hds/app-side-nav/list/{index-test.js => index-test.gjs} (71%) rename showcase/tests/integration/components/hds/app-side-nav/list/{item-test.js => item-test.gjs} (74%) rename showcase/tests/integration/components/hds/app-side-nav/list/{link-test.js => link-test.gjs} (75%) rename showcase/tests/integration/components/hds/app-side-nav/portal/{index-test.js => index-test.gjs} (65%) rename showcase/tests/integration/components/hds/application-state/{body-test.js => body-test.gjs} (75%) rename showcase/tests/integration/components/hds/application-state/{footer-test.js => footer-test.gjs} (72%) rename showcase/tests/integration/components/hds/application-state/{header-test.js => header-test.gjs} (66%) rename showcase/tests/integration/components/hds/application-state/{index-test.js => index-test.gjs} (76%) rename showcase/tests/integration/components/hds/application-state/{media-test.js => media-test.gjs} (77%) rename showcase/tests/integration/components/hds/badge-count/{index-test.js => index-test.gjs} (71%) rename showcase/tests/integration/components/hds/badge/{index-test.js => index-test.gjs} (70%) rename showcase/tests/integration/components/hds/breadcrumb/{index-test.js => index-test.gjs} (73%) rename showcase/tests/integration/components/hds/breadcrumb/{item-test.js => item-test.gjs} (75%) rename showcase/tests/integration/components/hds/breadcrumb/{truncation-test.js => truncation-test.gjs} (76%) rename showcase/tests/integration/components/hds/button-set/{index-test.js => index-test.gjs} (63%) rename showcase/tests/integration/components/hds/button/{index-test.js => index-test.gjs} (73%) rename showcase/tests/integration/components/hds/card/{container-test.js => container-test.gjs} (80%) rename showcase/tests/integration/components/hds/code-block/{index-test.js => index-test.gjs} (68%) rename showcase/tests/integration/components/hds/code-editor/{description-test.js => description-test.gjs} (74%) rename showcase/tests/integration/components/hds/code-editor/{full-screen-button-test.js => full-screen-button-test.gjs} (81%) rename showcase/tests/integration/components/hds/code-editor/{title-test.js => title-test.gjs} (74%) rename showcase/tests/integration/components/hds/copy/button/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/copy/snippet/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/dialog-primitive/{body-test.js => body-test.gjs} (76%) rename showcase/tests/integration/components/hds/dialog-primitive/{description-test.js => description-test.gjs} (76%) rename showcase/tests/integration/components/hds/dialog-primitive/{footer-test.js => footer-test.gjs} (66%) rename showcase/tests/integration/components/hds/dialog-primitive/{header-test.js => header-test.gjs} (74%) rename showcase/tests/integration/components/hds/dialog-primitive/{overlay-test.js => overlay-test.gjs} (80%) rename showcase/tests/integration/components/hds/dialog-primitive/{wrapper-test.js => wrapper-test.gjs} (65%) rename showcase/tests/integration/components/hds/disclosure-primitive/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/dismiss-button/{index-test.js => index-test.gjs} (72%) rename showcase/tests/integration/components/hds/dropdown/{index-test.js => index-test.gjs} (81%) rename showcase/tests/integration/components/hds/dropdown/list-item/{checkbox-test.js => checkbox-test.gjs} (72%) rename showcase/tests/integration/components/hds/dropdown/list-item/{checkmark-test.js => checkmark-test.gjs} (70%) rename showcase/tests/integration/components/hds/dropdown/list-item/{copy-item-test.js => copy-item-test.gjs} (84%) rename showcase/tests/integration/components/hds/dropdown/list-item/{description-test.js => description-test.gjs} (83%) rename showcase/tests/integration/components/hds/dropdown/list-item/{generic-test.js => generic-test.gjs} (82%) rename showcase/tests/integration/components/hds/dropdown/list-item/{interactive-test.js => interactive-test.gjs} (76%) rename showcase/tests/integration/components/hds/dropdown/list-item/{radio-test.js => radio-test.gjs} (74%) rename showcase/tests/integration/components/hds/dropdown/list-item/{separator-test.js => separator-test.gjs} (79%) rename showcase/tests/integration/components/hds/dropdown/list-item/{title-test.js => title-test.gjs} (85%) rename showcase/tests/integration/components/hds/dropdown/toggle/{button-test.js => button-test.gjs} (77%) rename showcase/tests/integration/components/hds/dropdown/toggle/{icon-test.js => icon-test.gjs} (73%) rename showcase/tests/integration/components/hds/flyout/{index-test.js => index-test.gjs} (76%) rename showcase/tests/integration/components/hds/form/character-count/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/form/checkbox/{base-test.js => base-test.gjs} (76%) rename showcase/tests/integration/components/hds/form/checkbox/{field-test.js => field-test.gjs} (83%) rename showcase/tests/integration/components/hds/form/checkbox/{group-test.js => group-test.gjs} (90%) rename showcase/tests/integration/components/hds/form/divider/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/form/error/{index-test.js => index-test.gjs} (70%) rename showcase/tests/integration/components/hds/form/field/{index-test.js => index-test.gjs} (87%) rename showcase/tests/integration/components/hds/form/fieldset/{index-test.js => index-test.gjs} (83%) rename showcase/tests/integration/components/hds/form/file-input/{base-test.js => base-test.gjs} (75%) rename showcase/tests/integration/components/hds/form/file-input/{field-test.js => field-test.gjs} (83%) rename showcase/tests/integration/components/hds/form/footer/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/form/header/description/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/form/header/{index-test.js => index-test.gjs} (75%) rename showcase/tests/integration/components/hds/form/header/title/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/form/helper-text/{index-test.js => index-test.gjs} (70%) rename showcase/tests/integration/components/hds/form/{index-test.js => index-test.gjs} (88%) rename showcase/tests/integration/components/hds/form/key-value-inputs/{add-row-button-test.js => add-row-button-test.gjs} (74%) rename showcase/tests/integration/components/hds/form/key-value-inputs/{delete-row-button-test.js => delete-row-button-test.gjs} (79%) rename showcase/tests/integration/components/hds/form/key-value-inputs/{field-test.js => field-test.gjs} (79%) rename showcase/tests/integration/components/hds/form/key-value-inputs/{generic-test.js => generic-test.gjs} (72%) rename showcase/tests/integration/components/hds/form/key-value-inputs/{index-test.js => index-test.gjs} (90%) rename showcase/tests/integration/components/hds/form/label/{index-test.js => index-test.gjs} (70%) rename showcase/tests/integration/components/hds/form/legend/{index-test.js => index-test.gjs} (71%) rename showcase/tests/integration/components/hds/form/masked-input/{base-test.js => base-test.gjs} (79%) rename showcase/tests/integration/components/hds/form/masked-input/{field-test.js => field-test.gjs} (80%) rename showcase/tests/integration/components/hds/form/radio-card/{group-test.js => group-test.gjs} (82%) rename showcase/tests/integration/components/hds/form/radio-card/{index-test.js => index-test.gjs} (80%) rename showcase/tests/integration/components/hds/form/radio/{base-test.js => base-test.gjs} (76%) rename showcase/tests/integration/components/hds/form/radio/{field-test.js => field-test.gjs} (86%) rename showcase/tests/integration/components/hds/form/radio/{group-test.js => group-test.gjs} (91%) rename showcase/tests/integration/components/hds/form/section/header/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/form/section/{index-test.js => index-test.gjs} (83%) rename showcase/tests/integration/components/hds/form/section/multi-field-group/{index-test.js => index-test.gjs} (72%) rename showcase/tests/integration/components/hds/form/section/multi-field-group/item/{index-test.js => index-test.gjs} (77%) rename showcase/tests/integration/components/hds/form/select/{base-test.js => base-test.gjs} (73%) rename showcase/tests/integration/components/hds/form/select/{field-test.js => field-test.gjs} (82%) rename showcase/tests/integration/components/hds/form/super-select/multiple/{base-test.js => base-test.gjs} (76%) rename showcase/tests/integration/components/hds/form/super-select/multiple/{field-test.js => field-test.gjs} (81%) rename showcase/tests/integration/components/hds/form/super-select/single/{base-test.js => base-test.gjs} (73%) rename showcase/tests/integration/components/hds/form/super-select/single/{field-test.js => field-test.gjs} (81%) rename showcase/tests/integration/components/hds/form/text-input/{base-test.js => base-test.gjs} (77%) rename showcase/tests/integration/components/hds/form/text-input/{field-test.js => field-test.gjs} (80%) rename showcase/tests/integration/components/hds/form/textarea/{base-test.js => base-test.gjs} (74%) rename showcase/tests/integration/components/hds/form/textarea/{field-test.js => field-test.gjs} (80%) rename showcase/tests/integration/components/hds/form/toggle/{base-test.js => base-test.gjs} (80%) rename showcase/tests/integration/components/hds/form/toggle/{field-test.js => field-test.gjs} (87%) rename showcase/tests/integration/components/hds/form/toggle/{group-test.js => group-test.gjs} (90%) rename showcase/tests/integration/components/hds/form/visibility-toggle/{index-test.js => index-test.gjs} (73%) rename showcase/tests/integration/components/hds/icon-tile/{index-test.js => index-test.gjs} (76%) rename showcase/tests/integration/components/hds/icon/{index-test.js => index-test.gjs} (75%) rename showcase/tests/integration/components/hds/interactive/{index-test.js => index-test.gjs} (72%) rename showcase/tests/integration/components/hds/layout/flex/{index-test.js => index-test.gjs} (80%) rename showcase/tests/integration/components/hds/layout/flex/{item-test.js => item-test.gjs} (84%) rename showcase/tests/integration/components/hds/layout/grid/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/layout/grid/{item-test.js => item-test.gjs} (72%) rename showcase/tests/integration/components/hds/link/{inline-test.js => inline-test.gjs} (76%) rename showcase/tests/integration/components/hds/link/{standalone-test.js => standalone-test.gjs} (75%) rename showcase/tests/integration/components/hds/menu-primitive/{index-test.js => index-test.gjs} (81%) rename showcase/tests/integration/components/hds/modal/{index-test.js => index-test.gjs} (77%) rename showcase/tests/integration/components/hds/page-header/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/pagination/{compact-test.js => compact-test.gjs} (78%) rename showcase/tests/integration/components/hds/pagination/{info-test.js => info-test.gjs} (63%) rename showcase/tests/integration/components/hds/pagination/nav/{arrow-test.js => arrow-test.gjs} (76%) rename showcase/tests/integration/components/hds/pagination/nav/{ellipsis-test.js => ellipsis-test.gjs} (74%) rename showcase/tests/integration/components/hds/pagination/nav/{number-test.js => number-test.gjs} (76%) rename showcase/tests/integration/components/hds/pagination/{numbered-test.js => numbered-test.gjs} (81%) rename showcase/tests/integration/components/hds/pagination/{size-selector-test.js => size-selector-test.gjs} (71%) rename showcase/tests/integration/components/hds/popover-primitive/{index-test.js => index-test.gjs} (84%) rename showcase/tests/integration/components/hds/reveal/{index-test.js => index-test.gjs} (80%) rename showcase/tests/integration/components/hds/rich-tooltip/{bubble-test.js => bubble-test.gjs} (77%) rename showcase/tests/integration/components/hds/rich-tooltip/{index-test.js => index-test.gjs} (86%) rename showcase/tests/integration/components/hds/rich-tooltip/{toggle-test.js => toggle-test.gjs} (80%) rename showcase/tests/integration/components/hds/segmented-group/{index-test.js => index-test.gjs} (81%) rename showcase/tests/integration/components/hds/separator/{index-test.js => index-test.gjs} (78%) rename showcase/tests/integration/components/hds/side-nav/{base-test.js => base-test.gjs} (83%) rename showcase/tests/integration/components/hds/side-nav/header/{home-link-test.js => home-link-test.gjs} (75%) rename showcase/tests/integration/components/hds/side-nav/header/{icon-button-test.js => icon-button-test.gjs} (72%) rename showcase/tests/integration/components/hds/side-nav/header/{index-test.js => index-test.gjs} (77%) rename showcase/tests/integration/components/hds/side-nav/{index-test.js => index-test.gjs} (83%) rename showcase/tests/integration/components/hds/side-nav/list/{back-link-test.js => back-link-test.gjs} (78%) rename showcase/tests/integration/components/hds/side-nav/list/{index-test.js => index-test.gjs} (81%) rename showcase/tests/integration/components/hds/side-nav/list/{item-test.js => item-test.gjs} (77%) rename showcase/tests/integration/components/hds/side-nav/list/{link-test.js => link-test.gjs} (76%) rename showcase/tests/integration/components/hds/side-nav/portal/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/stepper/{list-step-test.js => list-step-test.gjs} (77%) rename showcase/tests/integration/components/hds/stepper/{list-test.js => list-test.gjs} (74%) rename showcase/tests/integration/components/hds/stepper/{nav-panel-test.js => nav-panel-test.gjs} (85%) rename showcase/tests/integration/components/hds/stepper/{nav-step-test.js => nav-step-test.gjs} (90%) rename showcase/tests/integration/components/hds/stepper/{nav-test.js => nav-test.gjs} (79%) rename showcase/tests/integration/components/hds/stepper/{step-indicator-test.js => step-indicator-test.gjs} (73%) rename showcase/tests/integration/components/hds/stepper/{task-indicator-test.js => task-indicator-test.gjs} (73%) rename showcase/tests/integration/components/hds/table/{td-test.js => td-test.gjs} (71%) rename showcase/tests/integration/components/hds/table/{th-sort-test.js => th-sort-test.gjs} (76%) rename showcase/tests/integration/components/hds/table/{th-test.js => th-test.gjs} (75%) rename showcase/tests/integration/components/hds/table/{tr-test.js => tr-test.gjs} (73%) rename showcase/tests/integration/components/hds/tabs/{index-test.js => index-test.gjs} (94%) rename showcase/tests/integration/components/hds/tag/{index-test.js => index-test.gjs} (74%) rename showcase/tests/integration/components/hds/text/{body-test.js => body-test.gjs} (84%) rename showcase/tests/integration/components/hds/text/{code-test.js => code-test.gjs} (84%) rename showcase/tests/integration/components/hds/text/{display-test.js => display-test.gjs} (84%) rename showcase/tests/integration/components/hds/text/{index-test.js => index-test.gjs} (69%) rename showcase/tests/integration/components/hds/time/{index-test.js => index-test.gjs} (75%) rename showcase/tests/integration/components/hds/toast/{index-test.js => index-test.gjs} (79%) rename showcase/tests/integration/components/hds/tooltip/{tooltip-button-test.js => tooltip-button-test.gjs} (73%) rename showcase/tests/integration/components/hds/tooltip/{tooltip-modifier-test.js => tooltip-modifier-test.gjs} (87%) rename showcase/tests/integration/helpers/{hds-t-test.js => hds-t-test.gjs} (86%) rename showcase/tests/integration/modifiers/{hds-anchored-position-test.js => hds-anchored-position-test.gjs} (96%) rename showcase/tests/integration/modifiers/{hds-clipboard-test.js => hds-clipboard-test.gjs} (80%) rename showcase/tests/integration/modifiers/{hds-register-event-test.js => hds-register-event-test.gjs} (73%) diff --git a/showcase/package.json b/showcase/package.json index 471363afa66..709b7965412 100644 --- a/showcase/package.json +++ b/showcase/package.json @@ -131,5 +131,9 @@ }, "ember": { "edition": "octane" + }, + "exports": { + "./tests/*": "./tests/*", + "./*": "./app/*" } -} +} \ No newline at end of file diff --git a/showcase/tests/integration/components/hds/accordion/index-test.js b/showcase/tests/integration/components/hds/accordion/index-test.gjs similarity index 76% rename from showcase/tests/integration/components/hds/accordion/index-test.js rename to showcase/tests/integration/components/hds/accordion/index-test.gjs index 4ff330ab5ac..40a9df57f07 100644 --- a/showcase/tests/integration/components/hds/accordion/index-test.js +++ b/showcase/tests/integration/components/hds/accordion/index-test.gjs @@ -6,69 +6,79 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { click, render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Accordion from '@hashicorp/design-system-components/components/hds/accordion/index'; +import Item from '@hashicorp/design-system-components/components/hds/accordion/item/index'; +import { on } from '@ember/modifier'; module('Integration | Component | hds/accordion/index', function (hooks) { setupRenderingTest(hooks); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-accordion').hasClass('hds-accordion'); }); // CONTENT test('it renders the passed in Accordion Items', async function (assert) { - await render(hbs` - - - <:toggle>Item one - <:content>Content one - - - <:toggle>Item two - <:content>Content two - - - `); + await render( + , + ); assert.dom('.hds-accordion .hds-accordion-item').exists({ count: 2 }); }); test('it renders the passed in content in the Accordion Item', async function (assert) { - await render(hbs` - - - <:toggle>Item one - <:content>Content one - - - `); + await render( + , + ); await click('.hds-accordion-item__button'); assert.dom('#test-strong').exists().hasText('Item one'); assert.dom('#test-em').exists().hasText('Content one'); }); test('it renders a div when the @titleTag argument is not provided', async function (assert) { - await render(hbs` - - - <:toggle>Item one - <:content>Content one - - - `); + await render( + , + ); assert.dom('.hds-accordion-item__toggle-content').hasTagName('div'); }); test('it renders the custom title tag when the @titleTag argument is provided', async function (assert) { - await render(hbs` - - - <:toggle>Item one - <:content>Content one - - - `); + await render( + , + ); assert.dom('.hds-accordion-item__toggle-content').hasTagName('h2'); }); @@ -76,11 +86,11 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render the medium size as the default if no @size is declared', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-accordion').hasClass('hds-accordion--size-medium'); assert @@ -90,11 +100,11 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render the correct CSS size class depending on the @size', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-accordion').hasClass('hds-accordion--size-large'); assert @@ -104,12 +114,12 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render different CSS size classes when different @size arguments are provided', async function (assert) { await render( - hbs` - + , ); assert .dom('#test-accordion-item1') @@ -123,11 +133,11 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render the card type as the default if no @type is declared', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-accordion').hasClass('hds-accordion--type-card'); assert @@ -137,11 +147,11 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render the correct CSS type class depending on the @type', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-accordion').hasClass('hds-accordion--type-flush'); assert @@ -151,12 +161,12 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it should render different CSS type class when different @type arguments are provided', async function (assert) { await render( - hbs` - + , ); assert .dom('#test-accordion-item1') @@ -170,14 +180,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it displays the correct value for aria-expanded on the AccordionItem when closed vs open', async function (assert) { await render( - hbs` - + , ); assert .dom('.hds-accordion-item__button') @@ -190,14 +200,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('the AccordionItem toggle button has an aria-controls attribute with a value matching the DisclosurePrimitive content id', async function (assert) { await render( - hbs` - + , ); await click('.hds-accordion-item__button'); assert.dom('.hds-accordion-item__button').hasAttribute('aria-controls'); @@ -214,14 +224,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('the AccordionItem toggle has an aria-labelledby attribute set to the id of the toggle text by default', async function (assert) { await render( - hbs` - + , ); assert.dom('.hds-accordion-item__button').hasAttribute('aria-labelledby'); @@ -242,14 +252,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('the AccordionItem toggle has an aria-label attribute when the argument is passed', async function (assert) { await render( - hbs` - + , ); assert @@ -267,14 +277,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { test('it displays content initially when @isOpen is set to true', async function (assert) { await render( - hbs` - + , ); // Test content is displayed assert @@ -289,18 +299,21 @@ module('Integration | Component | hds/accordion/index', function (hooks) { // containsInteractive test('it displays the correct variant when containsInteractive is set to false vs. true', async function (assert) { await render( - hbs` - + , ); assert .dom('#test-contains-interactive--false') @@ -313,14 +326,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { // isStatic test('it does not show the toggle button when @isStatic is set to true, ', async function (assert) { await render( - hbs` - + , ); assert.dom('.hds-accordion-item--is-static').exists(); assert @@ -331,8 +344,8 @@ module('Integration | Component | hds/accordion/index', function (hooks) { // forceState test('it displays the correct content based on @forceState', async function (assert) { await render( - hbs` - + , ); // first item open at rendering assert @@ -376,14 +389,16 @@ module('Integration | Component | hds/accordion/index', function (hooks) { // close test('it should hide the content when an accordion item triggers `close`', async function (assert) { - await render(hbs` - - <:toggle>Item one - <:content as |c|> - - - - `); + await render( + , + ); await click('.hds-accordion-item__button'); assert.dom('.hds-accordion-item__content').exists(); @@ -400,12 +415,14 @@ module('Integration | Component | hds/accordion/index', function (hooks) { 'onClickToggle', () => (state = state === 'open' ? (state = 'close') : (state = 'open')), ); - await render(hbs` - - <:toggle>Item one - <:content>Content one - - `); + await render( + , + ); // closed by default assert.dom('.hds-accordion-item__content').doesNotExist(); // toggle to open diff --git a/showcase/tests/integration/components/hds/advanced-table/td-test.js b/showcase/tests/integration/components/hds/advanced-table/td-test.gjs similarity index 78% rename from showcase/tests/integration/components/hds/advanced-table/td-test.js rename to showcase/tests/integration/components/hds/advanced-table/td-test.gjs index 490dd38c43c..aed634a4b61 100644 --- a/showcase/tests/integration/components/hds/advanced-table/td-test.js +++ b/showcase/tests/integration/components/hds/advanced-table/td-test.gjs @@ -6,14 +6,14 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Td from "@hashicorp/design-system-components/components/hds/advanced-table/td"; module('Integration | Component | hds/advanced-table/td', function (hooks) { setupRenderingTest(hooks); test('it renders with a CSS class that matches the component name', async function (assert) { await render( - hbs``, + , ); assert .dom('#data-test-advanced-table-td') @@ -22,14 +22,14 @@ module('Integration | Component | hds/advanced-table/td', function (hooks) { test('it should render with the appropriate role', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-td').hasAttribute('role', 'gridcell'); }); test('it should render with the appropriate `@align` CSS class', async function (assert) { await render( - hbs``, + , ); assert .dom('#data-test-advanced-table-td') @@ -38,7 +38,7 @@ module('Integration | Component | hds/advanced-table/td', function (hooks) { test('it should render with the appropriate span information by default', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-td').hasNoAttribute('aria-rowspan'); @@ -51,11 +51,7 @@ module('Integration | Component | hds/advanced-table/td', function (hooks) { test('it should render with the appropriate span information when pass rowspan and colspan', async function (assert) { await render( - hbs``, + , ); assert @@ -74,7 +70,7 @@ module('Integration | Component | hds/advanced-table/td', function (hooks) { test('it should support splattributes', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-td').hasAttribute('lang', 'es'); }); diff --git a/showcase/tests/integration/components/hds/advanced-table/th-sort-test.js b/showcase/tests/integration/components/hds/advanced-table/th-sort-test.gjs similarity index 75% rename from showcase/tests/integration/components/hds/advanced-table/th-sort-test.js rename to showcase/tests/integration/components/hds/advanced-table/th-sort-test.gjs index 78d759adffe..2f425be4417 100644 --- a/showcase/tests/integration/components/hds/advanced-table/th-sort-test.js +++ b/showcase/tests/integration/components/hds/advanced-table/th-sort-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, click, focus, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import ThSort from "@hashicorp/design-system-components/components/hds/advanced-table/th-sort"; module( 'Integration | Component | hds/advanced-table/th-sort', @@ -14,7 +14,7 @@ module( setupRenderingTest(hooks); test('it renders with a CSS class that matches the component name', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -31,7 +31,7 @@ module( test('it renders text content yielded within the cell', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom( @@ -44,7 +44,7 @@ module( test('it should render with the appropriate `@align` CSS class', async function (assert) { await render( - hbs`Year`, + , ); assert .dom('#data-test-advanced-table-th-sort') @@ -55,7 +55,7 @@ module( test('if @sortOrder is not defined, the swap-vertical icon should be displayed', async function (assert) { await render( - hbs`Artist`, + , ); assert.dom('[data-test-icon="swap-vertical"]').exists(); @@ -63,13 +63,13 @@ module( test('if sorted, and `@sortOrder` is set, the correct icon should be displayed', async function (assert) { await render( - hbs`Artist`, + , ); assert.dom('[data-test-icon="arrow-up"]').exists(); await render( - hbs`Artist`, + , ); assert.dom('[data-test-icon="arrow-down"]').exists(); @@ -79,14 +79,14 @@ module( test('it should support splattributes', async function (assert) { await render( - hbs`Artist`, + , ); assert.dom('#data-test-advanced-table-th').hasAttribute('lang', 'es'); }); test('it has a role and it is set to columnheader by default', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -95,7 +95,7 @@ module( }); test('the default `scope` attribute can not be overwritten', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -105,7 +105,7 @@ module( test('if unsorted, the aria-sort attribute value should be set to none', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -114,7 +114,7 @@ module( }); test('if sorted, the aria-sort attribute value should reflect the direction', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -123,7 +123,7 @@ module( }); test('it renders the `aria-labelledby` attribute for the sort button with the correct IDs', async function (assert) { await render( - hbs`Artist`, + , ); const prefixLabel = this.element.querySelector( '#data-test-advanced-table-th-sort .hds-advanced-table__th-button-aria-label-hidden-segment:nth-of-type(1)', @@ -154,11 +154,7 @@ module( }); await render( - hbs``, + , ); assert.throws(function () { @@ -176,11 +172,7 @@ module( }); await render( - hbs``, + , ); assert.throws(function () { @@ -194,7 +186,7 @@ module( let isClicked = false; this.set('onClickSort', () => (isClicked = true)); await render( - hbs`Artist`, + , ); await click( '#data-test-advanced-table-th-sort .hds-advanced-table__th-button--sort', @@ -206,7 +198,7 @@ module( test('if @tooltip is undefined a tooltip button toggle should not be present', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -217,7 +209,7 @@ module( }); test('if @tooltip is defined a tooltip should be added to the table cell header', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -234,7 +226,7 @@ module( }); test('it renders the `aria-labelledby` attribute for the tooltip button with the correct IDs', async function (assert) { await render( - hbs`Artist`, + , ); let prefixLabel = this.element.querySelector( '#data-test-advanced-table-th-sort .hds-advanced-table__th-button-aria-label-hidden-segment', diff --git a/showcase/tests/integration/components/hds/advanced-table/th-test.js b/showcase/tests/integration/components/hds/advanced-table/th-test.gjs similarity index 75% rename from showcase/tests/integration/components/hds/advanced-table/th-test.js rename to showcase/tests/integration/components/hds/advanced-table/th-test.gjs index 69048fe5486..e42d8b7f388 100644 --- a/showcase/tests/integration/components/hds/advanced-table/th-test.js +++ b/showcase/tests/integration/components/hds/advanced-table/th-test.gjs @@ -6,16 +6,15 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, focus, click, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Th from "@hashicorp/design-system-components/components/hds/advanced-table/th"; +import AdvancedTable from "@hashicorp/design-system-components/components/hds/advanced-table/index"; module('Integration | Component | hds/advanced-table/th', function (hooks) { setupRenderingTest(hooks); test('it should render with a CSS class that matches the component name', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -27,9 +26,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it renders text content yielded within the cell (no tooltip)', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom( @@ -40,10 +37,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it renders text content yielded within the cell (with tooltip)', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom( @@ -56,9 +50,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it does not render an expand button by default', async function (assert) { await render( - hbs`Artist`, + , ); assert.dom('.hds-advanced-table__th-button--expand').doesNotExist(); @@ -66,10 +58,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it renders an expand button when `@isExpandable` is true and defaults to collapsed', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom( @@ -81,11 +70,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it renders an expand button when `@isExpandable` is true and is expanded if `@isExpanded`', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom( @@ -102,11 +87,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { this.set('onClickToggle', () => (isClicked = true)); await render( - hbs`Artist`, + , ); await click( @@ -120,10 +101,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it should render with the appropriate `@align` CSS class', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom('#data-advanced-test-table-th') @@ -134,7 +112,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it should render with the appropriate span information by default', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-th').hasNoAttribute('aria-rowspan'); @@ -147,11 +125,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it should render with the appropriate span information when pass rowspan and colspan', async function (assert) { await render( - hbs``, + , ); assert @@ -177,11 +151,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { }); await render( - hbs``, + , ); assert.throws(function () { @@ -199,11 +169,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { }); await render( - hbs``, + , ); assert.throws(function () { @@ -213,19 +179,14 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('it should support splattributes', async function (assert) { await render( - hbs`Artist`, + , ); assert.dom('#data-advanced-test-table-th').hasAttribute('lang', 'es'); }); test('it has the role attribute set to columnheader by default', async function (assert) { await render( - hbs`Artist`, + , ); assert .dom('#data-advanced-test-table-th') @@ -246,11 +207,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { ]); await render( - hbs`<:body - as |B| - >Artist`, + , ); assert .dom('#data-advanced-test-table-th') @@ -261,9 +218,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { test('if @tooltip is undefined a tooltip button toggle should not be present', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -274,10 +229,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { }); test('if @tooltip is defined a tooltip should be added to the table cell header', async function (assert) { await render( - hbs`Artist`, + , ); assert @@ -294,7 +246,7 @@ module('Integration | Component | hds/advanced-table/th', function (hooks) { }); test('it renders the `aria-labelledby` attribute for the tooltip button with the correct IDs', async function (assert) { await render( - hbs`Artist`, + , ); let prefixLabel = this.element.querySelector( '#data-advanced-test-table-th .hds-advanced-table__th-button-aria-label-hidden-segment', diff --git a/showcase/tests/integration/components/hds/advanced-table/tr-test.js b/showcase/tests/integration/components/hds/advanced-table/tr-test.gjs similarity index 72% rename from showcase/tests/integration/components/hds/advanced-table/tr-test.js rename to showcase/tests/integration/components/hds/advanced-table/tr-test.gjs index b31291c43f8..9cf1013ed12 100644 --- a/showcase/tests/integration/components/hds/advanced-table/tr-test.js +++ b/showcase/tests/integration/components/hds/advanced-table/tr-test.gjs @@ -6,14 +6,14 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, click, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Tr from "@hashicorp/design-system-components/components/hds/advanced-table/tr"; module('Integration | Component | hds/advanced-table/tr', function (hooks) { setupRenderingTest(hooks); test('it should render with a CSS class that matches the component name', async function (assert) { await render( - hbs``, + , ); assert @@ -23,7 +23,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { test('it should render with the appropriate role', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-tr').hasAttribute('role', 'row'); }); @@ -32,8 +32,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { test('it should render the yielded content', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-tr > td').exists(); }); @@ -45,50 +44,35 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { test('it should not render a checkbox if `@isSelectable` is not set', async function (assert) { await render( - hbs``, + , ); assert.dom(checkboxSelector).doesNotExist(); }); test('it should render a checkbox if `@isSelectable` is `true`', async function (assert) { await render( - hbs``, + , ); assert.dom(checkboxSelector).exists(); }); test('the checkbox should be checked if `@isSelected` is `true`', async function (assert) { await render( - hbs``, + , ); assert.dom(checkboxSelector).isChecked(); }); test('the checkbox contains the `@selectionAriaLabelSuffix` suffix', async function (assert) { await render( - hbs``, + , ); assert.dom(checkboxSelector).hasAria('label', 'Select row 123'); }); test('the `th` element has the correct `role` attribute value provided via `@selectionScope`', async function (assert) { await render( - hbs``, + , ); assert .dom( @@ -104,13 +88,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { (_checkbox, selectionKey) => (key = selectionKey), ); await render( - hbs``, + , ); await click(checkboxSelector); assert.strictEqual(key, 'row123'); @@ -120,11 +98,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { this.set('noop', () => {}); await render( - hbs``, + , ); assert @@ -134,10 +108,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { test('it should not render a sort button in the checkbox cell if `@isSelectable` is `true`, and `@onClickSortBySelected` is undefined', async function (assert) { await render( - hbs``, + , ); assert @@ -149,7 +120,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { test('it should support splattributes', async function (assert) { await render( - hbs``, + , ); assert.dom('#data-test-advanced-table-tr').hasAttribute('lang', 'es'); }); @@ -164,7 +135,7 @@ module('Integration | Component | hds/advanced-table/tr', function (hooks) { assert.strictEqual(error.message, errorMessage); }); await render( - hbs``, + , ); assert.throws(function () { throw new Error(errorMessage); diff --git a/showcase/tests/integration/components/hds/alert/index-test.js b/showcase/tests/integration/components/hds/alert/index-test.gjs similarity index 73% rename from showcase/tests/integration/components/hds/alert/index-test.js rename to showcase/tests/integration/components/hds/alert/index-test.gjs index d418865a48e..e3672ba4679 100644 --- a/showcase/tests/integration/components/hds/alert/index-test.js +++ b/showcase/tests/integration/components/hds/alert/index-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, resetOnerror, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Alert from "@hashicorp/design-system-components/components/hds/alert/index"; module('Integration | Component | hds/alert/index', function (hooks) { setupRenderingTest(hooks); @@ -16,14 +16,14 @@ module('Integration | Component | hds/alert/index', function (hooks) { }); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-alert').hasClass('hds-alert'); }); // TYPE test('it should render the correct CSS type class depending on the @type prop', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-alert').hasClass('hds-alert--type-page'); }); @@ -31,29 +31,29 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render an icon by default depending on the type and color', async function (assert) { // here we don't test all the possible combinations, only some of them as precaution - await render(hbs``); + await render(); assert.dom('.hds-icon-info').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-info-fill').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-info').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-check-circle').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-alert-triangle').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-alert-diamond').exists(); }); test('if an icon is declared, the icon should render in the component and override the default one', async function (assert) { - await render(hbs``); + await render(); assert.dom('.hds-icon-clipboard-copy').exists(); - await render(hbs``); + await render(); assert.dom('.hds-icon-clipboard-copy').exists(); }); test('it should display no icon when @icon is set to false', async function (assert) { - await render(hbs``); + await render(); assert.dom('.hds-icon').doesNotExist(); }); @@ -61,19 +61,19 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render the title when the "title" contextual component is provided', async function (assert) { await render( - hbs`This is the title`, + , ); assert.dom(this.element).hasText('This is the title'); }); test('it should render the description when the "description" contextual component is provided', async function (assert) { await render( - hbs`This is the description`, + , ); assert.dom(this.element).hasText('This is the description'); }); test('it should render rich HTML when the "description" contextual component contains HTML tags', async function (assert) { await render( - hbs`Hello strong and em and code and link`, + , ); assert.dom('.hds-alert__description strong').exists().hasText('strong'); assert.dom('.hds-alert__description em').exists().hasText('em'); @@ -81,17 +81,17 @@ module('Integration | Component | hds/alert/index', function (hooks) { assert.dom('.hds-alert__description a').exists().hasText('link'); }); test('it should render a div when the @tag argument is not provided', async function (assert) { - await render(hbs` - + await render(); assert.dom('.hds-alert__title').hasTagName('div'); }); test('it should render the custom title tag when the @tag argument is provided', async function (assert) { - await render(hbs` - + await render(); assert.dom('.hds-alert__title').hasTagName('h2'); }); @@ -99,7 +99,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render an Hds::Button component yielded to the "actions" container', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-alert .hds-alert__actions button') @@ -111,7 +111,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { }); test('it should render an Hds::Link::Standalone component yielded to the "actions" container', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-alert .hds-alert__actions a') @@ -126,7 +126,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render any content passed to the "generic" contextual component', async function (assert) { await render( - hbs`
test
`, + , ); assert.dom('#test-alert .hds-alert__content pre').exists().hasText('test'); }); @@ -134,12 +134,12 @@ module('Integration | Component | hds/alert/index', function (hooks) { // DISMISS test('it should not render the "dismiss" button by default', async function (assert) { - await render(hbs``); + await render(); assert.dom('button.hds-alert__dismiss').doesNotExist(); }); test('it should render the "dismiss" button if a callback function is passed to the @onDismiss argument', async function (assert) { this.set('NOOP', () => {}); - await render(hbs``); + await render(); assert.dom('button.hds-alert__dismiss').exists(); }); @@ -149,7 +149,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render the component with role="alert" and aria-live="polite" for the "success" color', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-alert').hasAttribute('role', 'alert'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -157,7 +157,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render the component with role="alert" and aria-live="polite" for the "warning" color', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-alert').hasAttribute('role', 'alert'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -165,7 +165,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render the component with role="alert" and aria-live="polite" for the "critical" color', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-alert').hasAttribute('role', 'alert'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -175,7 +175,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should not render the component with role="alert" and aria-live="polite" for the "neutral" color', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-alert').doesNotHaveAttribute('role', 'alert'); assert.dom('#test-alert').doesNotHaveAttribute('aria-live', 'polite'); @@ -183,7 +183,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should not render the component with role="alert" and aria-live="polite" for the "highlight" color', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-alert').doesNotHaveAttribute('role', 'alert'); assert.dom('#test-alert').doesNotHaveAttribute('aria-live', 'polite'); @@ -193,11 +193,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render with an auto-generated `aria-labelledby` when a title is provided', async function (assert) { await render( - hbs` - + , ); let title = this.element.querySelector('#test-alert .hds-alert__title'); assert.dom('#test-alert').hasAttribute('aria-labelledby', title.id); @@ -205,11 +205,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render with an auto-generated `aria-labelledby` when description is provided', async function (assert) { await render( - hbs` - + , ); let description = this.element.querySelector( '#test-alert .hds-alert__description', @@ -223,11 +223,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render with with role="alertdialog" and aria-live="polite" for the "success" color when actions are provided', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-alert').hasAttribute('role', 'alertdialog'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -235,11 +235,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render with with role="alertdialog" and aria-live="polite" for the "warning" color when actions are provided', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-alert').hasAttribute('role', 'alertdialog'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -247,11 +247,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should render with with role="alertdialog" and aria-live="polite" for the "critical" color when actions are provided', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-alert').hasAttribute('role', 'alertdialog'); assert.dom('#test-alert').hasAttribute('aria-live', 'polite'); @@ -261,11 +261,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should not render with with role="alertdialog" and aria-live="polite" for the "neutral" color when actions are provided', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-alert').doesNotHaveAttribute('role', 'alertdialog'); assert.dom('#test-alert').doesNotHaveAttribute('aria-live', 'polite'); @@ -273,11 +273,11 @@ module('Integration | Component | hds/alert/index', function (hooks) { test('it should not render with with role="alertdialog" and aria-live="polite" for the "highlight" color when actions are provided', async function (assert) { await render( - hbs` - + , ); assert.dom('#test-alert').doesNotHaveAttribute('role', 'alertdialog'); assert.dom('#test-alert').doesNotHaveAttribute('aria-live', 'polite'); @@ -292,7 +292,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs``); + await render(); assert.throws(function () { throw new Error(errorMessage); }); @@ -304,7 +304,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs``); + await render(); assert.throws(function () { throw new Error(errorMessage); }); @@ -316,7 +316,7 @@ module('Integration | Component | hds/alert/index', function (hooks) { setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs``); + await render(); assert.throws(function () { throw new Error(errorMessage); }); diff --git a/showcase/tests/integration/components/hds/app-footer/copyright-test.js b/showcase/tests/integration/components/hds/app-footer/copyright-test.gjs similarity index 74% rename from showcase/tests/integration/components/hds/app-footer/copyright-test.js rename to showcase/tests/integration/components/hds/app-footer/copyright-test.gjs index ffea2d39105..f4454ee6005 100644 --- a/showcase/tests/integration/components/hds/app-footer/copyright-test.js +++ b/showcase/tests/integration/components/hds/app-footer/copyright-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Copyright from "@hashicorp/design-system-components/components/hds/app-footer/copyright"; module('Integration | Component | hds/app-footer/copyright', function (hooks) { setupRenderingTest(hooks); @@ -14,20 +14,20 @@ module('Integration | Component | hds/app-footer/copyright', function (hooks) { const currentYear = new Date().getFullYear(); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-copyright').hasClass('hds-app-footer__copyright'); }); // OPTIONS test('it renders the copyright with the current year by default', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-copyright').includesText(currentYear); }); test('it renders the copyright with the passed in year value', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-copyright').includesText('1984'); }); diff --git a/showcase/tests/integration/components/hds/app-footer/index-test.js b/showcase/tests/integration/components/hds/app-footer/index-test.gjs similarity index 79% rename from showcase/tests/integration/components/hds/app-footer/index-test.js rename to showcase/tests/integration/components/hds/app-footer/index-test.gjs index 1c3f4abc169..5dc2bd447a6 100644 --- a/showcase/tests/integration/components/hds/app-footer/index-test.js +++ b/showcase/tests/integration/components/hds/app-footer/index-test.gjs @@ -6,26 +6,26 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import AppFooter from "@hashicorp/design-system-components/components/hds/app-footer/index"; module('Integration | Component | hds/app-footer/index', function (hooks) { setupRenderingTest(hooks); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-footer').hasClass('hds-app-footer'); }); // CONTENT test('it renders the default content', async function (assert) { - await render(hbs``); + await render(); assert.dom('.hds-app-footer__copyright').exists(); }); test('it renders the passed in content', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-extra-before').hasText('Before'); assert.dom('#test-custom-item').hasText('Custom item'); assert @@ -51,12 +51,12 @@ module('Integration | Component | hds/app-footer/index', function (hooks) { // OPTIONS test('it renders with the default "light" theme', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-footer').hasClass('hds-app-footer--theme-light'); }); test('it renders with the passed in "dark" theme', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-footer').hasClass('hds-app-footer--theme-dark'); }); }); diff --git a/showcase/tests/integration/components/hds/app-footer/item-test.js b/showcase/tests/integration/components/hds/app-footer/item-test.gjs similarity index 74% rename from showcase/tests/integration/components/hds/app-footer/item-test.js rename to showcase/tests/integration/components/hds/app-footer/item-test.gjs index 97246a9f68a..8798c7f6d2a 100644 --- a/showcase/tests/integration/components/hds/app-footer/item-test.js +++ b/showcase/tests/integration/components/hds/app-footer/item-test.gjs @@ -6,13 +6,13 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Item from "@hashicorp/design-system-components/components/hds/app-footer/item"; module('Integration | Component | hds/app-footer/item', function (hooks) { setupRenderingTest(hooks); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs`
`); + await render(); assert.dom('#test-item').hasClass('hds-app-footer__list-item'); }); @@ -20,7 +20,7 @@ module('Integration | Component | hds/app-footer/item', function (hooks) { test('it renders text content yielded within the Item', async function (assert) { await render( - hbs`
    Custom item
`, + , ); assert.dom('#test-item').hasText('Custom item'); }); diff --git a/showcase/tests/integration/components/hds/app-footer/legal-links-test.js b/showcase/tests/integration/components/hds/app-footer/legal-links-test.gjs similarity index 81% rename from showcase/tests/integration/components/hds/app-footer/legal-links-test.js rename to showcase/tests/integration/components/hds/app-footer/legal-links-test.gjs index c10734686bb..bbb75090194 100644 --- a/showcase/tests/integration/components/hds/app-footer/legal-links-test.js +++ b/showcase/tests/integration/components/hds/app-footer/legal-links-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import LegalLinks from "@hashicorp/design-system-components/components/hds/app-footer/legal-links"; module( 'Integration | Component | hds/app-footer/legal-links', @@ -15,7 +15,7 @@ module( test('it should render the component with a CSS class that matches the component name', async function (assert) { await render( - hbs`
`, + , ); assert.dom('#test-legal-links').hasClass('hds-app-footer__legal-links'); }); @@ -24,7 +24,7 @@ module( test('it contains the default links with default href values', async function (assert) { await render( - hbs`
`, + , ); assert .dom('#test-legal-links li:nth-child(1) a') @@ -51,16 +51,9 @@ module( // OPTIONS test('it uses the passed in custom href values', async function (assert) { - await render(hbs` -
- `); + await render(); assert .dom('#test-legal-links li:nth-child(1) a') .hasText('Support') diff --git a/showcase/tests/integration/components/hds/app-footer/link-test.js b/showcase/tests/integration/components/hds/app-footer/link-test.gjs similarity index 70% rename from showcase/tests/integration/components/hds/app-footer/link-test.js rename to showcase/tests/integration/components/hds/app-footer/link-test.gjs index bc47c0e285b..b26a9f39a32 100644 --- a/showcase/tests/integration/components/hds/app-footer/link-test.js +++ b/showcase/tests/integration/components/hds/app-footer/link-test.gjs @@ -6,18 +6,18 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import Link from "@hashicorp/design-system-components/components/hds/app-footer/link"; module('Integration | Component | hds/app-footer/link', function (hooks) { setupRenderingTest(hooks); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs` + await render(); assert.dom('#test-link').hasClass('hds-app-footer__link'); }); @@ -25,12 +25,12 @@ module('Integration | Component | hds/app-footer/link', function (hooks) { test('it renders text content yielded within the Link', async function (assert) { await render( - hbs` + , ); assert .dom('#test-link') diff --git a/showcase/tests/integration/components/hds/app-footer/status-link-test.js b/showcase/tests/integration/components/hds/app-footer/status-link-test.gjs similarity index 77% rename from showcase/tests/integration/components/hds/app-footer/status-link-test.js rename to showcase/tests/integration/components/hds/app-footer/status-link-test.gjs index f594c3245b1..6142adeee82 100644 --- a/showcase/tests/integration/components/hds/app-footer/status-link-test.js +++ b/showcase/tests/integration/components/hds/app-footer/status-link-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import StatusLink from "@hashicorp/design-system-components/components/hds/app-footer/status-link"; module( 'Integration | Component | hds/app-footer/status-link', @@ -15,7 +15,7 @@ module( test('it should render the component with a CSS class that matches the component name', async function (assert) { await render( - hbs`
`, + , ); assert.dom('#test-status-link').hasClass('hds-app-footer__status-link'); }); @@ -25,12 +25,12 @@ module( // status test('it should display text, icon, and icon color matching the passed in status', async function (assert) { - await render(hbs``); + await render(); // operational assert .dom('#test-operational') @@ -68,13 +68,9 @@ module( // text, statusIcon, statusIconColor test('it should display the custom text, icon color, and icon passed in', async function (assert) { - await render(hbs` -
- `); + await render(); assert.dom('.hds-app-footer__status-link').hasText('Waypoint'); assert.dom('.hds-app-footer__status-link .hds-icon').exists(); // .hasStyle({'--hds-app-footer-status-icon-color': 'var(--token-color-waypoint-brand)'}) @@ -83,9 +79,9 @@ module( // href test('it should use the passed in href for the link', async function (assert) { - await render(hbs` -
- `); + await render(); assert .dom('.hds-app-footer__status-link') .hasAttribute('href', 'https://www.hashicorp.com/custom-url'); @@ -100,7 +96,7 @@ module( setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs`
`); + await render(); assert.throws(function () { throw new Error(errorMessage); }); @@ -113,7 +109,7 @@ module( setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs`
`); + await render(); assert.throws(function () { throw new Error(errorMessage); }); diff --git a/showcase/tests/integration/components/hds/app-frame/index-test.js b/showcase/tests/integration/components/hds/app-frame/index-test.gjs similarity index 79% rename from showcase/tests/integration/components/hds/app-frame/index-test.js rename to showcase/tests/integration/components/hds/app-frame/index-test.gjs index 5ca9119e9ca..a3d5289c79a 100644 --- a/showcase/tests/integration/components/hds/app-frame/index-test.js +++ b/showcase/tests/integration/components/hds/app-frame/index-test.gjs @@ -6,21 +6,21 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import AppFrame from "@hashicorp/design-system-components/components/hds/app-frame/index"; module('Integration | Component | hds/app-frame/index', function (hooks) { setupRenderingTest(hooks); test('it should render with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-frame').hasClass('hds-app-frame'); }); // CONTENT test('it should yield the different content areas (and spreads attributes on them)', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-frame[data-test-app-frame]').exists(); @@ -79,63 +79,63 @@ module('Integration | Component | hds/app-frame/index', function (hooks) { // hasHeader test('it should hide the header when @hasHeader is false', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-frame-header').doesNotExist(); }); // hasSidebar test('it should hide the sidebar when @hasSidebar is false', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-frame-sidebar').doesNotExist(); }); // hasFooter test('it should hide the sidebar when @hasFooter is false', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-frame-sidebar').doesNotExist(); }); // hasModals test('it should hide the modals when @hasModals is false', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-frame-modals').doesNotExist(); }); // Main id test('it should have a default id of "hds-main" on the main container', async function (assert) { - await render(hbs` - + await render(); assert.dom('main#hds-main').exists(); }); test('it should allow a custom id for the main container to be passed in', async function (assert) { - await render(hbs` - + await render(); assert.dom('main#test-main').exists(); }); }); diff --git a/showcase/tests/integration/components/hds/app-header/home-link-test.js b/showcase/tests/integration/components/hds/app-header/home-link-test.gjs similarity index 73% rename from showcase/tests/integration/components/hds/app-header/home-link-test.js rename to showcase/tests/integration/components/hds/app-header/home-link-test.gjs index e35487b1216..b7777181713 100644 --- a/showcase/tests/integration/components/hds/app-header/home-link-test.js +++ b/showcase/tests/integration/components/hds/app-header/home-link-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, resetOnerror, setupOnerror } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import HomeLink from "@hashicorp/design-system-components/components/hds/app-header/home-link"; module('Integration | Component | hds/app-header/home-link', function (hooks) { setupRenderingTest(hooks); @@ -17,11 +17,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) { test('it should render the component with a CSS class that matches the component name', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-home-link').hasClass('hds-app-header__home-link'); }); @@ -30,12 +26,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) { test('it renders the passed in args', async function (assert) { await render( - hbs``, + , ); assert.dom('.hds-icon-hashicorp').exists(); assert @@ -46,12 +37,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) { test('it renders the logo with a custom passed in color', async function (assert) { await render( - hbs``, + , ); assert .dom('.hds-icon-boundary') @@ -60,13 +46,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) { test('it renders the logo with text when @isIconOnly is false', async function (assert) { await render( - hbs``, + , ); assert.dom('.hds-text').exists(); }); @@ -80,7 +60,7 @@ module('Integration | Component | hds/app-header/home-link', function (hooks) { setupOnerror(function (error) { assert.strictEqual(error.message, `Assertion Failed: ${errorMessage}`); }); - await render(hbs``); + await render(); assert.throws(function () { throw new Error(errorMessage); }); diff --git a/showcase/tests/integration/components/hds/app-header/index-test.js b/showcase/tests/integration/components/hds/app-header/index-test.gjs similarity index 75% rename from showcase/tests/integration/components/hds/app-header/index-test.js rename to showcase/tests/integration/components/hds/app-header/index-test.gjs index 96f1b91805c..47a6fb9d482 100644 --- a/showcase/tests/integration/components/hds/app-header/index-test.js +++ b/showcase/tests/integration/components/hds/app-header/index-test.gjs @@ -6,30 +6,33 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render, click, triggerKeyEvent } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import AppHeader from "@hashicorp/design-system-components/components/hds/app-header/index"; +import HomeLink from "@hashicorp/design-system-components/components/hds/app-header/home-link"; +import { on } from "@ember/modifier"; +import Button from "@hashicorp/design-system-components/components/hds/button/index"; module('Integration | Component | hds/app-header/index', function (hooks) { setupRenderingTest(hooks); test('it should render the component with a CSS class that matches the component name', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-header').hasClass('hds-app-header'); }); // CONTENT test('it renders content passed into the globalActions and utilityActions named blocks', async function (assert) { - await render(hbs` + await render(); assert.dom('#test-global-item-before').hasText('Global Item Before'); assert.dom('#test-global-item-after').hasText('Global Item After'); assert.dom('#test-utility-item').hasText('Utility Item'); @@ -38,12 +41,12 @@ module('Integration | Component | hds/app-header/index', function (hooks) { // RESPONSIVENESS test('it is "desktop" by default', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-header').hasClass('hds-app-header--is-desktop'); }); test('it does not show a menu button on wide viewports', async function (assert) { - await render(hbs``); + await render(); assert.dom('.hds-app-header__menu-button').doesNotExist(); }); @@ -53,27 +56,27 @@ module('Integration | Component | hds/app-header/index', function (hooks) { test('it is "mobile" on narrow viewports', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-header').hasClass('hds-app-header--is-mobile'); }); test('it shows a menu button on narrow viewports', async function (assert) { - await render(hbs` -`); + await render(); assert.dom('.hds-app-header__menu-button').exists(); }); // Mobile menu functionality test(`the actions do not display by default on narrow viewports`, async function (assert) { - await render(hbs` -`); + await render(); assert.dom('#test-app-header').hasClass('hds-app-header--menu-is-closed'); }); test(`the actions show/hide when the menu button is pressed on narrow viewports`, async function (assert) { - await render(hbs` -`); + await render(); assert.dom('#test-app-header').hasClass('hds-app-header--menu-is-closed'); await click('.hds-app-header__menu-button'); @@ -85,23 +88,18 @@ module('Integration | Component | hds/app-header/index', function (hooks) { // Close callback test('it should hide the actions when the "close" function is called in mobile view', async function (assert) { - await render(hbs` - + await render(); // test logo actions close await click('.hds-app-header__menu-button'); @@ -123,15 +121,15 @@ module('Integration | Component | hds/app-header/index', function (hooks) { }); test('it should not do anything when the "close" function is called in desktop view', async function (assert) { - await render(hbs` - + await render(); assert.dom('#test-app-header').hasClass('hds-app-header--is-desktop'); assert .dom('#test-app-header') @@ -167,14 +165,14 @@ module('Integration | Component | hds/app-header/index', function (hooks) { // Note: We pass in a high custom breakpoint to force the component to render as "mobile" test('it uses the custom passed in breakpoint to control menu display', async function (assert) { - await render(hbs``); + await render(); assert.dom('.hds-app-header__menu-button').exists(); }); // A11Y test(`it displays the correct value for aria-expanded when actions are displayed vs hidden`, async function (assert) { - await render(hbs``); + await render(); await click('.hds-app-header__menu-button'); assert .dom('.hds-app-header__menu-button') @@ -188,7 +186,7 @@ module('Integration | Component | hds/app-header/index', function (hooks) { test('the actions menu collapses when the ESC key is pressed on narrow viewports', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-header').hasClass('hds-app-header--menu-is-closed'); @@ -200,7 +198,7 @@ module('Integration | Component | hds/app-header/index', function (hooks) { }); test('the menu button has an aria-controls attribute with a value matching the menu id', async function (assert) { - await render(hbs``); + await render(); await click('.hds-app-header__menu-button'); assert.dom('.hds-app-header__menu-button').hasAttribute('aria-controls'); assert.dom('.hds-app-header__actions').hasAttribute('id'); @@ -218,7 +216,7 @@ module('Integration | Component | hds/app-header/index', function (hooks) { // A11Y Refocus test('it renders the `a11y-refocus` elements by default with a default skip link href value of "#hds-main', async function (assert) { - await render(hbs``); + await render(); assert.dom('#ember-a11y-refocus-nav-message').exists(); assert .dom('#ember-a11y-refocus-skip-link') @@ -227,11 +225,7 @@ module('Integration | Component | hds/app-header/index', function (hooks) { }); test('it renders the `a11y-refocus` elements with the right properties provided as arguments', async function (assert) { - await render(hbs``); + await render(); assert .dom('#ember-a11y-refocus-nav-message') .hasText('test-navigation-text'); @@ -242,7 +236,7 @@ module('Integration | Component | hds/app-header/index', function (hooks) { }); test('it does not render the `a11y-refocus` elements if `hasA11yRefocus` is false', async function (assert) { - await render(hbs``); + await render(); assert.dom('#ember-a11y-refocus-nav-message').doesNotExist(); assert.dom('#ember-a11y-refocus-skip-link').doesNotExist(); }); diff --git a/showcase/tests/integration/components/hds/app-side-nav/index-test.js b/showcase/tests/integration/components/hds/app-side-nav/index-test.gjs similarity index 78% rename from showcase/tests/integration/components/hds/app-side-nav/index-test.js rename to showcase/tests/integration/components/hds/app-side-nav/index-test.gjs index 23ca9d9f657..88eb7c49390 100644 --- a/showcase/tests/integration/components/hds/app-side-nav/index-test.js +++ b/showcase/tests/integration/components/hds/app-side-nav/index-test.gjs @@ -4,19 +4,9 @@ */ import { module, test } from 'qunit'; -import { - setupRenderingTest, - cleanupBodyOverflow, -} from 'showcase/tests/helpers'; -import { - render, - click, - resetOnerror, - settled, - triggerKeyEvent, - tab, -} from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import { setupRenderingTest, cleanupBodyOverflow } from 'showcase/tests/helpers'; +import { render, click, resetOnerror, settled, triggerKeyEvent, tab } from '@ember/test-helpers'; +import AppSideNav from "@hashicorp/design-system-components/components/hds/app-side-nav/index"; class MockEventTarget extends EventTarget {} @@ -53,7 +43,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it should render the component with a CSS class that matches the component name', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav'); }); @@ -61,21 +51,21 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { // CONTENT test('it renders content passed to the named blocks', async function (assert) { - await render(hbs` - -`); + await render(); assert.dom('#test-app-side-nav-body').exists(); }); // RESPONSIVENESS test('it is "desktop" by default', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-desktop'); }); test('it is "responsive" by default', async function (assert) { - await render(hbs``); + await render(); assert .dom('#test-app-side-nav') .hasClass('hds-app-side-nav--is-responsive'); @@ -83,7 +73,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it is not "responsive" if `isResponsive` is false', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-app-side-nav') @@ -94,25 +84,21 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it is "mobile" on narrow viewports', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-mobile'); }); test('it is minimized/collapsed on narrow viewports by default', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-minimized'); }); test('it is not minimized/collapsed on narrow viewports if `isResponsive` is false', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-app-side-nav') @@ -121,25 +107,21 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it shows a toggle button on narrow viewports by default', async function (assert) { await render( - hbs``, + , ); assert.dom('.hds-app-side-nav__toggle-button').exists(); }); test('it does not show a toggle button on narrow viewports if `isResponsive` is false', async function (assert) { await render( - hbs``, + , ); assert.dom('.hds-app-side-nav__toggle-button').doesNotExist(); }); test('it expands/collapses when the toggle button is pressed on narrow viewports', async function (assert) { await render( - hbs``, + , ); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-minimized'); assert.dom('body', document).doesNotHaveStyle('overflow'); @@ -158,8 +140,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { }); test('it collapses when the ESC key is pressed on narrow viewports', async function (assert) { - await render(hbs``); + await render(); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-minimized'); await click('.hds-app-side-nav__toggle-button'); assert @@ -175,7 +156,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it responds to different events to toggle between "non-minimized" (by default) and "mimimized" states', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-app-side-nav') @@ -191,9 +172,9 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { }); test('the "non-minimized" and "minimized" states have impact on its internal properties', async function (assert) { - await render(hbs` - -`); + await render(); assert .dom('#test-app-side-nav') .hasClass('hds-app-side-nav--is-not-minimized'); @@ -228,10 +209,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { onDesktopViewportChange: (...args) => calls.push(args), }); - await render(hbs``); + await render(); assert.strictEqual(calls.length, 1, 'called with initial viewport'); @@ -253,10 +231,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { onDesktopViewportChange: (...args) => calls.push(args), }); - await render(hbs``); + await render(); await click('.hds-app-side-nav__toggle-button'); assert.dom('.hds-app-side-nav__wrapper-body').hasAttribute('inert'); @@ -287,10 +262,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { onDesktopViewportChange: (...args) => calls.push(args), }); - await render(hbs``); + await render(); await this.changeBrowserSize(false); assert.deepEqual( calls[1], @@ -324,12 +296,9 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { this.set('isAppSideNavRendered', true); - await render(hbs`{{#if this.isAppSideNavRendered}} - -{{/if}}`); + await render(); await this.changeBrowserSize(false); @@ -351,12 +320,9 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { }); test('when collapsed, the content in the AppSideNav is not focusable', async function (assert) { - await render(hbs` - -`); + await render(); await click('.hds-app-side-nav__toggle-button'); assert.dom('#test-app-side-nav').hasClass('hds-app-side-nav--is-minimized'); @@ -371,10 +337,7 @@ module('Integration | Component | hds/app-side-nav/index', function (hooks) { test('it should call `onToggleMinimizedStatus` function if provided', async function (assert) { let toggled = false; this.set('onToggleMinimizedStatus', () => (toggled = true)); - await render(hbs``); + await render(); await click('.hds-app-side-nav__toggle-button'); assert.ok(toggled); }); diff --git a/showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.js b/showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.gjs similarity index 78% rename from showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.js rename to showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.gjs index fbd1ea6f8a8..cbfd4c0d534 100644 --- a/showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.js +++ b/showcase/tests/integration/components/hds/app-side-nav/list/back-link-test.gjs @@ -6,7 +6,7 @@ import { module, test } from 'qunit'; import { setupRenderingTest } from 'showcase/tests/helpers'; import { render } from '@ember/test-helpers'; -import { hbs } from 'ember-cli-htmlbars'; +import BackLink from "@hashicorp/design-system-components/components/hds/app-side-nav/list/back-link"; module( 'Integration | Component | hds/app-side-nav/list/back-link', @@ -17,9 +17,7 @@ module( test('it should render the component with a CSS class that matches the component name', async function (assert) { await render( - hbs``, + , ); assert .dom('#test-app-side-nav-list-item-link-back-link') @@ -30,7 +28,7 @@ module( test('it renders the passed in args', async function (assert) { await render( - hbs``, + , ); assert.dom('.hds-icon-chevron-left').exists(); assert @@ -41,7 +39,7 @@ module( // GENERATED ELEMENTS test('it should render a