Skip to content

Commit 9daf426

Browse files
committed
Increase timeout for component registration tests and improve detail-view component assertions
1 parent f5596b0 commit 9daf426

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

packages/plugin-charts/src/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('Plugin Charts', () => {
1313
// Import all renderers to register them
1414
beforeAll(async () => {
1515
await import('./index');
16-
});
16+
}, 30000);
1717

1818
describe('bar-chart component', () => {
1919
it('should be registered in ComponentRegistry', () => {

packages/plugin-charts/src/registration.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { ComponentRegistry } from '@object-ui/core';
66
describe('Plugin Charts Registration', () => {
77
beforeAll(async () => {
88
await import('./index');
9-
});
9+
}, 30000);
1010

1111
it('registers bar-chart component', () => {
1212
const config = ComponentRegistry.get('bar-chart');
1313
expect(config).toBeDefined();
1414
});
1515

1616
it('registers chart component types', () => {
17-
expect(ComponentRegistry.get('chart-renderer')).toBeDefined(); // Assuming base
17+
expect(ComponentRegistry.get('chart')).toBeDefined(); // Assuming base
1818
// Verify aliases if they exist
1919
expect(ComponentRegistry.get('pie-chart')).toBeDefined();
2020
expect(ComponentRegistry.get('donut-chart')).toBeDefined();
Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import React from 'react';
2-
import { render, screen } from '@testing-library/react';
3-
import { describe, it, expect, vi, beforeAll } from 'vitest';
1+
import { describe, it, expect, beforeAll } from 'vitest';
42
import { ComponentRegistry } from '@object-ui/core';
53

64
describe('Plugin Detail Registration', () => {
@@ -9,27 +7,12 @@ describe('Plugin Detail Registration', () => {
97
});
108

119
it('registers detail-view component', () => {
12-
const config = ComponentRegistry.get('detail-view');
13-
console.log('DetailView Config Type:', typeof config);
14-
console.log('DetailView Config Keys:', config ? Object.keys(config) : 'null');
15-
console.log('DetailView Config Component:', (config as any)?.component);
10+
// We must use getConfig to retrieve the metadata (label, category, etc.)
11+
// .get() only returns the React Component.
12+
const config = ComponentRegistry.getConfig('detail-view');
1613

17-
// If config IS the component (e.g. legacy mode?), we might need to handle it.
18-
// But Registry.ts says it returns config object.
19-
20-
// For now, let's see what we got.
21-
if ((config as any)?.label) {
22-
expect((config as any).label).toBe('Detail View');
23-
} else {
24-
// Fail with info
25-
console.error('Config missing label:', config);
26-
// expect(true).toBe(false); // verification step
27-
}
28-
});
29-
30-
it('registers related sub-components', () => {
31-
// Assuming these might be registered in future or implicitly available
32-
// If index.tsx exports them, they are available to import.
33-
// If they are not registered in Registry, we don't test registry for them.
14+
expect(config).toBeDefined();
15+
expect(config?.label).toBe('Detail View');
16+
expect(config?.category).toBe('Views');
3417
});
3518
});

packages/plugin-kanban/src/ObjectKanban.msw.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe('ObjectKanban with MSW', () => {
7575
// Initial state might show Skeleton, wait for data
7676
await waitFor(() => {
7777
expect(screen.getByText('Task 1')).toBeInTheDocument();
78-
});
78+
}, { timeout: 10000 });
7979

8080
// Check classification
8181
// Task 1 (todo) and Task 3 (todo) should be in To Do column.

0 commit comments

Comments
 (0)