Fakultas Ilmu Komputer UI

Commit 91bf23a6 authored by Zamil Majdy's avatar Zamil Majdy
Browse files

[#140652771] [#21] [Refactor] Delete unused import, fix layout, fix indentation

parent 1d37df34
......@@ -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 />
......
......@@ -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();
});
});
......@@ -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
}
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 {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment