diff --git a/assets/js/CreateVacancy.jsx b/assets/js/CreateVacancy.jsx index 3f90995a47a460450780680f6516d6630e1f77ca..8989c3bafdc0e2afe927f4276f864dddbd24cd4a 100644 --- a/assets/js/CreateVacancy.jsx +++ b/assets/js/CreateVacancy.jsx @@ -35,9 +35,8 @@ export default class CreateVacancy extends React.Component { data.open_time = data.open_time.format(); data.close_time = data.close_time.format(); data.company = this.state.company.id; - console.log(data); - Server.post('/vacancies/', this.state).then(() => { + Server.post('/vacancies/', data).then(() => { browserHistory.push('/lowongan'); }, error => error.then((r) => { this.modalAlert.open('Gagal Membuat Lowongan', Dumper.dump(r,' ')); @@ -53,7 +52,7 @@ export default class CreateVacancy extends React.Component { <Icon name="briefcase" circular /> <Header.Content> Lowongan KP - </Header.Content> + </Header.Content> </Header> <Form loading={this.state.formLoading} onSubmit={this.handleSubmit}> <Form.Field label="Posisi" name="name" control={Input} onChange={this.handleChange} required /> diff --git a/assets/js/__test__/components/VacancyList-test.jsx b/assets/js/__test__/components/VacancyList-test.jsx index 4b5bac4cb7557ec3bf5977f32148eb9550efb549..76bb6c278e0c6fae2812405d0ad10c215ec8632b 100644 --- a/assets/js/__test__/components/VacancyList-test.jsx +++ b/assets/js/__test__/components/VacancyList-test.jsx @@ -27,6 +27,7 @@ describe('VacancyList', () => { const vacancyList = ReactTestUtils.renderIntoDocument( <VacancyList userId={1} url="test" />); expect(vacancyList).to.exist; + fetchMock.restore(); }); it('renders without problem for company', () => { @@ -35,6 +36,7 @@ describe('VacancyList', () => { <VacancyList type="company" userId={1} url="test" />); vacancyList.state.vacancies = response; expect(vacancyList.generateVacancies()).to.exist; + fetchMock.restore(); }); it('update bookmarks without problem', () => { @@ -43,6 +45,7 @@ describe('VacancyList', () => { <VacancyList userId={1} url="test" />); vacancyList.updateBookmarkList(); expect(JSON.stringify(vacancyList.state.bookmarkList)).to.be.defined; + fetchMock.restore(); }); it('renders marked bookmarked vacancies without problem', () => { @@ -52,6 +55,7 @@ describe('VacancyList', () => { vacancyList.state.vacancies = response; vacancyList.state.bookmarkList = [{ id: 5 }, { id: 3 }, { id: 1 }]; expect(vacancyList.generateVacancies()).to.exist; + fetchMock.restore(); }); it('renders not marked vacancies without problem', () => { @@ -61,6 +65,7 @@ describe('VacancyList', () => { vacancyList.state.vacancies = response; vacancyList.state.bookmarkList = [{ id: 6 }, { id: 4 }, { id: 2 }]; expect(vacancyList.generateVacancies()).to.exist; + fetchMock.restore(); }); it('success calling API', () => { @@ -69,6 +74,7 @@ describe('VacancyList', () => { <VacancyList userId={1} url="test" />); vacancyList.state.vacancies = response; expect(JSON.stringify(vacancyList.state.vacancies)).to.equal(JSON.stringify(response)); + fetchMock.restore(); }); }); diff --git a/assets/js/components/CancelModal.jsx b/assets/js/components/CancelModal.jsx index 723bc3bcc76cc7e68a39e61196b66d03527adca4..662847cbbf50a9f43d672032fa56e81343a88d8c 100644 --- a/assets/js/components/CancelModal.jsx +++ b/assets/js/components/CancelModal.jsx @@ -52,7 +52,6 @@ export default class CancelModal extends React.Component { header: 'Permintaan gagal', content: this.batalFailed, }); - } open = () => this.setState({ modalOpen: true }); @@ -80,4 +79,4 @@ export default class CancelModal extends React.Component { </Modal.Actions> </Modal> ); -} \ No newline at end of file +} diff --git a/assets/js/components/VacancyList.jsx b/assets/js/components/VacancyList.jsx index 412f4cc90dd5cc23df8850b13b27c03e73a23139..5e4790492eddad0a5f10d78681423144cbcd8456 100644 --- a/assets/js/components/VacancyList.jsx +++ b/assets/js/components/VacancyList.jsx @@ -1,9 +1,10 @@ import React from 'react'; -import { Segment, Item, Button } from 'semantic-ui-react'; +import { Item, Button } from 'semantic-ui-react'; +import { Link } from 'react-router'; import Vacancy from './Vacancy'; import CompanyVacancy from './CompanyVacancy'; import Server from '../lib/Server'; -import {Link} from "react-router"; + export default class VacancyList extends React.Component {