Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
fix(test): view appointments bad time format
Browse files Browse the repository at this point in the history
  • Loading branch information
nobrayner committed Dec 26, 2020
1 parent 1919c8d commit 2208d2d
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/__tests__/scheduling/appointments/ViewAppointments.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { render, waitFor, screen } from '@testing-library/react'
import addMinutes from 'date-fns/addMinutes'
import format from 'date-fns/format'
import React from 'react'
import { Provider } from 'react-redux'
import { MemoryRouter } from 'react-router-dom'
Expand Down Expand Up @@ -81,16 +82,8 @@ describe('ViewAppointments', () => {
expect(screen.getByText(expectedPatient.fullName as string)).toBeInTheDocument()
})

const expectedAppointmentStartDate = new Date(expectedAppointment.startDateTime)
const expectedStart = `${expectedAppointmentStartDate.getHours()}:${expectedAppointmentStartDate
.getMinutes()
.toString()
.padStart(2, '0')}`
const expectedAppointmentEndDate = new Date(expectedAppointment.endDateTime)
const expectedEnd = `${expectedAppointmentEndDate.getHours()}:${expectedAppointmentEndDate
.getMinutes()
.toString()
.padStart(2, '0')}`
const expectedStart = format(new Date(expectedAppointment.startDateTime), 'h:mm')
const expectedEnd = format(new Date(expectedAppointment.endDateTime), 'h:mm')

expect(container.querySelector('.fc-content-col .fc-time')).toHaveAttribute(
'data-full',
Expand Down

0 comments on commit 2208d2d

Please sign in to comment.