Sha256: 134d6f5710e5aadacd6f5324538072733aa497c02ee0c8981070a0aac4f99ac8

Contents?: true

Size: 668 Bytes

Versions: 1

Compression:

Stored size: 668 Bytes

Contents

import React from 'react';
import { render, fireEvent, screen, act } from '@testing-library/react';
import { StartEndDates } from '../StartEndDates';

const setEnds = jest.fn();
const setIsNeverEnds = jest.fn();
const props = {
  starts: '',
  setStarts: jest.fn(),
  ends: 'some-end-date',
  setEnds,
  setIsNeverEnds,
  isNeverEnds: false,
};

describe('StartEndDates', () => {
  it('never ends', async () => {
    await act(async () => render(<StartEndDates {...props} />));
    const neverEnds = screen.getByRole('checkbox', { name: 'Never ends' });
    await act(async () => fireEvent.click(neverEnds));
    expect(setIsNeverEnds).toBeCalledWith(true);
  });
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
foreman_remote_execution-4.8.0 webpack/JobWizard/steps/Schedule/__tests__/StartEndDates.test.js