AdditionalSection.test.tsx 868 B

1234567891011121314151617181920212223242526272829
  1. import React from 'react';
  2. import { describe, it, expect, vi } from 'vitest';
  3. import { screen } from '@testing-library/react';
  4. import { render } from '../utils';
  5. import { AdditionalSection } from '../../components/spool-form/AdditionalSection';
  6. import { defaultFormData } from '../../components/spool-form/types';
  7. vi.mock('react-i18next', () => ({
  8. useTranslation: () => ({
  9. t: (key: string) => key,
  10. }),
  11. }));
  12. const baseProps = {
  13. formData: defaultFormData,
  14. updateField: vi.fn(),
  15. spoolCatalog: [],
  16. currencySymbol: '$',
  17. availableCategories: [],
  18. globalLowStockThreshold: 20,
  19. };
  20. describe('AdditionalSection', () => {
  21. it('renders SpoolWeightPicker', () => {
  22. render(<AdditionalSection {...baseProps} />);
  23. // SpoolWeightPicker renders the 'inventory.coreWeight' label
  24. expect(screen.getByText('inventory.coreWeight')).toBeTruthy();
  25. });
  26. });