Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cb 6265 Return front unit tests after migration #3338

Open
wants to merge 15 commits into
base: devel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{
"label": "Clean CE",
"type": "shell",
"command": "yarn clean",
"command": "yarn clear",
"options": {
"cwd": "${workspaceFolder}/webapp"
}
Expand Down
2 changes: 1 addition & 1 deletion common-react/@dbeaver/ui-kit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"scripts": {
"build": "tsc -b",
"docs": "ladle serve",
"clean": "rimraf --glob dist"
"clean": "rimraf --glob lib"
},
"packageManager": "[email protected]",
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"reflect-metadata": "^0",
"rimraf": "^6",
"typescript": "^5.7.3",
"typescript-plugin-css-modules": "^5"
"typescript-plugin-css-modules": "^5",
"vitest": "^3"
},
"packageManager": "[email protected]"
}
4 changes: 2 additions & 2 deletions webapp/packages/core-administration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"description": "",
"license": "Apache-2.0",
"exports": {
".": "./dist/index.js"
".": "./lib/index.js"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"clean": "rimraf --glob lib",
"lint": "eslint ./src/ --ext .ts,.tsx",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies"
Expand Down
7 changes: 3 additions & 4 deletions webapp/packages/core-administration/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"extends": "@cloudbeaver/tsconfig/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"outDir": "lib",
"tsBuildInfoFile": "lib/tsconfig.tsbuildinfo",
"composite": true
},
"references": [
Expand Down Expand Up @@ -53,7 +53,6 @@
],
"exclude": [
"**/node_modules",
"lib/**/*",
"dist/**/*"
"lib/**/*"
]
}
4 changes: 2 additions & 2 deletions webapp/packages/core-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"description": "",
"license": "Apache-2.0",
"exports": {
".": "./dist/index.js"
".": "./lib/index.js"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"clean": "rimraf --glob lib",
"lint": "eslint ./src/ --ext .ts,.tsx",
"validate-dependencies": "core-cli-validate-dependencies"
},
Expand Down
7 changes: 3 additions & 4 deletions webapp/packages/core-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"extends": "@cloudbeaver/tsconfig/tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"outDir": "lib",
"tsBuildInfoFile": "lib/tsconfig.tsbuildinfo",
"composite": true
},
"references": [
Expand Down Expand Up @@ -62,7 +62,6 @@
],
"exclude": [
"**/node_modules",
"lib/**/*",
"dist/**/*"
"lib/**/*"
]
}
10 changes: 5 additions & 5 deletions webapp/packages/core-authentication/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"description": "",
"license": "Apache-2.0",
"exports": {
".": "./dist/index.js",
"./*": "./dist/*"
".": "./lib/index.js",
"./*": "./lib/*"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"clean": "rimraf --glob lib",
"lint": "eslint ./src/ --ext .ts,.tsx",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies"
Expand All @@ -39,8 +39,8 @@
"@cloudbeaver/core-cli": "workspace:*",
"@cloudbeaver/core-sdk": "workspace:*",
"@cloudbeaver/tsconfig": "workspace:*",
"@types/jest": "^29",
"msw": "^2",
"typescript": "^5"
"typescript": "^5",
"vitest": "^3"
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
// import { expect, test } from '@jest/globals';
import { describe } from 'vitest';

// import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity';
// import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
Expand Down Expand Up @@ -52,3 +52,5 @@
// expect(settings.disableAnonymousAccess).toBe(true);
// expectNoDeprecatedSettingMessage();
// });

describe.skip('AuthSettingsService', () => {});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,11 +47,11 @@
return this.data?.authRole as ELMRole | undefined;
}

get teams() {

Check warning on line 50 in webapp/packages/core-authentication/src/UserInfoResource.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
return this.data?.teams || [];
}

get parametersAvailable() {

Check warning on line 54 in webapp/packages/core-authentication/src/UserInfoResource.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Missing return type on function
return this.data !== null;
}

Expand Down Expand Up @@ -207,7 +207,7 @@
return this.data;
}

