Fix failing React tests for Login/Register
This commit is contained in:
parent
70c94c7c63
commit
c44d605890
@ -23,7 +23,7 @@ export class LoginForm extends React.PureComponent<ILoginFormProps> {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<form className='login-form' onSubmit={this.props.onSubmit}>
|
<form className='login-form' onSubmit={this.props.onSubmit}>
|
||||||
<p className='has-text-danger'>{this.props.error}</p>
|
<p className='error has-text-danger'>{this.props.error}</p>
|
||||||
<Input
|
<Input
|
||||||
Icon={FaUser}
|
Icon={FaUser}
|
||||||
label='Username'
|
label='Username'
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import * as Feature from './'
|
import * as Feature from './'
|
||||||
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom'
|
||||||
import T from 'react-dom/test-utils'
|
import T from 'react-dom/test-utils'
|
||||||
import {HTTPClientMock, TestUtils, getError} from '../test-utils'
|
import {HTTPClientMock, TestUtils, getError} from '../test-utils'
|
||||||
import {IAPIDef} from '@rondo/common'
|
import {IAPIDef} from '@rondo/common'
|
||||||
|
import {MemoryRouter} from 'react-router-dom'
|
||||||
|
|
||||||
const test = new TestUtils()
|
const test = new TestUtils()
|
||||||
|
|
||||||
@ -18,6 +20,9 @@ describe('RegisterForm', () => {
|
|||||||
.withComponent(
|
.withComponent(
|
||||||
select => new Feature.RegisterConnector(loginActions).connect(select),
|
select => new Feature.RegisterConnector(loginActions).connect(select),
|
||||||
)
|
)
|
||||||
|
.withJSX((Component, props) =>
|
||||||
|
<MemoryRouter><Component {...props} /></MemoryRouter>,
|
||||||
|
)
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
(window as any).__MOCK_SERVER_SIDE__ = true
|
(window as any).__MOCK_SERVER_SIDE__ = true
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export class RegisterForm extends React.PureComponent<IRegisterFormProps> {
|
|||||||
className='register-form'
|
className='register-form'
|
||||||
onSubmit={this.props.onSubmit}
|
onSubmit={this.props.onSubmit}
|
||||||
>
|
>
|
||||||
<p className='has-text-danger'>{this.props.error}</p>
|
<p className='error has-text-danger'>{this.props.error}</p>
|
||||||
<Input
|
<Input
|
||||||
Icon={FaEnvelope}
|
Icon={FaEnvelope}
|
||||||
label='Email'
|
label='Email'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user