Skip to content

Commit 3bf181c

Browse files
committed
Fix tests?
1 parent 598e822 commit 3bf181c

File tree

3 files changed

+113
-156
lines changed

3 files changed

+113
-156
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
"repl": "node --require ./scripts/repl.js"
155155
},
156156
"resolutions": {
157+
"cheerio": "1.0.0-rc.3",
157158
"merge": "^2.1.1"
158159
},
159160
"packageManager": "[email protected]"

static/js/tests_init.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Define globals we would usually get from Django
22
import React from "react"
33
import ReactDOM from "react-dom"
4-
import { configure } from "enzyme"
4+
import Enzyme from "enzyme"
55
import Adapter from "enzyme-adapter-react-16"
66
import * as ReactTransitionGroup from "react-transition-group"
77

8-
configure({ adapter: new Adapter() })
8+
Enzyme.configure({ adapter: new Adapter() })
99

1010
const _createSettings = () => ({
1111
user: {
@@ -44,16 +44,6 @@ if (!Object.entries) {
4444
}
4545

4646
import fetchMock from "fetch-mock"
47-
// Mock react-transition-group which is used by material-ui. It causes test failures due to a callback timed to
48-
// occur after the test has already cleaned up the DOM elements.
49-
const FakeTransition = ({ children }) => children()
50-
const FakeCSSTransition = props =>
51-
props.in ? <FakeTransition>{props.children}</FakeTransition> : null
52-
// adapted from https://testing-library.com/docs/example-react-transition-group
53-
// eslint-disable-next-line no-import-assign
54-
ReactTransitionGroup.Transition = FakeTransition
55-
// eslint-disable-next-line no-import-assign
56-
ReactTransitionGroup.CSSTransition = FakeCSSTransition
5747

5848
// eslint-disable-next-line mocha/no-top-level-hooks
5949
beforeEach(() => {

0 commit comments

Comments
 (0)