From 8468bfa14596ea9956e9c068f961f8186cf091e4 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Thu, 8 Aug 2024 14:38:52 -0600 Subject: [PATCH] Add vitest to GitHub actions (#9162) * Add vitest to GHA * Make a clean install * switching from jsx to React.createElement() * Update and rename test.yml to vitest.yml --------- Co-authored-by: Steve Persch Co-authored-by: Steve Persch --- .github/workflows/vitest.yml | 23 +++++++++++++++++++++++ src/components/omniSidebarNav/helpers.js | 10 ++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/vitest.yml diff --git a/.github/workflows/vitest.yml b/.github/workflows/vitest.yml new file mode 100644 index 0000000000..fd7c0f1c38 --- /dev/null +++ b/.github/workflows/vitest.yml @@ -0,0 +1,23 @@ +name: JavaScript Unit Tests +on: + pull_request: + paths: + - 'src/**' + - '.github/workflows/vitest.yml' + types: + - opened + - synchronize + - reopened + - ready_for_review + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 'latest' + - run: npm ci + - run: npx vitest src/components diff --git a/src/components/omniSidebarNav/helpers.js b/src/components/omniSidebarNav/helpers.js index a4e15c571e..4c9d7636e5 100644 --- a/src/components/omniSidebarNav/helpers.js +++ b/src/components/omniSidebarNav/helpers.js @@ -17,10 +17,12 @@ const turnItemsIntoLinks = (item, activePage) => { // If the link is external, add an icon to indicate that. // Internal links will start with a slash. if (item.link.startsWith('http')) { - linkText = ( - <> - {item.title} - + linkText = React.createElement( + React.Fragment, + null, + React.createElement(Icon, { iconName: "externalLink" }), + " ", + item.title ); }