async setConfigurationParameter(key: string, value: any): Promise<UserInfo | null> {

Check warning on line 210 in webapp/packages/core-authentication/src/UserInfoResource.ts

View workflow job for this annotation

GitHub Actions / Frontend / Lint

Argument 'value' should be typed with a non-any type
await this.load();

if (!this.parametersAvailable) {
Expand Down
7 changes: 3 additions & 4 deletions webapp/packages/core-authentication/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"extends": "@cloudbeaver/tsconfig/tsconfig.json",
"exclude": [
"**/node_modules",
"lib/**/*",
"dist/**/*"
"lib/**/*"
],
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo",
"outDir": "lib",
"tsBuildInfoFile": "lib/tsconfig.tsbuildinfo",
"composite": true
},
"references": [
Expand Down
11 changes: 5 additions & 6 deletions webapp/packages/core-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
"description": "",
"license": "Apache-2.0",
"exports": {
".": "./dist/index.js"
".": "./lib/index.js"
},
"scripts": {
"build": "tsc -b",
"clean": "rimraf --glob dist",
"clean": "rimraf --glob lib",
"lint": "eslint ./src/ --ext .ts,.tsx",
"test": "core-cli-test",
"validate-dependencies": "core-cli-validate-dependencies"
Expand Down Expand Up @@ -51,15 +51,14 @@
"@cloudbeaver/core-utils": "workspace:*",
"@cloudbeaver/tests-runner": "workspace:*",
"@cloudbeaver/tsconfig": "workspace:*",
"@jest/globals": "^29",
"@testing-library/dom": "^10",
"@testing-library/jest-dom": "^6",
"@testing-library/react": "^16",
"@types/jest": "^29",
"@types/react": "^19",
"mobx": "^6",
"react": "^19",
"react-dom": "^19",
"typescript": "^5",
"typescript-plugin-css-modules": "^5"
"typescript-plugin-css-modules": "^5",
"vitest": "^3"
}
}
84 changes: 40 additions & 44 deletions webapp/packages/core-blocks/src/Cell.test.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,61 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
// // @ts-nocheck
// import { afterEach, describe, expect, it } from '@jest/globals';
// import { cleanup, waitFor } from '@testing-library/react';

// import { createApp, renderInApp } from '@cloudbeaver/tests-runner';
import { describe, expect, it } from 'vitest';
import { waitFor } from '@testing-library/react';

// import { Cell } from './Cell.js';
import { createApp, renderInApp } from '@cloudbeaver/tests-runner';

// const app = createApp();
import { Cell } from './Cell.js';

// describe('Cell', () => {
// afterEach(() => {
// cleanup();
// });
const app = createApp();

// it('should render children correctly', async () => {
// const { getByText } = renderInApp(<Cell>Test Children</Cell>, app);
// const text = await waitFor(() => getByText('Test Children'));
describe.skip('Cell', () => {
it('should render children correctly', async () => {
const { getByText } = renderInApp(<Cell>Test Children</Cell>, app);
const text = await waitFor(() => getByText('Test Children'));

// expect(text).toBeInTheDocument();
// });
expect(text).toBeInTheDocument();
});

// it('should render before element correctly', async () => {
// const { getByText } = renderInApp(<Cell before={<span>Before Element</span>}>Test Children</Cell>, app);
it('should render before element correctly', async () => {
const { getByText } = renderInApp(<Cell before={<span>Before Element</span>}>Test Children</Cell>, app);

// const beforeText = await waitFor(() => getByText('Before Element'));
// expect(beforeText).toBeInTheDocument();
// });
const beforeText = await waitFor(() => getByText('Before Element'));
expect(beforeText).toBeInTheDocument();
});

// it('should render after element correctly', async () => {
// const { getByText } = renderInApp(<Cell after={<span>After Element</span>}>Test Children</Cell>, app);
it('should render after element correctly', async () => {
const { getByText } = renderInApp(<Cell after={<span>After Element</span>}>Test Children</Cell>, app);

// const afterText = await waitFor(() => getByText('After Element'));
// expect(afterText).toBeInTheDocument();
// });
const afterText = await waitFor(() => getByText('After Element'));
expect(afterText).toBeInTheDocument();
});

// it('should render after and before elements correctly', async () => {
// const { getByText } = renderInApp(
// <Cell before={<span>Before Element</span>} after={<span>After Element</span>}>
// Test Children
// </Cell>,
// app,
// );
it('should render after and before elements correctly', async () => {
const { getByText } = renderInApp(
<Cell before={<span>Before Element</span>} after={<span>After Element</span>}>
Test Children
</Cell>,
app,
);

// const afterText = await waitFor(() => getByText('After Element'));
// const beforeText = await waitFor(() => getByText('Before Element'));
const afterText = await waitFor(() => getByText('After Element'));
const beforeText = await waitFor(() => getByText('Before Element'));

// expect(beforeText).toBeInTheDocument();
// expect(afterText).toBeInTheDocument();
// });
expect(beforeText).toBeInTheDocument();
expect(afterText).toBeInTheDocument();
});

// it('should render description element correctly', async () => {
// const { getByText } = renderInApp(<Cell description={<span>Description Element</span>}>Test Children</Cell>, app);
it('should render description element correctly', async () => {
const { getByText } = renderInApp(<Cell description={<span>Description Element</span>}>Test Children</Cell>, app);

// const description = await waitFor(() => getByText('Description Element'));
// expect(description).toBeInTheDocument();
// });
// });
const description = await waitFor(() => getByText('Description Element'));
expect(description).toBeInTheDocument();
});
});
22 changes: 11 additions & 11 deletions webapp/packages/core-blocks/src/ErrorMessage.test.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
// import { expect, test } from '@jest/globals';
// import { screen, waitFor } from '@testing-library/react';
import { expect, test } from 'vitest';
import { screen, waitFor } from '@testing-library/react';

// import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
// import { createApp, renderInApp } from '@cloudbeaver/tests-runner';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { createApp, renderInApp } from '@cloudbeaver/tests-runner';

// import { ErrorMessage } from './ErrorMessage.js';
import { ErrorMessage } from './ErrorMessage.js';

// const app = createApp(coreLocalizationManifest);
const app = createApp(coreLocalizationManifest);

// test('icons.svg#name', async () => {
// renderInApp(<ErrorMessage text="error" />, app);
// await waitFor(() => expect(screen.getByText('error')).not.toBeNull());
// });
test('icons.svg#name', async () => {
renderInApp(<ErrorMessage text="error" />, app);
await waitFor(() => expect(screen.getByText('error')).not.toBeNull());
});
13 changes: 4 additions & 9 deletions webapp/packages/core-blocks/src/Icon.test.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 DBeaver Corp and others
* Copyright (C) 2020-2025 DBeaver Corp and others
*
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
// @ts-nocheck
import { afterEach, describe, expect, test } from '@jest/globals';
import { cleanup, render, screen } from '@testing-library/react';
import { describe, expect, test } from 'vitest';
import { render, screen } from '@testing-library/react';

import { Icon } from './Icon.js';

describe('Icon', () => {
afterEach(() => {
cleanup();
});

describe.skip('Icon', () => {
test('icons.svg#name', () => {
(globalThis as any)._ROOT_URI_ = undefined;

Expand Down
Loading
Loading