diff --git a/test/integration/basic/pages/nav/url-prop-change.js b/test/integration/basic/pages/nav/url-prop-change.js index 9d4cc67c..35abc8b6 100644 --- a/test/integration/basic/pages/nav/url-prop-change.js +++ b/test/integration/basic/pages/nav/url-prop-change.js @@ -11,13 +11,15 @@ export default class UrlPropChange extends React.Component { } // eslint-disable-next-line camelcase - UNSAFE_componentWillReceiveProps (nextProps) { - this.setState(() => { - return { - previousUrl: this.props.url, - url: nextProps.url - } - }) + componentDidUpdate (prevProps) { + if (prevProps.url !== this.props.url) { + this.setState(() => { + return { + previousUrl: prevProps.url, + url: this.props.url + } + }) + } } render () { diff --git a/test/integration/basic/pages/stateful.js b/test/integration/basic/pages/stateful.js deleted file mode 100644 index 76d2543b..00000000 --- a/test/integration/basic/pages/stateful.js +++ /dev/null @@ -1,23 +0,0 @@ - -import React, { Component } from 'react' - -export default class Statefull extends Component { - constructor (props) { - super(props) - - this.state = { answer: null } - } - - // eslint-disable-next-line camelcase - UNSAFE_componentWillMount () { - this.setState({ answer: 42 }) - } - - render () { - return ( -
-

The answer is {this.state.answer}

-
- ) - } -} diff --git a/test/integration/basic/test/index.test.js b/test/integration/basic/test/index.test.js index 4a5cbbba..8eeb7f67 100644 --- a/test/integration/basic/test/index.test.js +++ b/test/integration/basic/test/index.test.js @@ -35,7 +35,6 @@ describe('Basic Features', () => { renderViaHTTP(context.appPort, '/head'), renderViaHTTP(context.appPort, '/json'), renderViaHTTP(context.appPort, '/link'), - renderViaHTTP(context.appPort, '/stateful'), renderViaHTTP(context.appPort, '/stateless'), renderViaHTTP(context.appPort, '/fragment-syntax'), renderViaHTTP(context.appPort, '/custom-extension'), diff --git a/test/integration/basic/test/rendering.js b/test/integration/basic/test/rendering.js index b82ef61a..f4426b35 100644 --- a/test/integration/basic/test/rendering.js +++ b/test/integration/basic/test/rendering.js @@ -20,12 +20,6 @@ export default function ({ app }, suiteName, render, fetch) { expect(html.includes('My component!')).toBeTruthy() }) - test('renders a stateful component', async () => { - const $ = await get$('/stateful') - const answer = $('#answer') - expect(answer.text()).toBe('The answer is 42') - }) - // default-head contains an empty . test('header renders default charset', async () => { const html = await (render('/default-head'))