department-of-veterans-affairs/vets-website

View on GitHub
src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/VideoVisitInstructions.unit.spec.js

Summary

Maintainability
B
4 hrs
Test Coverage
import React from 'react';
import { expect } from 'chai';
import { render } from '@testing-library/react';
import { VideoVisitInstructions } from './VideoVisitInstructions';

describe('VAOS Component: VideoVisitInstructions', () => {
  it('renders instructions for medication review', () => {
    const instructionsType = 'Medication Review';
    const props = { instructionsType };
    const wrapper = render(<VideoVisitInstructions {...props} />);
    expect(wrapper.queryByText('Medication review')).to.exist;
  });
  it('renders instructions for Video Visit Preparation', () => {
    const instructionsType = 'Video Visit Preparation';
    const props = { instructionsType };
    const wrapper = render(<VideoVisitInstructions {...props} />);

    expect(wrapper.queryByText('VA Video Connect iOS app')).to.exist;
  });
  it('returns null if no instructionType is set', () => {
    const instructionsType = null;
    const props = { instructionsType };
    const wrapper = render(<VideoVisitInstructions {...props} />);
    expect(wrapper.queryByText('VA Video Connect iOS app')).to.not.exist;
    expect(wrapper.queryByText('Medication review')).to.not.exist;
  });
});