mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-06-05 20:54:14 +00:00
- vitest projects: node unit tests stay lean; new jsdom 'components' project runs *.test.tsx - component setup: matchMedia/ResizeObserver/localStorage polyfills, react-i18next init, persian-calendar-suite stub (only used under jalali locale) - smoke + field-label structure snapshots for Inbound & Outbound form modals - establishes the regression net required before decomposing the oversized form modals - 341 tests pass (337 unit + 4 component); typecheck/lint/build green
31 lines
781 B
TypeScript
31 lines
781 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
|
|
import InboundFormModal from '@/pages/inbounds/form/InboundFormModal';
|
|
import { renderWithProviders, fieldLabels } from './test-utils';
|
|
|
|
function renderModal() {
|
|
return renderWithProviders(
|
|
<InboundFormModal
|
|
open
|
|
mode="add"
|
|
dbInbound={null}
|
|
dbInbounds={[]}
|
|
availableNodes={[]}
|
|
onClose={() => {}}
|
|
onSaved={() => {}}
|
|
/>,
|
|
);
|
|
}
|
|
|
|
describe('InboundFormModal', () => {
|
|
it('renders add mode without crashing', () => {
|
|
renderModal();
|
|
expect(document.querySelector('.ant-modal')).toBeTruthy();
|
|
expect(fieldLabels().length).toBeGreaterThan(0);
|
|
});
|
|
|
|
it('add-mode field structure is stable', () => {
|
|
renderModal();
|
|
expect(fieldLabels()).toMatchSnapshot();
|
|
});
|
|
});
|