Remove unnecessary formProps from final form tests

This commit is contained in:
Vesa Luusua 2018-04-16 20:27:10 +03:00
parent 9cd15f1908
commit 00ee2ed402
10 changed files with 6 additions and 124 deletions

View file

@ -3,7 +3,7 @@ import { shallow } from 'enzyme';
import Decimal from 'decimal.js';
import { types as sdkTypes } from '../../util/sdkLoader';
import { renderShallow, renderDeep } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import { LINE_ITEM_NIGHT, TRANSITION_REQUEST } from '../../util/types';
import { dateFromAPIToLocalNoon } from '../../util/dates';
import { BookingBreakdown } from '../../components';
@ -18,7 +18,6 @@ describe('BookingDatesForm', () => {
it('matches snapshot without selected dates', () => {
const tree = renderShallow(
<BookingDatesFormComponent
{...fakeFormProps}
unitType={LINE_ITEM_NIGHT}
intl={fakeIntl}
dispatch={noop}

View file

@ -2,25 +2,9 @@
exports[`BookingDatesForm matches snapshot without selected dates 1`] = `
<ReactFinalForm(4.3.1)(3.1.5)
anyTouched={false}
asyncValidate={[Function]}
asyncValidating={false}
autofill={[Function]}
blur={[Function]}
bookingDates={Object {}}
change={[Function]}
clearAsyncError={[Function]}
clearFields={[Function]}
clearSubmit={[Function]}
clearSubmitErrors={[Function]}
destroy={[Function]}
dirty={false}
dispatch={[Function]}
endDatePlaceholder="tomorrow"
form="fakeTestForm"
handleSubmit={[Function]}
initialize={[Function]}
initialized={true}
intl={
Object {
"formatDate": [Function],
@ -33,21 +17,11 @@ exports[`BookingDatesForm matches snapshot without selected dates 1`] = `
"now": [Function],
}
}
invalid={false}
isOwnListing={false}
onSubmit={[Function]}
pristine={true}
pure={true}
render={[Function]}
reset={[Function]}
resetSection={[Function]}
startDatePlaceholder="today"
submit={[Function]}
submitButtonWrapperClassName={null}
submitFailed={false}
submitSucceeded={false}
submitting={false}
touch={[Function]}
unitPrice={
Money {
"amount": 1099,
@ -55,7 +29,5 @@ exports[`BookingDatesForm matches snapshot without selected dates 1`] = `
}
}
unitType="line-item/night"
untouch={[Function]}
valid={true}
/>
`;

View file

@ -1,6 +1,6 @@
import React from 'react';
import { renderDeep } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import EditListingDescriptionForm from './EditListingDescriptionForm';
const noop = () => null;
@ -9,7 +9,6 @@ describe('EditListingDescriptionForm', () => {
it('matches snapshot', () => {
const tree = renderDeep(
<EditListingDescriptionForm
{...fakeFormProps}
intl={fakeIntl}
dispatch={noop}
onSubmit={v => v}

View file

@ -1,7 +1,7 @@
// NOTE: renderdeep doesn't work due to Google Maps API integration
import React from 'react';
import { renderShallow } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import { EditListingLocationFormComponent } from './EditListingLocationForm';
const noop = () => null;
@ -10,7 +10,6 @@ describe('EditListingLocationForm', () => {
it('matches snapshot', () => {
const tree = renderShallow(
<EditListingLocationFormComponent
{...fakeFormProps}
intl={fakeIntl}
dispatch={noop}
onSubmit={noop}

View file

@ -2,23 +2,7 @@
exports[`EditListingLocationForm matches snapshot 1`] = `
<ReactFinalForm(4.3.1)(3.1.5)
anyTouched={false}
asyncValidate={[Function]}
asyncValidating={false}
autofill={[Function]}
blur={[Function]}
change={[Function]}
clearAsyncError={[Function]}
clearFields={[Function]}
clearSubmit={[Function]}
clearSubmitErrors={[Function]}
destroy={[Function]}
dirty={false}
dispatch={[Function]}
form="fakeTestForm"
handleSubmit={[Function]}
initialize={[Function]}
initialized={true}
intl={
Object {
"formatDate": [Function],
@ -31,24 +15,12 @@ exports[`EditListingLocationForm matches snapshot 1`] = `
"now": [Function],
}
}
invalid={false}
onSubmit={[Function]}
pristine={true}
pure={true}
render={[Function]}
reset={[Function]}
resetSection={[Function]}
saveActionMsg="Save location"
selectedPlace={null}
submit={[Function]}
submitFailed={false}
submitSucceeded={false}
submitting={false}
touch={[Function]}
untouch={[Function]}
updateError={null}
updateInProgress={false}
updated={false}
valid={true}
/>
`;

View file

@ -1,6 +1,6 @@
import React from 'react';
import { renderShallow } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import { EditListingPhotosFormComponent } from './EditListingPhotosForm';
const noop = () => null;
@ -9,7 +9,6 @@ describe('EditListingPhotosForm', () => {
it('matches snapshot', () => {
const tree = renderShallow(
<EditListingPhotosFormComponent
{...fakeFormProps}
initialValues={{ country: 'US', images: [] }}
intl={fakeIntl}
dispatch={noop}

View file

@ -2,30 +2,14 @@
exports[`EditListingPhotosForm matches snapshot 1`] = `
<ReactFinalForm(4.3.1)(3.1.5)
anyTouched={false}
asyncValidate={[Function]}
asyncValidating={false}
autofill={[Function]}
blur={[Function]}
change={[Function]}
clearAsyncError={[Function]}
clearFields={[Function]}
clearSubmit={[Function]}
clearSubmitErrors={[Function]}
destroy={[Function]}
dirty={false}
dispatch={[Function]}
errors={Object {}}
form="fakeTestForm"
handleSubmit={[Function]}
imageUploadRequested={false}
initialValues={
Object {
"images": undefined,
}
}
initialize={[Function]}
initialized={true}
intl={
Object {
"formatDate": [Function],
@ -38,29 +22,17 @@ exports[`EditListingPhotosForm matches snapshot 1`] = `
"now": [Function],
}
}
invalid={false}
onImageUpload={[Function]}
onImageUploadHandler={[Function]}
onRemoveImage={[Function]}
onSubmit={[Function]}
onUpdateImageOrder={[Function]}
pristine={true}
pure={true}
ready={false}
render={[Function]}
reset={[Function]}
resetSection={[Function]}
saveActionMsg="Save photos"
stripeConnected={false}
submit={[Function]}
submitFailed={false}
submitSucceeded={false}
submitting={false}
touch={[Function]}
untouch={[Function]}
updateError={null}
updateInProgress={false}
updated={false}
valid={true}
/>
`;

View file

@ -1,7 +1,7 @@
// NOTE: renderdeep doesn't work due to Google Maps API integration
import React from 'react';
import { renderShallow } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import { EditListingPoliciesFormComponent } from './EditListingPoliciesForm';
const noop = () => null;
@ -10,7 +10,6 @@ describe('EditListingPoliciesForm', () => {
it('matches snapshot', () => {
const tree = renderShallow(
<EditListingPoliciesFormComponent
{...fakeFormProps}
publicData={{}}
intl={fakeIntl}
dispatch={noop}

View file

@ -2,23 +2,7 @@
exports[`EditListingPoliciesForm matches snapshot 1`] = `
<ReactFinalForm(4.3.1)(3.1.5)
anyTouched={false}
asyncValidate={[Function]}
asyncValidating={false}
autofill={[Function]}
blur={[Function]}
change={[Function]}
clearAsyncError={[Function]}
clearFields={[Function]}
clearSubmit={[Function]}
clearSubmitErrors={[Function]}
destroy={[Function]}
dirty={false}
dispatch={[Function]}
form="fakeTestForm"
handleSubmit={[Function]}
initialize={[Function]}
initialized={true}
intl={
Object {
"formatDate": [Function],
@ -31,25 +15,13 @@ exports[`EditListingPoliciesForm matches snapshot 1`] = `
"now": [Function],
}
}
invalid={false}
onSubmit={[Function]}
pristine={true}
publicData={Object {}}
pure={true}
render={[Function]}
reset={[Function]}
resetSection={[Function]}
saveActionMsg="Save rules"
selectedPlace={null}
submit={[Function]}
submitFailed={false}
submitSucceeded={false}
submitting={false}
touch={[Function]}
untouch={[Function]}
updateError={null}
updateInProgress={false}
updated={false}
valid={true}
/>
`;

View file

@ -1,6 +1,6 @@
import React from 'react';
import { renderDeep } from '../../util/test-helpers';
import { fakeIntl, fakeFormProps } from '../../util/test-data';
import { fakeIntl } from '../../util/test-data';
import EditListingPricingForm from './EditListingPricingForm';
const noop = () => null;
@ -9,7 +9,6 @@ describe('EditListingPricingForm', () => {
it('matches snapshot', () => {
const tree = renderDeep(
<EditListingPricingForm
{...fakeFormProps}
intl={fakeIntl}
dispatch={noop}
onSubmit={v => v}