diff --git a/mpwo_client/e2e/activities.test.js b/mpwo_client/e2e/activities.test.js index 09ec0a57..c30a6d09 100644 --- a/mpwo_client/e2e/activities.test.js +++ b/mpwo_client/e2e/activities.test.js @@ -24,7 +24,7 @@ test('standard user should be able to add a workout (w/o gpx)', async t => { await t .navigateTo(`${TEST_URL}/activities/add`) .expect(Selector('H1').withText('Dashboard').exists).notOk() - .expect(Selector('H2').withText('Add a sport').exists).ok() + .expect(Selector('H2').withText('Add an activity').exists).ok() .click(Selector('input[name="withoutGpx"]')) .click(Selector('select').filter('[name="sport_id"]')) .click(Selector('option').filter('[value="1"]')) diff --git a/mpwo_client/src/components/Activities/ActivityAdd.jsx b/mpwo_client/src/components/Activities/ActivityAdd.jsx index 9608631d..857a0893 100644 --- a/mpwo_client/src/components/Activities/ActivityAdd.jsx +++ b/mpwo_client/src/components/Activities/ActivityAdd.jsx @@ -1,91 +1,24 @@ import React from 'react' -import { Helmet } from 'react-helmet' import { connect } from 'react-redux' -import FormWithGpx from './ActivityForms/FormWithGpx' -import FormWithoutGpx from './ActivityForms/FormWithoutGpx' +import ActivityAddOrEdit from './ActivityAddOrEdit' import { getData } from '../../actions/index' -class AddActivity extends React.Component { - constructor(props, context) { - super(props, context) - this.state = { - withGpx: true, - } - } - +class ActivityAdd extends React.Component { componentDidMount() { this.props.loadSports() } - handleRadioChange (changeEvent) { - this.setState({ - withGpx: - changeEvent.target.name === 'withGpx' - ? changeEvent.target.value : !changeEvent.target.value - }) - } - render() { const { message, sports } = this.props - const { withGpx } = this.state return (
{message}
- )}
-
- {message}
+ )}
{message}
- )}
{sports.length > 0 && (