Skip to content

Commit

Permalink
CB-4898 remove extra deps (#3100)
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov authored Nov 28, 2024
1 parent ea8605e commit 85bfcc0
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 12 deletions.
5 changes: 1 addition & 4 deletions webapp/packages/core-blocks/src/ErrorMessage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
import { expect, test } from '@jest/globals';
import { screen, waitFor } from '@testing-library/react';

import { coreEventsManifest } from '@cloudbeaver/core-events';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { coreSettingsManifest } from '@cloudbeaver/core-settings';
import { coreThemingManifest } from '@cloudbeaver/core-theming';
import { createApp, renderInApp } from '@cloudbeaver/tests-runner';

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

const app = createApp(coreEventsManifest, coreSettingsManifest, coreThemingManifest, coreLocalizationManifest);
const app = createApp(coreLocalizationManifest);

test('icons.svg#name', async () => {
renderInApp(<ErrorMessage text="error" />, app);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
import { expect, test } from '@jest/globals';

import { coreBrowserManifest } from '@cloudbeaver/core-browser';
import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { coreRootManifest, ServerConfigResource } from '@cloudbeaver/core-root';
Expand All @@ -30,7 +29,6 @@ import { coreBrowserSettingsManifest } from './manifest.js';
const endpoint = createGQLEndpoint();
const server = mockGraphQL(...mockAppInit(endpoint));
const app = createApp(
coreBrowserManifest,
coreBrowserSettingsManifest,
coreRootManifest,
coreSDKManifest,
Expand Down
2 changes: 0 additions & 2 deletions webapp/packages/core-theming/src/ThemeSettingsService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { expect, test } from '@jest/globals';

import { coreClientActivityManifest } from '@cloudbeaver/core-client-activity';
import { coreEventsManifest } from '@cloudbeaver/core-events';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { coreRootManifest, ServerConfigResource } from '@cloudbeaver/core-root';
import { createGQLEndpoint } from '@cloudbeaver/core-root/dist/__custom_mocks__/createGQLEndpoint.js';
Expand All @@ -31,7 +30,6 @@ const endpoint = createGQLEndpoint();
const server = mockGraphQL(...mockAppInit(endpoint));
const app = createApp(
coreThemingManifest,
coreEventsManifest,
coreRootManifest,
coreSDKManifest,
coreSettingsManifest,
Expand Down
38 changes: 38 additions & 0 deletions webapp/packages/core-utils/src/isNumber.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* CloudBeaver - Cloud Database Manager
* Copyright (C) 2020-2024 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 { describe, expect, test } from '@jest/globals';

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

describe('isNumber', () => {
test('returns true for valid numbers', () => {
expect(isNumber(123)).toBe(true);
expect(isNumber(123.45)).toBe(true);
expect(isNumber('123')).toBe(true);
expect(isNumber('123.45')).toBe(true);
expect(isNumber(0)).toBe(true);
});

test('returns false for non-numeric strings', () => {
expect(isNumber('hello')).toBe(false);
expect(isNumber('123abc')).toBe(false);
expect(isNumber('')).toBe(false);
});

test('returns false for non-numeric values', () => {
expect(isNumber(NaN)).toBe(false);
expect(isNumber(Infinity)).toBe(false);
expect(isNumber(-Infinity)).toBe(false);
expect(isNumber(null)).toBe(false);
expect(isNumber(undefined)).toBe(false);
expect(isNumber({})).toBe(false);
expect(isNumber([])).toBe(false);
expect(isNumber(true)).toBe(false);
expect(isNumber(false)).toBe(false);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { coreDialogsManifest } from '@cloudbeaver/core-dialogs';
import { coreEventsManifest } from '@cloudbeaver/core-events';
import { coreLocalizationManifest } from '@cloudbeaver/core-localization';
import { coreNavigationTree } from '@cloudbeaver/core-navigation-tree';
import { coreProductManifest } from '@cloudbeaver/core-product';
import { coreProjectsManifest } from '@cloudbeaver/core-projects';
import { coreRootManifest } from '@cloudbeaver/core-root';
import { createGQLEndpoint } from '@cloudbeaver/core-root/dist/__custom_mocks__/createGQLEndpoint.js';
Expand All @@ -29,7 +28,6 @@ import { coreRoutingManifest } from '@cloudbeaver/core-routing';
import { coreSDKManifest } from '@cloudbeaver/core-sdk';
import { coreSettingsManifest } from '@cloudbeaver/core-settings';
import { coreStorageManifest } from '@cloudbeaver/core-storage';
import { coreThemingManifest } from '@cloudbeaver/core-theming';
import { coreUIManifest } from '@cloudbeaver/core-ui';
import { coreViewManifest } from '@cloudbeaver/core-view';
import { datasourceContextSwitchPluginManifest } from '@cloudbeaver/plugin-datasource-context-switch';
Expand All @@ -45,7 +43,6 @@ const app = createApp(
navigationTreePlugin,
coreLocalizationManifest,
coreEventsManifest,
coreProductManifest,
coreRootManifest,
coreSDKManifest,
coreBrowserManifest,
Expand All @@ -63,7 +60,6 @@ const app = createApp(
navigationTabsPlugin,
coreNavigationTree,
coreAppManifest,
coreThemingManifest,
coreClientActivityManifest,
);

Expand Down

0 comments on commit 85bfcc0

Please sign in to comment.