Skip to content
Snippets Groups Projects
Commit 4b039298 authored by Tamlyn Rhodes's avatar Tamlyn Rhodes
Browse files

Fix react/no-did-mount-set-state lint error

parent 05a654d4
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,6 @@
"no-shadow": 0,
"no-underscore-dangle": 0,
"react/forbid-prop-types": 0,
"react/no-did-mount-set-state": 0,
"react/no-unused-prop-types": 0,
"react/no-unused-state": 0,
"react/prop-types": 0,
......
......@@ -30,7 +30,7 @@ export class UpdateSubscriber extends Component {
this.listeners = {}
}
componentDidMount() {
componentWillMount() {
this.subscribe(this.props)
this.setState({ visible: UpdateSubscriber.visible() })
}
......
......@@ -7,12 +7,9 @@ import { UpdateSubscriber } from '../../src/components/UpdateSubscriber'
global.PUBSWEET_COMPONENTS = []
function makeWrapper(props = {}) {
const wrapper = shallow(
return shallow(
<UpdateSubscriber currentUser={{}} handleUpdate={jest.fn()} {...props} />,
)
// did* lifecycle methods don't get automatically called on shallow render
wrapper.instance().componentDidMount()
return wrapper
}
describe('<UpdateSubscriber/>', () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment