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 (
|
||||
<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
|
||||
Icon={FaUser}
|
||||
label='Username'
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
import * as Feature from './'
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import T from 'react-dom/test-utils'
|
||||
import {HTTPClientMock, TestUtils, getError} from '../test-utils'
|
||||
import {IAPIDef} from '@rondo/common'
|
||||
import {MemoryRouter} from 'react-router-dom'
|
||||
|
||||
const test = new TestUtils()
|
||||
|
||||
@ -18,6 +20,9 @@ describe('RegisterForm', () => {
|
||||
.withComponent(
|
||||
select => new Feature.RegisterConnector(loginActions).connect(select),
|
||||
)
|
||||
.withJSX((Component, props) =>
|
||||
<MemoryRouter><Component {...props} /></MemoryRouter>,
|
||||
)
|
||||
|
||||
beforeAll(() => {
|
||||
(window as any).__MOCK_SERVER_SIDE__ = true
|
||||
|
||||
@ -25,7 +25,7 @@ export class RegisterForm extends React.PureComponent<IRegisterFormProps> {
|
||||
className='register-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
|
||||
Icon={FaEnvelope}
|
||||
label='Email'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user