|
|
@@ -417,4 +417,16 @@ console.error = (...args: any[]) => {
|
|
|
return
|
|
|
}
|
|
|
originalConsoleError(...args)
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+// Mock 常用 UI 组件
|
|
|
+jest.mock('@/components/ui/dialog', () => {
|
|
|
+ const React = require('react')
|
|
|
+ return {
|
|
|
+ Dialog: ({ open, children }: any) => open ? React.createElement('div', { 'data-testid': 'dialog' }, children) : null,
|
|
|
+ DialogContent: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
|
+ DialogHeader: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
|
+ DialogTitle: ({ children, className }: any) => React.createElement('div', { className }, children),
|
|
|
+ DialogFooter: ({ children, className }: any) => React.createElement('div', { className }, children)
|
|
|
+ }
|
|
|
+})
|