Skip to content
Merged
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/console/src/__tests__/BrowserSimulation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ describe('Console Application Simulation', () => {
// Check all labels exist concurrently using Promise.all for faster execution
await Promise.all(
fieldLabels.map(label =>
waitFor(() => expectLabelToExist(label), { timeout: 12000 })
waitFor(() => expectLabelToExist(label), { timeout: 5000 })
)
);
Comment on lines 234 to 238
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This timeout change is inside it.skip('Scenario 4 ...'), so it won’t affect CI duration (the test is never executed). If the goal is to reduce BrowserSimulation.test.tsx runtime, the timeouts in non-skipped scenarios would need adjustment (or the PR description should be updated to reflect that this change is currently no-op for CI).

Copilot uses AI. Check for mistakes.

Expand Down
7 changes: 4 additions & 3 deletions apps/console/src/__tests__/Onboarding.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ describe('OnboardingWalkthrough', () => {

render(<OnboardingWalkthrough />);

// Wait a bit then verify it's not shown
await new Promise(r => setTimeout(r, 1000));
expect(screen.queryByText('Welcome to ObjectUI')).not.toBeInTheDocument();
// Verify the dialog is not shown (no artificial delay needed)
await waitFor(() => {
expect(screen.queryByText('Welcome to ObjectUI')).not.toBeInTheDocument();
});
Comment on lines +40 to +43
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test no longer validates that the onboarding dialog stays hidden after the component’s delayed setTimeout(..., 800) logic runs. waitFor(() => expect(queryByText(...)).not.toBeInTheDocument()) will typically pass immediately before the effect/timer has a chance to run, so it could miss regressions where the dialog still appears. A faster deterministic approach is to use vi.useFakeTimers() and vi.advanceTimersByTime(1000) (or otherwise wait past 800ms) before asserting the dialog is still absent.

Copilot uses AI. Check for mistakes.
});

it('shows the first step initially', async () => {
Expand Down
28 changes: 14 additions & 14 deletions packages/plugin-kanban/src/__tests__/performance-benchmark.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ describe('KanbanBoard (KanbanImpl): performance benchmarks', () => {
expect(elapsed).toBeLessThan(500);
});

it('renders 500 cards spread across 5 columns under 1,000ms', () => {
const columns = generateColumns(5, 500);
it('renders 200 cards spread across 5 columns under 1,000ms', () => {
const columns = generateColumns(5, 200);

const start = performance.now();
const { container } = render(<KanbanBoard columns={columns} />);
Expand All @@ -208,8 +208,8 @@ describe('KanbanBoard (KanbanImpl): performance benchmarks', () => {
expect(elapsed).toBeLessThan(1_000);
});

it('renders 1,000 cards spread across 5 columns under 2,000ms', () => {
const columns = generateColumns(5, 1_000);
it('renders 500 cards spread across 5 columns under 2,000ms', () => {
const columns = generateColumns(5, 500);

const start = performance.now();
const { container } = render(<KanbanBoard columns={columns} />);
Expand All @@ -219,8 +219,8 @@ describe('KanbanBoard (KanbanImpl): performance benchmarks', () => {
expect(elapsed).toBeLessThan(2_000);
});

it('renders with 20+ columns without degradation', () => {
const columns = generateColumns(25, 250);
it('renders with 10+ columns without degradation', () => {
const columns = generateColumns(12, 120);

const start = performance.now();
const { container } = render(<KanbanBoard columns={columns} />);
Expand All @@ -230,8 +230,8 @@ describe('KanbanBoard (KanbanImpl): performance benchmarks', () => {
expect(elapsed).toBeLessThan(2_000);
});

it('renders empty board with 20+ columns quickly', () => {
const columns = generateColumns(25, 0);
it('renders empty board with 10+ columns quickly', () => {
const columns = generateColumns(12, 0);

const start = performance.now();
const { container } = render(<KanbanBoard columns={columns} />);
Expand Down Expand Up @@ -260,11 +260,11 @@ describe('KanbanBoard (KanbanImpl): scaling characteristics', () => {
await setupMocksAndImport();
});

it('renders all column titles for 20+ column board', () => {
const columns = generateColumns(25, 50);
it('renders all column titles for 10+ column board', () => {
const columns = generateColumns(12, 24);
render(<KanbanBoard columns={columns} />);

for (let i = 0; i < 25; i++) {
for (let i = 0; i < 12; i++) {
expect(document.body.textContent).toContain(`Column ${i}`);
}
});
Expand All @@ -274,7 +274,7 @@ describe('KanbanBoard (KanbanImpl): scaling characteristics', () => {
{
id: 'badges-col',
title: 'With Badges',
cards: Array.from({ length: 500 }, (_, i) => ({
cards: Array.from({ length: 100 }, (_, i) => ({
id: `badge-card-${i}`,
title: `Task ${i}`,
badges: [
Expand All @@ -293,8 +293,8 @@ describe('KanbanBoard (KanbanImpl): scaling characteristics', () => {
expect(elapsed).toBeLessThan(2_000);
});

it('renders 1,000 cards across 10 columns under 2,000ms', () => {
const columns = generateColumns(10, 1_000);
it('renders 500 cards across 10 columns under 2,000ms', () => {
const columns = generateColumns(10, 500);

const start = performance.now();
const { container } = render(<KanbanBoard columns={columns} />);
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/__tests__/LazyPluginLoader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ describe('createLazyPlugin', () => {

await waitFor(() => {
expect(screen.getByText('Success after retry')).toBeInTheDocument();
}, { timeout: 5000 });
}, { timeout: 2000 });

// First call + 2 retries (fails) + 1 success = called 3 times
expect(importFn).toHaveBeenCalledTimes(3);
Expand Down
41 changes: 41 additions & 0 deletions vitest.workspace.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { defineWorkspace } from 'vitest/config';

export default defineWorkspace([
{
extends: './vitest.config.mts',
test: {
name: 'unit',
include: [
'packages/core/src/**/*.test.ts',
'packages/types/src/**/*.test.ts',
'packages/cli/src/**/*.test.ts',
'packages/data-objectstack/src/**/*.test.ts',
],
environment: 'node',
setupFiles: [],
testTimeout: 5000,
},
Comment on lines +8 to +17
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unit project sets environment: 'node' for all packages/core tests, but at least one core test file (packages/core/src/theme/__tests__/ThemeEngine.test.ts) references window.matchMedia directly and relies on a DOM-like environment. With node this will throw (ReferenceError: window is not defined) and break the unit project. Consider either (a) moving DOM-dependent core tests into the ui project via include/exclude, or (b) marking those specific test files with // @vitest-environment happy-dom (or stubbing window without relying on happy-dom) so the unit project remains node-safe.

Copilot uses AI. Check for mistakes.
},
{
extends: './vitest.config.mts',
test: {
name: 'ui',
include: [
'packages/*/src/**/*.test.{ts,tsx}',
'apps/*/src/**/*.test.{ts,tsx}',
'examples/*/src/**/*.test.{ts,tsx}',
],
exclude: [
'packages/core/src/**/*.test.ts',
'packages/types/src/**/*.test.ts',
'packages/cli/src/**/*.test.ts',
'packages/data-objectstack/src/**/*.test.ts',
'**/node_modules/**',
'**/dist/**',
'**/cypress/**',
'**/e2e/**',
'**/.{idea,git,cache,output,temp}/**',
],
},
},
]);
4 changes: 0 additions & 4 deletions vitest.workspace.yaml

This file was deleted.