@manojkmfsi/monodog 1.1.37 → 1.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js +20 -0
- package/monodog-dashboard/dist/assets/index-C08ciT3A.js.map +1 -0
- package/monodog-dashboard/dist/assets/index-Dc2vaUOq.css +1 -0
- package/monodog-dashboard/{index.html → dist/index.html} +2 -1
- package/monodog-dashboard/package.json +0 -3
- package/package.json +2 -2
- package/monodog-dashboard/THEME_SYSTEM.md +0 -309
- package/monodog-dashboard/__tests__/AuthCallbackPage.test.ts +0 -138
- package/monodog-dashboard/__tests__/ConfigInspector.test.ts +0 -33
- package/monodog-dashboard/__tests__/DependencyGraph.test.ts +0 -72
- package/monodog-dashboard/__tests__/HealthStatus.test.ts +0 -69
- package/monodog-dashboard/__tests__/LoginPage.test.ts +0 -79
- package/monodog-dashboard/__tests__/PackageDetail.test.ts +0 -22
- package/monodog-dashboard/__tests__/ReleaseManager.test.tsx +0 -510
- package/monodog-dashboard/__tests__/api-client.test.ts +0 -475
- package/monodog-dashboard/__tests__/components.test.ts +0 -117
- package/monodog-dashboard/__tests__/dashboard.utils.test.ts +0 -144
- package/monodog-dashboard/__tests__/dependency.utils.test.ts +0 -125
- package/monodog-dashboard/__tests__/monorepoService.unit.test.ts +0 -103
- package/monodog-dashboard/__tests__/packages.utils.test.ts +0 -37
- package/monodog-dashboard/__tests__/pages.test.ts +0 -103
- package/monodog-dashboard/package-lock.json +0 -4587
- package/monodog-dashboard/postcss.config.js +0 -6
- package/monodog-dashboard/src/components/App.tsx +0 -36
- package/monodog-dashboard/src/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/PermissionGuard.tsx +0 -92
- package/monodog-dashboard/src/components/ProtectedRoute.tsx +0 -24
- package/monodog-dashboard/src/components/configuration/Configuration.tsx +0 -91
- package/monodog-dashboard/src/components/configuration/components/BrandingSettings.tsx +0 -128
- package/monodog-dashboard/src/components/configuration/components/ConfigurationHeader.tsx +0 -34
- package/monodog-dashboard/src/components/configuration/components/ConfigurationModal.tsx +0 -20
- package/monodog-dashboard/src/components/configuration/components/ConfigurationTabs.tsx +0 -30
- package/monodog-dashboard/src/components/configuration/components/FeatureToggles.tsx +0 -66
- package/monodog-dashboard/src/components/configuration/components/GeneralSettings.tsx +0 -77
- package/monodog-dashboard/src/components/configuration/components/MonorepoSettings.tsx +0 -179
- package/monodog-dashboard/src/components/configuration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/configuration/types/config.types.ts +0 -52
- package/monodog-dashboard/src/components/configuration/utils/config.utils.tsx +0 -115
- package/monodog-dashboard/src/components/main-dashboard/Dashboard.tsx +0 -242
- package/monodog-dashboard/src/components/main-dashboard/Layout.tsx +0 -112
- package/monodog-dashboard/src/components/main-dashboard/components/Header.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageDistribution.tsx +0 -35
- package/monodog-dashboard/src/components/main-dashboard/components/PackageSearchFilter.tsx +0 -47
- package/monodog-dashboard/src/components/main-dashboard/components/PackageTable.tsx +0 -87
- package/monodog-dashboard/src/components/main-dashboard/components/QuickActions.tsx +0 -60
- package/monodog-dashboard/src/components/main-dashboard/components/StatsCards.tsx +0 -73
- package/monodog-dashboard/src/components/main-dashboard/components/index.ts +0 -7
- package/monodog-dashboard/src/components/main-dashboard/types/dashboard.types.ts +0 -33
- package/monodog-dashboard/src/components/main-dashboard/utils/dashboard.utils.tsx +0 -70
- package/monodog-dashboard/src/components/modules/ci-integration/CIIntegration.tsx +0 -277
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildDetails.tsx +0 -228
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildList.tsx +0 -212
- package/monodog-dashboard/src/components/modules/ci-integration/components/BuildOverview.tsx +0 -158
- package/monodog-dashboard/src/components/modules/ci-integration/components/CIIntegrationHeader.tsx +0 -38
- package/monodog-dashboard/src/components/modules/ci-integration/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/ci-integration/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/ci-integration/components/PipelineStatus.tsx +0 -223
- package/monodog-dashboard/src/components/modules/ci-integration/components/index.ts +0 -8
- package/monodog-dashboard/src/components/modules/ci-integration/types/ci.types.ts +0 -97
- package/monodog-dashboard/src/components/modules/ci-integration/utils/ci.utils.tsx +0 -264
- package/monodog-dashboard/src/components/modules/config-inspector/ConfigInspector.tsx +0 -324
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigEditor.tsx +0 -93
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigInspectorHeader.tsx +0 -36
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigPreview.tsx +0 -89
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigSidebar.tsx +0 -141
- package/monodog-dashboard/src/components/modules/config-inspector/components/ConfigToolbar.tsx +0 -184
- package/monodog-dashboard/src/components/modules/config-inspector/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/config-inspector/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/config-inspector/components/ValidationPanel.tsx +0 -155
- package/monodog-dashboard/src/components/modules/config-inspector/components/index.ts +0 -9
- package/monodog-dashboard/src/components/modules/config-inspector/types/config.types.ts +0 -100
- package/monodog-dashboard/src/components/modules/config-inspector/utils/config.utils.tsx +0 -704
- package/monodog-dashboard/src/components/modules/dependency-graph/DependencyGraph.tsx +0 -224
- package/monodog-dashboard/src/components/modules/dependency-graph/components/CircularDependencies.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyDetails.tsx +0 -192
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyGraphHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/dependency-graph/components/DependencyList.tsx +0 -177
- package/monodog-dashboard/src/components/modules/dependency-graph/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphLegend.tsx +0 -89
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphStats.tsx +0 -141
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphToolbar.tsx +0 -107
- package/monodog-dashboard/src/components/modules/dependency-graph/components/GraphVisualization.tsx +0 -179
- package/monodog-dashboard/src/components/modules/dependency-graph/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/dependency-graph/components/index.ts +0 -11
- package/monodog-dashboard/src/components/modules/dependency-graph/types/dependency.types.ts +0 -105
- package/monodog-dashboard/src/components/modules/dependency-graph/utils/dependency.utils.tsx +0 -433
- package/monodog-dashboard/src/components/modules/health-status/HealthStatus.tsx +0 -739
- package/monodog-dashboard/src/components/modules/health-status/components/ErrorState.tsx +0 -25
- package/monodog-dashboard/src/components/modules/health-status/components/HealthActions.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/HealthAlerts.tsx +0 -151
- package/monodog-dashboard/src/components/modules/health-status/components/HealthMetrics.tsx +0 -132
- package/monodog-dashboard/src/components/modules/health-status/components/HealthStatusHeader.tsx +0 -30
- package/monodog-dashboard/src/components/modules/health-status/components/LoadingState.tsx +0 -16
- package/monodog-dashboard/src/components/modules/health-status/components/OverallHealthScore.tsx +0 -122
- package/monodog-dashboard/src/components/modules/health-status/components/PackageHealthList.tsx +0 -195
- package/monodog-dashboard/src/components/modules/health-status/types/health.types.ts +0 -80
- package/monodog-dashboard/src/components/modules/health-status/utils/health.utils.tsx +0 -220
- package/monodog-dashboard/src/components/modules/packages/PackageDetail.tsx +0 -255
- package/monodog-dashboard/src/components/modules/packages/PackagesOverview.tsx +0 -166
- package/monodog-dashboard/src/components/modules/packages/components/ConfigurationTab.tsx +0 -311
- package/monodog-dashboard/src/components/modules/packages/components/DependenciesTab.tsx +0 -154
- package/monodog-dashboard/src/components/modules/packages/components/ErrorState.tsx +0 -21
- package/monodog-dashboard/src/components/modules/packages/components/HealthMetricsTab.tsx +0 -275
- package/monodog-dashboard/src/components/modules/packages/components/LoadingState.tsx +0 -14
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailHeader.tsx +0 -167
- package/monodog-dashboard/src/components/modules/packages/components/PackageDetailTabs.tsx +0 -49
- package/monodog-dashboard/src/components/modules/packages/components/PackageStats.tsx +0 -70
- package/monodog-dashboard/src/components/modules/packages/components/PackagesTable.tsx +0 -163
- package/monodog-dashboard/src/components/modules/packages/components/RecentCommitsTab.tsx +0 -90
- package/monodog-dashboard/src/components/modules/packages/components/SearchAndFilter.tsx +0 -66
- package/monodog-dashboard/src/components/modules/packages/components/index.ts +0 -12
- package/monodog-dashboard/src/components/modules/packages/types/packages.types.ts +0 -101
- package/monodog-dashboard/src/components/modules/packages/utils/packages.utils.tsx +0 -178
- package/monodog-dashboard/src/components/pipeline/JobsList.tsx +0 -83
- package/monodog-dashboard/src/components/pipeline/LogViewer.tsx +0 -392
- package/monodog-dashboard/src/components/pipeline/PipelineManager.tsx +0 -562
- package/monodog-dashboard/src/components/pipeline/WorkflowRunsList.tsx +0 -272
- package/monodog-dashboard/src/components/pipeline/WorkflowTrigger.tsx +0 -182
- package/monodog-dashboard/src/components/pipeline/utils/pipeline.utils.tsx +0 -11
- package/monodog-dashboard/src/components/publish-control/PublishControl.tsx +0 -229
- package/monodog-dashboard/src/components/publish-control/components/ChangelogViewer.tsx +0 -103
- package/monodog-dashboard/src/components/publish-control/components/ErrorState.tsx +0 -23
- package/monodog-dashboard/src/components/publish-control/components/LoadingState.tsx +0 -10
- package/monodog-dashboard/src/components/publish-control/components/PackageReleaseTable.tsx +0 -140
- package/monodog-dashboard/src/components/publish-control/components/PublishHeader.tsx +0 -30
- package/monodog-dashboard/src/components/publish-control/components/QuickActionCards.tsx +0 -56
- package/monodog-dashboard/src/components/publish-control/components/ReleaseSchedule.tsx +0 -104
- package/monodog-dashboard/src/components/publish-control/components/index.ts +0 -8
- package/monodog-dashboard/src/components/publish-control/types/publish.types.ts +0 -39
- package/monodog-dashboard/src/components/publish-control/utils/publish.utils.ts +0 -59
- package/monodog-dashboard/src/components/release-manager/ReleaseManager.tsx +0 -342
- package/monodog-dashboard/src/components/release-manager/components/ChangesetPreview.tsx +0 -123
- package/monodog-dashboard/src/components/release-manager/components/ErrorState.tsx +0 -38
- package/monodog-dashboard/src/components/release-manager/components/LoadingState.tsx +0 -18
- package/monodog-dashboard/src/components/release-manager/components/PackageSelector.tsx +0 -137
- package/monodog-dashboard/src/components/release-manager/components/PublishConfirmation.tsx +0 -150
- package/monodog-dashboard/src/components/release-manager/components/ReleaseValidation.tsx +0 -138
- package/monodog-dashboard/src/components/release-manager/components/VersionBumpSelector.tsx +0 -142
- package/monodog-dashboard/src/components/release-manager/types/index.ts +0 -9
- package/monodog-dashboard/src/components/release-manager/types/release-manager.types.ts +0 -29
- package/monodog-dashboard/src/components/setup-guide/SetupGuide.tsx +0 -96
- package/monodog-dashboard/src/components/setup-guide/components/SetupHeader.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupModal.tsx +0 -24
- package/monodog-dashboard/src/components/setup-guide/components/SetupProgress.tsx +0 -29
- package/monodog-dashboard/src/components/setup-guide/components/StepContent.tsx +0 -272
- package/monodog-dashboard/src/components/setup-guide/components/StepNavigation.tsx +0 -62
- package/monodog-dashboard/src/components/setup-guide/components/index.ts +0 -6
- package/monodog-dashboard/src/components/setup-guide/types/setup.types.ts +0 -38
- package/monodog-dashboard/src/components/setup-guide/utils/setup.utils.ts +0 -79
- package/monodog-dashboard/src/constants/api-config.ts +0 -81
- package/monodog-dashboard/src/constants/index.ts +0 -9
- package/monodog-dashboard/src/constants/messages.ts +0 -40
- package/monodog-dashboard/src/icons/heroicons.ts +0 -65
- package/monodog-dashboard/src/icons/index.tsx +0 -1788
- package/monodog-dashboard/src/index.css +0 -175
- package/monodog-dashboard/src/main.tsx +0 -9
- package/monodog-dashboard/src/pages/AuthCallbackPage.tsx +0 -103
- package/monodog-dashboard/src/pages/CIPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ConfigPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DashboardPage.tsx +0 -6
- package/monodog-dashboard/src/pages/DependenciesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/HealthPage.tsx +0 -6
- package/monodog-dashboard/src/pages/LoginPage.tsx +0 -77
- package/monodog-dashboard/src/pages/PackageDetailPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PackagesPage.tsx +0 -6
- package/monodog-dashboard/src/pages/PipelinePage.tsx +0 -22
- package/monodog-dashboard/src/pages/PublishPage.tsx +0 -6
- package/monodog-dashboard/src/pages/ReleaseManagerPage.tsx +0 -9
- package/monodog-dashboard/src/pages/index.ts +0 -28
- package/monodog-dashboard/src/routes/AppRouter.tsx +0 -89
- package/monodog-dashboard/src/routes/AppRouterPages.tsx +0 -56
- package/monodog-dashboard/src/routes/index.ts +0 -10
- package/monodog-dashboard/src/routes/routes.config.ts +0 -94
- package/monodog-dashboard/src/services/api/api-client.ts +0 -189
- package/monodog-dashboard/src/services/api/index.ts +0 -30
- package/monodog-dashboard/src/services/api/types/api.types.ts +0 -63
- package/monodog-dashboard/src/services/auth-context.tsx +0 -344
- package/monodog-dashboard/src/services/monorepoService.ts +0 -733
- package/monodog-dashboard/src/services/permission-context.tsx +0 -193
- package/monodog-dashboard/src/theme/COMPONENT_UPDATES.md +0 -273
- package/monodog-dashboard/src/theme/INTEGRATION.md +0 -381
- package/monodog-dashboard/src/theme/README.md +0 -239
- package/monodog-dashboard/src/theme/examples.tsx +0 -386
- package/monodog-dashboard/src/theme/index.ts +0 -402
- package/monodog-dashboard/src/theme/migration-guide.md +0 -335
- package/monodog-dashboard/src/types/auth-context.types.ts +0 -51
- package/monodog-dashboard/src/types/component.types.ts +0 -96
- package/monodog-dashboard/src/types/icons.types.ts +0 -13
- package/monodog-dashboard/src/types/index.ts +0 -68
- package/monodog-dashboard/src/types/monorepo-service.types.ts +0 -53
- package/monodog-dashboard/src/types/permission-context.types.ts +0 -49
- package/monodog-dashboard/src/types/pipeline.types.ts +0 -89
- package/monodog-dashboard/src/types/routes.types.ts +0 -12
- package/monodog-dashboard/src/utils/cookies.ts +0 -47
- package/monodog-dashboard/tailwind.config.js +0 -68
- package/monodog-dashboard/tsconfig.app.json +0 -14
- package/monodog-dashboard/tsconfig.json +0 -17
- package/monodog-dashboard/tsconfig.node.json +0 -10
- package/monodog-dashboard/vite.config.ts +0 -9
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for dashboard utility functions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
calculatePackageStats,
|
|
7
|
-
getUniquePackageTypes,
|
|
8
|
-
filterPackages,
|
|
9
|
-
getStatusColor,
|
|
10
|
-
getTypeIcon,
|
|
11
|
-
} from '../src/components/main-dashboard/utils/dashboard.utils';
|
|
12
|
-
|
|
13
|
-
describe('Dashboard Utils', () => {
|
|
14
|
-
describe('calculatePackageStats', () => {
|
|
15
|
-
it('should calculate stats for empty array', () => {
|
|
16
|
-
const stats = calculatePackageStats([]);
|
|
17
|
-
expect(stats).toEqual({
|
|
18
|
-
total: 0,
|
|
19
|
-
apps: 0,
|
|
20
|
-
libs: 0,
|
|
21
|
-
tools: 0,
|
|
22
|
-
custom: 0,
|
|
23
|
-
totalDependencies: 0,
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('should count packages by type', () => {
|
|
28
|
-
const packages = [
|
|
29
|
-
{ name: 'app-1', type: 'app', description: 'test', dependencies: {}, peerDependencies: {}, devDependencies: {} } as any,
|
|
30
|
-
{ name: 'lib-1', type: 'lib', description: 'test', dependencies: {}, peerDependencies: {}, devDependencies: {} } as any,
|
|
31
|
-
{ name: 'tool-1', type: 'tool', description: 'test', dependencies: {}, peerDependencies: {}, devDependencies: {} } as any,
|
|
32
|
-
];
|
|
33
|
-
|
|
34
|
-
const stats = calculatePackageStats(packages);
|
|
35
|
-
expect(stats.total).toBe(3);
|
|
36
|
-
expect(stats.apps).toBe(1);
|
|
37
|
-
expect(stats.libs).toBe(1);
|
|
38
|
-
expect(stats.tools).toBe(1);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should count total dependencies', () => {
|
|
42
|
-
const packages = [
|
|
43
|
-
{
|
|
44
|
-
name: 'pkg-1',
|
|
45
|
-
type: 'app',
|
|
46
|
-
description: 'test',
|
|
47
|
-
dependencies: { dep1: '1.0.0', dep2: '2.0.0' },
|
|
48
|
-
peerDependencies: { peer1: '1.0.0' },
|
|
49
|
-
devDependencies: { dev1: '1.0.0' },
|
|
50
|
-
} as any,
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const stats = calculatePackageStats(packages);
|
|
54
|
-
expect(stats.totalDependencies).toBe(4);
|
|
55
|
-
});
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('getUniquePackageTypes', () => {
|
|
59
|
-
it('should return empty array for empty packages', () => {
|
|
60
|
-
const types = getUniquePackageTypes([]);
|
|
61
|
-
expect(types).toEqual([]);
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('should extract unique types', () => {
|
|
65
|
-
const packages = [
|
|
66
|
-
{ name: 'pkg-1', type: 'app', description: 'test' } as any,
|
|
67
|
-
{ name: 'pkg-2', type: 'lib', description: 'test' } as any,
|
|
68
|
-
{ name: 'pkg-3', type: 'app', description: 'test' } as any,
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
const types = getUniquePackageTypes(packages);
|
|
72
|
-
expect(types).toHaveLength(2);
|
|
73
|
-
expect(types).toContain('app');
|
|
74
|
-
expect(types).toContain('lib');
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
describe('filterPackages', () => {
|
|
79
|
-
const packages = [
|
|
80
|
-
{ name: 'react-app', type: 'app', description: 'React application' } as any,
|
|
81
|
-
{ name: 'utils-lib', type: 'lib', description: 'Utility library' } as any,
|
|
82
|
-
{ name: 'build-tool', type: 'tool', description: 'Build tool' } as any,
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
it('should filter by search term in name', () => {
|
|
86
|
-
const filtered = filterPackages(packages, 'react', 'all');
|
|
87
|
-
expect(filtered).toHaveLength(1);
|
|
88
|
-
expect(filtered[0].name).toBe('react-app');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('should filter by search term in description', () => {
|
|
92
|
-
const filtered = filterPackages(packages, 'library', 'all');
|
|
93
|
-
expect(filtered).toHaveLength(1);
|
|
94
|
-
expect(filtered[0].name).toBe('utils-lib');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('should filter by type', () => {
|
|
98
|
-
const filtered = filterPackages(packages, '', 'lib');
|
|
99
|
-
expect(filtered).toHaveLength(1);
|
|
100
|
-
expect(filtered[0].type).toBe('lib');
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
it('should combine search and type filters', () => {
|
|
104
|
-
const filtered = filterPackages(packages, 'build', 'tool');
|
|
105
|
-
expect(filtered).toHaveLength(1);
|
|
106
|
-
expect(filtered[0].name).toBe('build-tool');
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
it('should return empty when no matches', () => {
|
|
110
|
-
const filtered = filterPackages(packages, 'nonexistent', 'all');
|
|
111
|
-
expect(filtered).toHaveLength(0);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
describe('getStatusColor', () => {
|
|
116
|
-
it('should return app color', () => {
|
|
117
|
-
const color = getStatusColor('app');
|
|
118
|
-
expect(color).toBe('bg-blue-100 text-blue-800');
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
it('should return lib color', () => {
|
|
122
|
-
const color = getStatusColor('lib');
|
|
123
|
-
expect(color).toBe('bg-green-100 text-green-800');
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
it('should return tool color', () => {
|
|
127
|
-
const color = getStatusColor('tool');
|
|
128
|
-
expect(color).toBe('bg-purple-100 text-purple-800');
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('should return default color for unknown type', () => {
|
|
132
|
-
const color = getStatusColor('unknown');
|
|
133
|
-
expect(color).toBe('bg-gray-100 text-gray-800');
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
describe('getTypeIcon', () => {
|
|
138
|
-
|
|
139
|
-
it('should return tool icon', () => {
|
|
140
|
-
const icon = getTypeIcon('tool');
|
|
141
|
-
expect(icon).toBe('🔧');
|
|
142
|
-
});
|
|
143
|
-
});
|
|
144
|
-
});
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for dependency graph utility functions
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
getStatusColor,
|
|
7
|
-
getTypeColor,
|
|
8
|
-
getDependencyStatusColor,
|
|
9
|
-
calculateGraphStats,
|
|
10
|
-
} from '../src/components/modules/dependency-graph/utils/dependency.utils';
|
|
11
|
-
|
|
12
|
-
describe('Dependency Graph Utils', () => {
|
|
13
|
-
describe('getStatusColor', () => {
|
|
14
|
-
it('should return green for healthy status', () => {
|
|
15
|
-
const color = getStatusColor('healthy');
|
|
16
|
-
expect(color).toBe('text-green-600 bg-green-100');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should return yellow for warning status', () => {
|
|
20
|
-
const color = getStatusColor('warning');
|
|
21
|
-
expect(color).toBe('text-yellow-600 bg-yellow-100');
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it('should return red for error status', () => {
|
|
25
|
-
const color = getStatusColor('error');
|
|
26
|
-
expect(color).toBe('text-red-600 bg-red-100');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('should return gray for unknown status', () => {
|
|
30
|
-
const color = getStatusColor('unknown');
|
|
31
|
-
expect(color).toBe('text-gray-600 bg-gray-100');
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
describe('getTypeColor', () => {
|
|
36
|
-
it('should return blue for app type', () => {
|
|
37
|
-
const color = getTypeColor('app');
|
|
38
|
-
expect(color).toBe('text-blue-600 bg-blue-100');
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should return purple for lib type', () => {
|
|
42
|
-
const color = getTypeColor('lib');
|
|
43
|
-
expect(color).toBe('text-purple-600 bg-purple-100');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('should return orange for tool type', () => {
|
|
47
|
-
const color = getTypeColor('tool');
|
|
48
|
-
expect(color).toBe('text-orange-600 bg-orange-100');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('should return gray for unknown type', () => {
|
|
52
|
-
const color = getTypeColor('unknown');
|
|
53
|
-
expect(color).toBe('text-gray-600 bg-gray-100');
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe('getDependencyStatusColor', () => {
|
|
58
|
-
it('should return color for healthy dependency', () => {
|
|
59
|
-
const packages = [
|
|
60
|
-
{ name: 'dep-1', status: 'healthy', type: 'lib', dependencies: [] } as any,
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
const color = getDependencyStatusColor('dep-1', packages);
|
|
64
|
-
expect(color).toBe('text-green-500');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should return color for warning dependency', () => {
|
|
68
|
-
const packages = [
|
|
69
|
-
{ name: 'dep-1', status: 'warning', type: 'lib', dependencies: [] } as any,
|
|
70
|
-
];
|
|
71
|
-
|
|
72
|
-
const color = getDependencyStatusColor('dep-1', packages);
|
|
73
|
-
expect(color).toBe('text-yellow-500');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
it('should return color for error dependency', () => {
|
|
77
|
-
const packages = [
|
|
78
|
-
{ name: 'dep-1', status: 'error', type: 'lib', dependencies: [] } as any,
|
|
79
|
-
];
|
|
80
|
-
|
|
81
|
-
const color = getDependencyStatusColor('dep-1', packages);
|
|
82
|
-
expect(color).toBe('text-red-500');
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it('should return gray for missing dependency', () => {
|
|
86
|
-
const packages = [] as any;
|
|
87
|
-
|
|
88
|
-
const color = getDependencyStatusColor('missing-dep', packages);
|
|
89
|
-
expect(color).toBe('text-gray-400');
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
describe('calculateGraphStats', () => {
|
|
94
|
-
it('should calculate stats for empty graph', () => {
|
|
95
|
-
const stats = calculateGraphStats([]);
|
|
96
|
-
expect(stats.totalPackages).toBe(0);
|
|
97
|
-
expect(stats.totalDependencies).toBe(0);
|
|
98
|
-
expect(stats.avgDependencies).toBe(0);
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
it('should calculate graph statistics', () => {
|
|
102
|
-
const packages = [
|
|
103
|
-
{ name: 'pkg-1', dependencies: ['dep-1', 'dep-2'], dependents: [], status: 'healthy', type: 'lib' } as any,
|
|
104
|
-
{ name: 'pkg-2', dependencies: ['dep-1'], dependents: ['pkg-1'], status: 'healthy', type: 'lib' } as any,
|
|
105
|
-
{ name: 'pkg-3', dependencies: [], dependents: [], status: 'healthy', type: 'lib' } as any,
|
|
106
|
-
];
|
|
107
|
-
|
|
108
|
-
const stats = calculateGraphStats(packages);
|
|
109
|
-
expect(stats.totalPackages).toBe(3);
|
|
110
|
-
expect(stats.totalDependencies).toBe(3);
|
|
111
|
-
expect(stats.avgDependencies).toBe(1);
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it('should handle packages with different dependency counts', () => {
|
|
115
|
-
const packages = [
|
|
116
|
-
{ name: 'pkg-1', dependencies: ['dep-1', 'dep-2', 'dep-3'], dependents: [], status: 'healthy', type: 'lib' } as any,
|
|
117
|
-
{ name: 'pkg-2', dependencies: [], dependents: ['pkg-1'], status: 'healthy', type: 'lib' } as any,
|
|
118
|
-
];
|
|
119
|
-
|
|
120
|
-
const stats = calculateGraphStats(packages);
|
|
121
|
-
expect(stats.totalPackages).toBe(2);
|
|
122
|
-
expect(stats.totalDependencies).toBe(3);
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
// Unit tests for monorepoService — single consolidated suite
|
|
2
|
-
|
|
3
|
-
// Mock the dependencies before importing monorepoService
|
|
4
|
-
jest.mock('../src/constants/api-config', () => ({
|
|
5
|
-
DASHBOARD_API_ENDPOINTS: {
|
|
6
|
-
PACKAGES: {
|
|
7
|
-
LIST: '/packages',
|
|
8
|
-
DETAILS: (name: string) => `/packages/${name}`,
|
|
9
|
-
STATS: '/packages/stats',
|
|
10
|
-
},
|
|
11
|
-
HEALTH: '/health',
|
|
12
|
-
CI_STATUS: '/ci-status',
|
|
13
|
-
CONFIGURATION: {
|
|
14
|
-
LIST: '/configuration',
|
|
15
|
-
GET: (id: string) => `/configuration/${id}`,
|
|
16
|
-
UPDATE: (id: string) => `/configuration/${id}`,
|
|
17
|
-
DELETE: (id: string) => `/configuration/${id}`,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
API_CONFIG: {
|
|
21
|
-
timeout: 30000,
|
|
22
|
-
retries: 3,
|
|
23
|
-
},
|
|
24
|
-
}));
|
|
25
|
-
|
|
26
|
-
jest.mock('../src/services/api', () => ({
|
|
27
|
-
__esModule: true,
|
|
28
|
-
default: {
|
|
29
|
-
get: jest.fn().mockResolvedValue({ success: true, data: [] }),
|
|
30
|
-
post: jest.fn().mockResolvedValue({ success: true, data: {} }),
|
|
31
|
-
put: jest.fn().mockResolvedValue({ success: true, data: {} }),
|
|
32
|
-
delete: jest.fn().mockResolvedValue({ success: true }),
|
|
33
|
-
},
|
|
34
|
-
}));
|
|
35
|
-
|
|
36
|
-
// Create a mock for Package type
|
|
37
|
-
export type Package = {
|
|
38
|
-
name: string;
|
|
39
|
-
version: string;
|
|
40
|
-
type: 'app' | 'lib' | 'tool';
|
|
41
|
-
description?: string;
|
|
42
|
-
path: string;
|
|
43
|
-
dependencies?: Record<string, string>;
|
|
44
|
-
devDependencies?: Record<string, string>;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// Import the actual service
|
|
48
|
-
import { monorepoService } from '../src/services/monorepoService';
|
|
49
|
-
|
|
50
|
-
beforeAll(() => {
|
|
51
|
-
// provide minimal window ENV used by the service
|
|
52
|
-
(global as any).window = { ENV: { API_URL: 'localhost:8999' } };
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
beforeEach(() => {
|
|
56
|
-
jest.clearAllMocks();
|
|
57
|
-
// mock global fetch by default; individual tests will override resolve/reject
|
|
58
|
-
(global as any).fetch = jest.fn();
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
describe('monorepoService (unit)', () => {
|
|
62
|
-
describe('Service exists', () => {
|
|
63
|
-
it('monorepoService should be defined', () => {
|
|
64
|
-
expect(monorepoService).toBeDefined();
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should have getPackages method', () => {
|
|
68
|
-
expect(typeof monorepoService.getPackages).toBe('function');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('should have getPackage method', () => {
|
|
72
|
-
expect(typeof monorepoService.getPackage).toBe('function');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('should have getDependencies method', () => {
|
|
76
|
-
expect(typeof monorepoService.getDependencies).toBe('function');
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
it('should have refreshPackages method', () => {
|
|
80
|
-
expect(typeof monorepoService.refreshPackages).toBe('function');
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it('should have getHealthStatus method', () => {
|
|
84
|
-
expect(typeof monorepoService.getHealthStatus).toBe('function');
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('should have refreshHealthStatus method', () => {
|
|
88
|
-
expect(typeof monorepoService.refreshHealthStatus).toBe('function');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('should have updatePackageConfiguration method', () => {
|
|
92
|
-
expect(typeof monorepoService.updatePackageConfiguration).toBe('function');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('should have getConfigurationFiles method', () => {
|
|
96
|
-
expect(typeof monorepoService.getConfigurationFiles).toBe('function');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('should have saveConfigurationFile method', () => {
|
|
100
|
-
expect(typeof monorepoService.saveConfigurationFile).toBe('function');
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for package utilities
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
calculatePackageStats,
|
|
7
|
-
getUniquePackageTypes,
|
|
8
|
-
getUniquePackageStatuses,
|
|
9
|
-
filterPackages,
|
|
10
|
-
sortPackages,
|
|
11
|
-
} from '../src/components/modules/packages/utils/packages.utils';
|
|
12
|
-
|
|
13
|
-
describe('Packages Utils', () => {
|
|
14
|
-
it('calculatePackageStats handles empty list', () => {
|
|
15
|
-
const stats = calculatePackageStats([] as any);
|
|
16
|
-
expect(stats.total).toBe(0);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('getUniquePackageTypes returns unique types', () => {
|
|
20
|
-
const pkgs = [
|
|
21
|
-
{ name: 'a', type: 'app' },
|
|
22
|
-
{ name: 'b', type: 'lib' },
|
|
23
|
-
{ name: 'c', type: 'app' },
|
|
24
|
-
] as any;
|
|
25
|
-
const types = getUniquePackageTypes(pkgs);
|
|
26
|
-
expect(types).toHaveLength(2);
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('filterPackages filters by name', () => {
|
|
30
|
-
const pkgs = [
|
|
31
|
-
{ name: 'react-app', type: 'app', description: 'A React app', status: 'healthy' },
|
|
32
|
-
{ name: 'utils', type: 'lib', description: 'Utility library', status: 'healthy' },
|
|
33
|
-
] as any;
|
|
34
|
-
const filtered = filterPackages(pkgs, { search: 'react', type: 'all', status: 'all' });
|
|
35
|
-
expect(filtered).toHaveLength(1);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for page wrapper components.
|
|
3
|
-
* These are basic smoke tests to ensure pages export and have expected structure.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
// Mock API dependencies
|
|
7
|
-
jest.mock('../src/constants/api-config', () => ({
|
|
8
|
-
DASHBOARD_API_ENDPOINTS: {
|
|
9
|
-
PACKAGES: {
|
|
10
|
-
LIST: '/packages',
|
|
11
|
-
DETAILS: jest.fn((name: string) => `/packages/${name}`),
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
API_CONFIG: {},
|
|
15
|
-
}));
|
|
16
|
-
|
|
17
|
-
jest.mock('../src/services/api', () => ({
|
|
18
|
-
__esModule: true,
|
|
19
|
-
default: {},
|
|
20
|
-
}));
|
|
21
|
-
|
|
22
|
-
// Mock the components before importing pages
|
|
23
|
-
jest.mock('../src/components/main-dashboard/Dashboard', () => ({
|
|
24
|
-
__esModule: true,
|
|
25
|
-
default: jest.fn(() => null),
|
|
26
|
-
}));
|
|
27
|
-
|
|
28
|
-
jest.mock('../src/components/modules/health-status/HealthStatus', () => ({
|
|
29
|
-
__esModule: true,
|
|
30
|
-
default: jest.fn(() => null),
|
|
31
|
-
}));
|
|
32
|
-
|
|
33
|
-
jest.mock('../src/components/modules/packages/PackagesOverview', () => ({
|
|
34
|
-
__esModule: true,
|
|
35
|
-
default: jest.fn(() => null),
|
|
36
|
-
}));
|
|
37
|
-
|
|
38
|
-
jest.mock('../src/components/modules/packages/PackageDetail', () => ({
|
|
39
|
-
__esModule: true,
|
|
40
|
-
default: jest.fn(() => null),
|
|
41
|
-
}));
|
|
42
|
-
|
|
43
|
-
jest.mock('../src/components/modules/ci-integration/CIIntegration', () => ({
|
|
44
|
-
__esModule: true,
|
|
45
|
-
default: jest.fn(() => null),
|
|
46
|
-
}));
|
|
47
|
-
|
|
48
|
-
jest.mock('../src/components/modules/config-inspector/ConfigInspector', () => ({
|
|
49
|
-
__esModule: true,
|
|
50
|
-
default: jest.fn(() => null),
|
|
51
|
-
}));
|
|
52
|
-
|
|
53
|
-
jest.mock('../src/services/monorepoService', () => ({
|
|
54
|
-
__esModule: true,
|
|
55
|
-
monorepoService: {},
|
|
56
|
-
}));
|
|
57
|
-
|
|
58
|
-
// Import pages after mocking their dependencies
|
|
59
|
-
import DashboardPage from '../src/pages/DashboardPage';
|
|
60
|
-
import HealthPage from '../src/pages/HealthPage';
|
|
61
|
-
import PackagesPage from '../src/pages/PackagesPage';
|
|
62
|
-
import PackageDetailPage from '../src/pages/PackageDetailPage';
|
|
63
|
-
import ConfigPage from '../src/pages/ConfigPage';
|
|
64
|
-
|
|
65
|
-
describe('Page exports', () => {
|
|
66
|
-
test('DashboardPage exports a valid component', () => {
|
|
67
|
-
expect(DashboardPage).toBeDefined();
|
|
68
|
-
expect(typeof DashboardPage).toBe('function');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
test('HealthPage exports a valid component', () => {
|
|
72
|
-
expect(HealthPage).toBeDefined();
|
|
73
|
-
expect(typeof HealthPage).toBe('function');
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
test('PackagesPage exports a valid component', () => {
|
|
77
|
-
expect(PackagesPage).toBeDefined();
|
|
78
|
-
expect(typeof PackagesPage).toBe('function');
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
test('PackageDetailPage exports a valid component', () => {
|
|
82
|
-
expect(PackageDetailPage).toBeDefined();
|
|
83
|
-
expect(typeof PackageDetailPage).toBe('function');
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
test('ConfigPage exports a valid component', () => {
|
|
87
|
-
expect(ConfigPage).toBeDefined();
|
|
88
|
-
expect(typeof ConfigPage).toBe('function');
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
describe('Page components structure', () => {
|
|
93
|
-
test('all pages return JSX', () => {
|
|
94
|
-
// These should be callable React components
|
|
95
|
-
const pages = [DashboardPage, HealthPage, PackagesPage, PackageDetailPage, ConfigPage];
|
|
96
|
-
|
|
97
|
-
pages.forEach(page => {
|
|
98
|
-
expect(typeof page).toBe('function');
|
|
99
|
-
// Each page should be a React component (function)
|
|
100
|
-
expect(page.length >= 0).toBe(true);
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
});
|