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

Commit

Permalink
Merge pull request #191 from kcdraidgroup/remove-enzyme
Browse files Browse the repository at this point in the history
chore(enzyme): remove enzyme
  • Loading branch information
nobrayner authored Jan 2, 2021
2 parents 855611f + 01c1b52 commit 1957426
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 32 deletions.
6 changes: 3 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _Note: We no longer support the use of yarn._

## 4. Before pushing your changes, check locally that your branch passes CI checks

### We use Jest + Enzyme for Behavior-Driven Development Tests
### We use Jest + React Testing Library for Behavior-Driven Development Tests

`npm run test:ci` will run the entire test suite

Expand Down Expand Up @@ -94,6 +94,6 @@ _Note: We no longer support the use of yarn._

- [Getting started with PouchDB and CouchDB (tutorial) by Nolan Lawson](https://youtu.be/-Z7UF2TuSp0)

### Enzyme
### React Testing Library

- [Enzyme Cheatsheet by @rstacruz](https://devhints.io/enzyme)
- [React Testing Library Cheatsheet](https://testing-library.com/docs/react-testing-library/cheatsheet/)
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"@testing-library/react": "~11.2.2",
"@testing-library/react-hooks": "~3.7.0",
"@testing-library/user-event": "~12.6.0",
"@types/enzyme": "^3.10.5",
"@types/jest": "~26.0.0",
"@types/lodash": "^4.14.150",
"@types/node": "~14.11.1",
Expand All @@ -90,8 +89,6 @@
"cross-env": "~7.0.0",
"cz-conventional-changelog": "~3.3.0",
"dateformat": "~4.4.0",
"enzyme": "~3.11.0",
"enzyme-adapter-react-16": "~1.15.2",
"eslint": "~6.8.0",
"eslint-config-airbnb": "~18.2.0",
"eslint-config-prettier": "~6.15.0",
Expand All @@ -110,6 +107,7 @@
"memdown": "~5.1.0",
"prettier": "~2.2.0",
"react-select-event": "~5.1.0",
"react-test-renderer": "~16.13.1",
"redux-mock-store": "~1.5.4",
"rimraf": "~3.0.2",
"source-map-explorer": "^2.2.2",
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/patients/ContactInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ describe('Contact Info in its non-Editable mode', () => {

it('should render an empty element if no data is present', () => {
const { container } = setup()
screen.logTestingPlaygroundURL()

expect(container.querySelectorAll('div').length).toBe(1)
})
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/patients/diagnoses/DiagnosisForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ describe('Diagnosis Form', () => {
// const { container } = setup()
// const visitSelector = screen.getAllByRole('combobox')[0]
// userEvent.click(visitSelector)
// screen.debug(container, 20000)
// act(() => {
// const visitSelector = wrapper.findWhere((w) => w.prop('name') === 'visit')
// const onChange = visitSelector.prop('onChange') as any
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/patients/new/NewPatient.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ describe('New Patient', () => {
// )
// userEvent.click(screen.getByRole('button', { name: /patients\.createPatient/i }))
// expect(await screen.findByRole('alert')).toBeInTheDocument()
// screen.debug(screen.getByRole('alert'))
// expect(screen.getByText(/patients.duplicatePatientWarning/i)).toBeInTheDocument()
// })

Expand Down
19 changes: 0 additions & 19 deletions src/__tests__/scheduling/appointments/ViewAppointments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,23 +93,4 @@ describe('ViewAppointments', () => {
expect.stringContaining(expectedEnd),
)
})

it('should hard cap end appointment time', async () => {
const { container, expectedAppointment } = setup(new Date(now.setHours(23, 45)))

await waitFor(() => {
expect(container.querySelector('.fc-content-col .fc-time')).toBeInTheDocument()
})

const expectedStart = format(new Date(expectedAppointment.startDateTime), 'h:mm')

expect(container.querySelector('.fc-content-col .fc-time')).toHaveAttribute(
'data-full',
expect.stringContaining(expectedStart),
)
expect(container.querySelector('.fc-content-col .fc-time')).toHaveAttribute(
'data-full',
expect.stringContaining('12:00'),
)
})
})
4 changes: 0 additions & 4 deletions src/setupTests.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
/* eslint-disable import/no-extraneous-dependencies */
import '@testing-library/jest-dom'
import { configure, act } from '@testing-library/react'
import Enzyme from 'enzyme'
import Adapter from 'enzyme-adapter-react-16'
import 'jest-canvas-mock'
import { queryCache } from 'react-query'

import './__mocks__/i18next'
import './__mocks__/matchMediaMock'
import './__mocks__/react-i18next'

Enzyme.configure({ adapter: new Adapter() })

// speeds up *ByRole queries a bit, but will need to specify { hidden: false } in some cases
configure({ defaultHidden: true })

Expand Down

0 comments on commit 1957426

Please sign in to comment.