Skip to content

Commit

Permalink
all tests passed
Browse files Browse the repository at this point in the history
  • Loading branch information
raiiasingh19 committed Jan 22, 2024
1 parent d9066b1 commit a58a2ca
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
9 changes: 4 additions & 5 deletions client/test/unitTests/Components/Linkbuttons.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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,
);
});
});
Expand Down
16 changes: 5 additions & 11 deletions client/test/unitTests/Util/envUtil.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion deploy/config/client/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion deploy/config/client/env.local.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion deploy/config/client/env.trial.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit a58a2ca

Please sign in to comment.