From a58a2ca828db362b7de888f8f2387dd9ad32aa53 Mon Sep 17 00:00:00 2001 From: raiiasingh19 Date: Mon, 22 Jan 2024 17:01:43 +0530 Subject: [PATCH] all tests passed --- client/package.json | 2 +- .../unitTests/Components/Linkbuttons.test.tsx | 9 ++++----- client/test/unitTests/Util/envUtil.test.ts | 16 +++++----------- client/yarn.lock | 8 ++++---- deploy/config/client/env.js | 1 - deploy/config/client/env.local.js | 1 - deploy/config/client/env.trial.js | 1 - 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/client/package.json b/client/package.json index 2852c2a15..257f1fa6f 100644 --- a/client/package.json +++ b/client/package.json @@ -89,7 +89,7 @@ "jest": "^29.7.0", "jest-environment-jsdom": "^29.7.0", "playwright": "^1.32.1", - "prettier": "3.1.0", + "prettier": "^3.2.4", "shx": "^0.3.4", "ts-jest": "^29.1.1" }, diff --git a/client/test/unitTests/Components/Linkbuttons.test.tsx b/client/test/unitTests/Components/Linkbuttons.test.tsx index 27952ee2c..8191df336 100644 --- a/client/test/unitTests/Components/Linkbuttons.test.tsx +++ b/client/test/unitTests/Components/Linkbuttons.test.tsx @@ -7,19 +7,18 @@ import userEvent from '@testing-library/user-event'; jest.deepUnmock('components/LinkButtons'); const buttons: KeyLinkPair[] = [ - { key: 'TERMINAL', link: 'https://example.com/terminal' }, { key: 'VNCDESKTOP', link: 'https://example.com/desktop' }, { key: 'NO_ICON', link: 'https://example.com/noicon' }, ]; const getButton = (key: string) => - screen.getByRole('link', { name: `${LinkIcons[key].name ?? key}-btn` }); + screen.getByRole('link', { name: `${LinkIcons[key]?.name ?? key}-btn` }); const getLabel = (key: string) => - screen.getByRole('heading', { level: 6, name: LinkIcons[key].name ?? key }); + screen.getByRole('heading', { level: 6, name: LinkIcons[key]?.name ?? key }); const getButtonIcon = (key: string) => - screen.getByTitle(`${LinkIcons[key].name ?? key}-btn`).children[0]; + screen.getByTitle(`${LinkIcons[key]?.name ?? key}-btn`).children[0]; const evaluateButtonSize = (expectedSize: number) => { buttons.forEach((button) => { @@ -66,7 +65,7 @@ describe('LinkButtons component default size', () => { it('should use name from iconLib as label when avaiable', () => { expect(getLabel(buttons[0].key).textContent).toBe( - LinkIcons[buttons[0].key].name, + LinkIcons[buttons[0].key]?.name, ); }); }); diff --git a/client/test/unitTests/Util/envUtil.test.ts b/client/test/unitTests/Util/envUtil.test.ts index 7cf1b2007..7327d189a 100644 --- a/client/test/unitTests/Util/envUtil.test.ts +++ b/client/test/unitTests/Util/envUtil.test.ts @@ -14,13 +14,7 @@ describe('envUtil', () => { const testLIB = ''; const testAppURL = 'https://example.com'; const testBasename = 'testBasename'; - const testWorkbenchEndpoints = [ - 'one', - '/two', - 'three/', - '/four/', - '/five/guy/', - ]; + const testWorkbenchEndpoints = ['one', '/two', 'three/', '/four/']; const testUsername = 'username'; const testAppID = 'testAppID'; const testAuthority = 'https://example.com'; @@ -34,10 +28,10 @@ describe('envUtil', () => { REACT_APP_URL_BASENAME: testBasename, REACT_APP_URL_DTLINK: testDT, REACT_APP_URL_LIBLINK: testLIB, - REACT_APP_WORKBENCHLINK_VNCDESKTOP: testWorkbenchEndpoints[1], - REACT_APP_WORKBENCHLINK_VSCODE: testWorkbenchEndpoints[2], - REACT_APP_WORKBENCHLINK_JUPYTERLAB: testWorkbenchEndpoints[3], - REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: testWorkbenchEndpoints[4], + REACT_APP_WORKBENCHLINK_VNCDESKTOP: testWorkbenchEndpoints[0], + REACT_APP_WORKBENCHLINK_VSCODE: testWorkbenchEndpoints[1], + REACT_APP_WORKBENCHLINK_JUPYTERLAB: testWorkbenchEndpoints[2], + REACT_APP_WORKBENCHLINK_JUPYTERNOTEBOOK: testWorkbenchEndpoints[3], REACT_APP_CLIENT_ID: testAppID, REACT_APP_AUTH_AUTHORITY: testAuthority, diff --git a/client/yarn.lock b/client/yarn.lock index 7f2c20586..01f2585a5 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -8899,10 +8899,10 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w== -prettier@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.1.0.tgz#c6d16474a5f764ea1a4a373c593b779697744d5e" - integrity sha512-TQLvXjq5IAibjh8EpBIkNKxO749UEWABoiIZehEPiY4GNpVdhaFKqSTu+QrlU6D2dPAfubRmtJTi4K4YkQ5eXw== +prettier@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.2.4.tgz#4723cadeac2ce7c9227de758e5ff9b14e075f283" + integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== pretty-bytes@^5.3.0, pretty-bytes@^5.4.1: version "5.6.0" diff --git a/deploy/config/client/env.js b/deploy/config/client/env.js index cd60bf7a3..80d775d0c 100644 --- a/deploy/config/client/env.js +++ b/deploy/config/client/env.js @@ -5,7 +5,6 @@ if (typeof window !== 'undefined') { REACT_APP_URL_BASENAME: '', REACT_APP_URL_DTLINK: '/lab', REACT_APP_URL_LIBLINK: '', - REACT_APP_WORKBENCHLINK_TERMINAL: '/terminals/main', REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword', REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/', REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab', diff --git a/deploy/config/client/env.local.js b/deploy/config/client/env.local.js index 70c324760..9a9fc669b 100644 --- a/deploy/config/client/env.local.js +++ b/deploy/config/client/env.local.js @@ -5,7 +5,6 @@ if (typeof window !== 'undefined') { REACT_APP_URL_BASENAME: '', REACT_APP_URL_DTLINK: '/lab', REACT_APP_URL_LIBLINK: '', - REACT_APP_WORKBENCHLINK_TERMINAL: '/terminals/main', REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword', REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/', REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab', diff --git a/deploy/config/client/env.trial.js b/deploy/config/client/env.trial.js index a359a63d7..8b8f64c5a 100644 --- a/deploy/config/client/env.trial.js +++ b/deploy/config/client/env.trial.js @@ -5,7 +5,6 @@ if (typeof window !== 'undefined') { REACT_APP_URL_BASENAME: '', REACT_APP_URL_DTLINK: '/lab', REACT_APP_URL_LIBLINK: '', - REACT_APP_WORKBENCHLINK_TERMINAL: '/terminals/main', REACT_APP_WORKBENCHLINK_VNCDESKTOP: '/tools/vnc/?password=vncpassword', REACT_APP_WORKBENCHLINK_VSCODE: '/tools/vscode/', REACT_APP_WORKBENCHLINK_JUPYTERLAB: '/lab',