mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
15 lines
448 B
TypeScript
15 lines
448 B
TypeScript
|
|
import type { ReactElement } from 'react';
|
||
|
|
import { render } from '@testing-library/react';
|
||
|
|
|
||
|
|
import { ThemeProvider } from '@/hooks/useTheme';
|
||
|
|
|
||
|
|
export function renderWithProviders(ui: ReactElement) {
|
||
|
|
return render(<ThemeProvider>{ui}</ThemeProvider>);
|
||
|
|
}
|
||
|
|
|
||
|
|
export function fieldLabels(): string[] {
|
||
|
|
return Array.from(document.querySelectorAll('.ant-form-item-label label'))
|
||
|
|
.map((el) => (el.textContent ?? '').trim())
|
||
|
|
.filter(Boolean);
|
||
|
|
}
|