Skip to content

Commit 587f412

Browse files
Copilothotlong
andcommitted
Fix TS7006 implicit any, TS2347 untyped function calls, and TS7053 errors in console app; fix SystemPages test race condition
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent c25ee92 commit 587f412

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

apps/console/src/__tests__/SystemPages.test.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ describe('UserManagementPage', () => {
8686
await waitFor(() => {
8787
expect(mockFind).toHaveBeenCalledWith('sys_user');
8888
});
89-
expect(screen.getByText('Alice')).toBeInTheDocument();
89+
await waitFor(() => {
90+
expect(screen.getByText('Alice')).toBeInTheDocument();
91+
});
9092
});
9193

9294
it('should show empty state when no users', async () => {
@@ -120,7 +122,9 @@ describe('OrgManagementPage', () => {
120122
await waitFor(() => {
121123
expect(mockFind).toHaveBeenCalledWith('sys_org');
122124
});
123-
expect(screen.getByText('Acme')).toBeInTheDocument();
125+
await waitFor(() => {
126+
expect(screen.getByText('Acme')).toBeInTheDocument();
127+
});
124128
});
125129

126130
it('should show empty state when no organizations', async () => {
@@ -141,7 +145,9 @@ describe('RoleManagementPage', () => {
141145
await waitFor(() => {
142146
expect(mockFind).toHaveBeenCalledWith('sys_role');
143147
});
144-
expect(screen.getByText('Admin')).toBeInTheDocument();
148+
await waitFor(() => {
149+
expect(screen.getByText('Admin')).toBeInTheDocument();
150+
});
145151
});
146152

147153
it('should show empty state when no roles', async () => {
@@ -162,7 +168,9 @@ describe('AuditLogPage', () => {
162168
await waitFor(() => {
163169
expect(mockFind).toHaveBeenCalledWith('sys_audit_log', expect.objectContaining({ $orderby: { createdAt: 'desc' } }));
164170
});
165-
expect(screen.getByText('create')).toBeInTheDocument();
171+
await waitFor(() => {
172+
expect(screen.getByText('create')).toBeInTheDocument();
173+
});
166174
});
167175

168176
it('should show empty state when no logs', async () => {
@@ -250,7 +258,9 @@ describe('PermissionManagementPage', () => {
250258
await waitFor(() => {
251259
expect(mockFind).toHaveBeenCalledWith('sys_permission');
252260
});
253-
expect(screen.getByText('manage_users')).toBeInTheDocument();
261+
await waitFor(() => {
262+
expect(screen.getByText('manage_users')).toBeInTheDocument();
263+
});
254264
});
255265

256266
it('should show empty state when no permissions', async () => {

apps/console/src/__tests__/ViewConfigPanel.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ vi.mock('@object-ui/i18n', () => ({
2323

2424
// Mock components to simple HTML elements
2525
vi.mock('@object-ui/components', () => {
26-
const React = require('react');
26+
const React = require('react') as typeof import('react');
2727

2828
// useConfigDraft mock — mirrors real implementation
2929
function useConfigDraft(source: any, options?: any) {
@@ -89,7 +89,7 @@ vi.mock('@object-ui/components', () => {
8989

9090
// ConfigPanelRenderer mock — renders schema sections with proper collapse/visibility
9191
function ConfigPanelRenderer({ open, onClose, schema, draft, isDirty, onFieldChange, onSave, onDiscard, panelRef, role, ariaLabel, tabIndex, testId, saveLabel, discardLabel, className }: any) {
92-
const [collapsed, setCollapsed] = React.useState({});
92+
const [collapsed, setCollapsed] = React.useState<Record<string, boolean>>({});
9393
if (!open) return null;
9494

9595
return React.createElement('div', {

0 commit comments

Comments
 (0)