From 880eb4caff92d2a91d1f4fdeafa192511ad2340d Mon Sep 17 00:00:00 2001 From: Arunoda Susiripala Date: Thu, 11 May 2017 08:52:28 -0700 Subject: [PATCH] Add a test case for client side routing for next export. --- test/integration/static/pages/counter.js | 16 ++++++---------- test/integration/static/test/browser.js | 24 ++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/test/integration/static/pages/counter.js b/test/integration/static/pages/counter.js index c60c62d9..bec17a3f 100644 --- a/test/integration/static/pages/counter.js +++ b/test/integration/static/pages/counter.js @@ -1,27 +1,23 @@ import React from 'react' import Link from 'next/link' -export default class Counter extends React.Component { - constructor (...args) { - super(...args) - this.state = { count: 0 } - } +let counter = 0 +export default class Counter extends React.Component { increaseCounter () { - const { count } = this.state - this.setState({ count: count + 1 }) + counter++ + this.forceUpdate() } render () { - const { count } = this.state return (
- Go Back + Go Back
-

Counter: {count}

+

Counter: {counter}