Fakultas Ilmu Komputer UI

Commit 0d373389 authored by Reza Qorib's avatar Reza Qorib
Browse files

Merge branch 'Features/CompanyBrowseByVacancy' into 'develop'

Features/company browse by vacancy

See merge request !22
parents 3ecfd274 d3695a34
...@@ -36,7 +36,8 @@ padding-right:15%; ...@@ -36,7 +36,8 @@ padding-right:15%;
background: #fff; background: #fff;
border: 1px solid #e5e5e5; border: 1px solid #e5e5e5;
border-radius: 3px; border-radius: 3px;
margin: 80px 100px 30px; margin: 3% 7% 30px;
margin-top: 1%;
} }
.tabs__labels { .tabs__labels {
margin: 0; margin: 0;
...@@ -244,6 +245,10 @@ card .formRegis{ ...@@ -244,6 +245,10 @@ card .formRegis{
margin-right: 10%; margin-right: 10%;
} }
.ui.segment.paginationCompany{
margin-left: 10%;
margin-right: 10%;
.ui.segment.biodata-section{ .ui.segment.biodata-section{
background-color: white; background-color: white;
} }
...@@ -285,3 +290,14 @@ border-color: transparent; ...@@ -285,3 +290,14 @@ border-color: transparent;
color: white; color: white;
} }
.dropdown-applicant{
margin-left:7%;
margin-top:2%;
margin-bottom: 0;
}
.button-administrasi{
margin-left:7%;
margin-top:2%;
margin-bottom: 0;
}
import React from 'react'; import React from 'react';
import { Dropdown } from 'semantic-ui-react';
import Tabs from './components/Tabs'; import Tabs from './components/Tabs';
import ApplicantList from './components/ApplicantList'; import ApplicantList from './components/ApplicantList';
import Applicant from './components/Applicant'; import Applicant from './components/Applicant';
import Pagination from './components/Pagination'; import Pagination from './components/Pagination';
import Server from './lib/Server';
export default class ApplicantPage extends React.Component { export default class ApplicantPage extends React.Component {
...@@ -18,32 +20,71 @@ export default class ApplicantPage extends React.Component { ...@@ -18,32 +20,71 @@ export default class ApplicantPage extends React.Component {
password: '', password: '',
errorFlag: false, errorFlag: false,
company: { id: 1 }, company: { id: 1 },
urls: [],
selected: `/companies/${this.props.user.data.company.id}/applications/`,
refresh: 0,
}; };
this.getVacancyList = this.getVacancyList.bind(this);
this.handleChange = this.handleChange.bind(this);
this.getVacancyList();
} }
getVacancyList= () => Server.get(`/companies/${this.props.user.data.company.id}/vacancies/`, false).then((data) => {
const results = data.results;
const names = ['Semua Lowongan'];
const urls = [{
key: 0,
value: `/companies/${this.props.user.data.company.id}/applications/`,
text: 'Semua Lowongan',
}];
results.map((vacancy) => {
names.push(vacancy.name);
const url = `/companies/${this.props.user.data.company.id}/applications/${vacancy.id}/by_vacancy/`;
const info = {
key: vacancy.id,
value: url,
text: vacancy.name,
};
urls.push(info);
return urls;
});
this.setState({ urls });
}, error => error.then((r) => {
this.modalAlert.open('Gagal mendapatkan daftar lowongan', r.detail);
}));
handleChange = (e, data) => {
this.setState({ selected: data.value, refresh: this.state.refresh + 5 });
};
render() { render() {
const company = this.props.user.data.company; const company = this.props.user.data.company;
return ( return (
<div>
<div className="dropdown-applicant">
<Dropdown placeholder="Semua Lowongan" search selection options={this.state.urls} onChange={this.handleChange} />
</div>
<Tabs selected={0}> <Tabs selected={0}>
<Pagination <Pagination
key={1} key={1 + this.state.refresh}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.NEW}`} url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.NEW}`}
label="Lamaran Baru" label="Lamaran Baru"
child={ child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.NEW} /> <ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.NEW} />
} }
/> />
<Pagination <Pagination
key={2} key={2 + this.state.refresh}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.READ}`} url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.READ}`}
label="Lamaran Dibaca" label="Lamaran Dibaca"
child={ child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.READ} /> <ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.READ} />
} }
/> />
<Pagination <Pagination
key={3} key={3 + this.state.refresh}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.BOOKMARKED}`} url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.BOOKMARKED}`}
label="Lamaran Ditandai" label="Lamaran Ditandai"
child={ child={
<ApplicantList <ApplicantList
...@@ -53,22 +94,29 @@ export default class ApplicantPage extends React.Component { ...@@ -53,22 +94,29 @@ export default class ApplicantPage extends React.Component {
} }
/> />
<Pagination <Pagination
key={4} key={4 + this.state.refresh}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.ACCEPTED}`} url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.ACCEPTED}`}
label="Lamaran Diterima" label="Lamaran Diterima"
child={ child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.ACCEPTED} /> <ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.ACCEPTED}
/>
} }
/> />
<Pagination <Pagination
key={5} key={5 + this.state.refresh}
url={`/companies/${company.id}/applications/?status=${Applicant.APPLICATION_STATUS.REJECTED}`} url={`${this.state.selected}?status=${Applicant.APPLICATION_STATUS.REJECTED}`}
label="Lamaran Ditolak" label="Lamaran Ditolak"
child={ child={
<ApplicantList companyId={company.id} status={Applicant.APPLICATION_STATUS.REJECTED} /> <ApplicantList
companyId={company.id}
status={Applicant.APPLICATION_STATUS.REJECTED}
/>
} }
/> />
</Tabs> </Tabs>
</div>
); );
} }
} }
...@@ -17,7 +17,7 @@ export default class CompanyPage extends React.Component { ...@@ -17,7 +17,7 @@ export default class CompanyPage extends React.Component {
render() { render() {
return ( return (
<div> <div>
<div style={{ paddingLeft: '10px' }}> <div className="button-administrasi">
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" /> <Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" />
</div> </div>
......
...@@ -19,7 +19,6 @@ export default class CreateVacancy extends React.Component { ...@@ -19,7 +19,6 @@ export default class CreateVacancy extends React.Component {
/* istanbul ignore next */ /* istanbul ignore next */
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.handleEditorChange = this.handleEditorChange.bind(this);
this.handleEditor = this.handleEditor.bind(this); this.handleEditor = this.handleEditor.bind(this);
this.setCloseTime = this.setCloseTime.bind(this); this.setCloseTime = this.setCloseTime.bind(this);
this.setOpenTime = this.setOpenTime.bind(this); this.setOpenTime = this.setOpenTime.bind(this);
...@@ -62,17 +61,10 @@ export default class CreateVacancy extends React.Component { ...@@ -62,17 +61,10 @@ export default class CreateVacancy extends React.Component {
handleEditor(value) { handleEditor(value) {
this.setState({ description: value }); this.setState({ description: value });
console.log('dor');
} }
handleEditorChange = (e) => {
this.setState({ description: e.target.getContent() });
console.log('Content was updated:', this.state.description);
};
handleSubmit = (e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
console.log(this.state);
this.setState({ formLoading: true }); this.setState({ formLoading: true });
const data = {}; const data = {};
...@@ -95,21 +87,6 @@ export default class CreateVacancy extends React.Component { ...@@ -95,21 +87,6 @@ export default class CreateVacancy extends React.Component {
})); }));
}; };
modules = {
toolbar: [
[{ header: [1, 2, false] }],
['bold', 'italic', 'underline', 'strike', 'blockquote'],
[{ list: 'ordered' }, { list: 'bullet' }, { indent: '-1' }, { indent: '+1' }],
['link', 'image'],
['clean'],
],
};
formats = ['header', 'bold', 'italic', 'underline', 'strike', 'blockquote',
'list', 'bullet', 'indent',
'link', 'image',
];
render = () => ( render = () => (
<div className="create-lowongan" > <div className="create-lowongan" >
<ModalAlert ref={(modal) => { this.modalAlert = modal; }} /> <ModalAlert ref={(modal) => { this.modalAlert = modal; }} />
...@@ -122,22 +99,8 @@ export default class CreateVacancy extends React.Component { ...@@ -122,22 +99,8 @@ export default class CreateVacancy extends React.Component {
</Header> </Header>
<Form loading={this.state.formLoading} onSubmit={this.handleSubmit}> <Form loading={this.state.formLoading} onSubmit={this.handleSubmit}>
<Form.Field label="Posisi" name="name" control={Input} onChange={this.handleChange} value={this.state.name} required /> <Form.Field label="Posisi" name="name" control={Input} onChange={this.handleChange} value={this.state.name} required />
{ !this.state.loading && <CKEditor value={this.state.description} onChange={this.handleEditor} /> } { !this.state.loading &&
{/*<TinyMCE*/} <CKEditor value={this.state.description} onChange={this.handleEditor} /> }
{/*content={this.state.description}*/}
{/*config={{*/}
{/*plugins: 'link image code',*/}
{/*toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | code image',*/}
{/*}}*/}
{/*onChange={this.handleEditorChange}*/}
{/*/>*/}
{/*<Form.TextArea*/}
{/*name="description"*/}
{/*label="Deskripsi"*/}
{/*placeholder="Deskripsi Lowongan..."*/}
{/*onChange={this.handleChange}*/}
{/*value={this.state.description} required*/}
{/*/>*/}
<script>CKEDITOR.replace( 'description' );</script> <script>CKEDITOR.replace( 'description' );</script>
<Form.Group widths="equal"> <Form.Group widths="equal">
<Form.Field <Form.Field
......
...@@ -28,7 +28,7 @@ export default class Login extends React.Component { ...@@ -28,7 +28,7 @@ export default class Login extends React.Component {
</Header> </Header>
</div> </div>
<Grid stackable={true} columns={2} padded style={{ display: 'flex', justifyContent: 'center' }}> <Grid stackable columns={2} padded style={{ display: 'flex', justifyContent: 'center' }}>
<Grid.Column width="seven"> <Grid.Column width="seven">
<Segment basic> <Segment basic>
<LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" /> <LoginForm type="sso-ui" header="SSO Login" imgSrc="UI.png" imgSize="tiny" />
...@@ -38,7 +38,7 @@ export default class Login extends React.Component { ...@@ -38,7 +38,7 @@ export default class Login extends React.Component {
<Grid.Column width="seven"> <Grid.Column width="seven">
<Segment basic> <Segment basic>
<LoginForm type="company" header="Company Login" imgSrc="logo.png" imgSize="small" /> <LoginForm type="company" header="Company Login" imgSrc="logo.png" imgSize="small" usernameLabel="Email"/>
{this.props.children} {this.props.children}
</Segment > </Segment >
......
import React from 'react'; import React from 'react';
import { Container } from 'semantic-ui-react'; import { Segment } from 'semantic-ui-react';
import Tabs from './components/Tabs'; import Tabs from './components/Tabs';
import Pane from './components/Pane'; import Pane from './components/Pane';
import VacancyList from './components/VacancyList'; import VacancyList from './components/VacancyList';
...@@ -82,7 +82,7 @@ export default class VacancyPage extends React.Component { ...@@ -82,7 +82,7 @@ export default class VacancyPage extends React.Component {
} else if ((this.props.user.role === 'admin' && this.props.user.data.company != null) } else if ((this.props.user.role === 'admin' && this.props.user.data.company != null)
|| this.props.user.role === 'company') { || this.props.user.role === 'company') {
return ( return (
<Container className="vacancies"> <Segment className="paginationCompany">
<Pagination <Pagination
key={1} key={1}
url={`/companies/${this.state.id}/vacancies/`} url={`/companies/${this.state.id}/vacancies/`}
...@@ -95,7 +95,7 @@ export default class VacancyPage extends React.Component { ...@@ -95,7 +95,7 @@ export default class VacancyPage extends React.Component {
} }
error="Anda belum diverifikasi. Harap hubungi admin" error="Anda belum diverifikasi. Harap hubungi admin"
/> />
</Container> </Segment>
); );
} else if (this.props.user.role === 'admin' || this.props.user.role === 'supervisor') { } else if (this.props.user.role === 'admin' || this.props.user.role === 'supervisor') {
return ( return (
......
...@@ -4,7 +4,6 @@ import fetchMock from 'fetch-mock'; ...@@ -4,7 +4,6 @@ import fetchMock from 'fetch-mock';
import ApplicantPage from '../ApplicantPage'; import ApplicantPage from '../ApplicantPage';
describe('ApplicantPage', () => { describe('ApplicantPage', () => {
fetchMock.get('*', { data: 'value' });
const companyUser = { const companyUser = {
role: 'company', role: 'company',
...@@ -34,9 +33,174 @@ describe('ApplicantPage', () => { ...@@ -34,9 +33,174 @@ describe('ApplicantPage', () => {
}, },
}; };
const newResponse = [
{
company: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/8/',
username: 'Tutuplapak',
email: '',
is_staff: false,
},
name: 'Tutuplapak',
created: '2017-03-28T07:30:10.535240Z',
updated: '2017-05-07T13:22:19.175033Z',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla aliquet semper neque a fermentum. Duis ac tellus vitae augue iaculis ultrices. Curabitur commodo et neque nec feugiat. Morbi ac diam vel nunc commodo cursus. Phasellus nulla sapien, hendrerit vitae bibendum at, sollicitudin eu ante. Maecenas maximus, ante eu sollicitudin convallis, mauris nunc posuere risus, eu porttitor diam lacus vitae enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse at lectus a elit sollicitudin tempor. Nullam condimentum, justo nec tincidunt maximus, neque mi vulputate leo, sit amet lacinia massa ex eget sem. Duis ac erat facilisis, fringilla mauris in, consequat neque. In et neque consequat, vehicula magna at, efficitur ante. Mauris ac lacinia nibh.\r\n\r\nProin sagittis, lectus quis maximus varius, libero justo sollicitudin augue, non lacinia risus orci a enim. Curabitur iaculis enim quis ullamcorper commodo. Vivamus id nisi rhoncus, dignissim tellus quis, interdum est. Fusce sollicitudin eu libero ac feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper posuere ex, sed accumsan libero iaculis faucibus. Fusce laoreet ac ligula ut consectetur. Donec tortor mauris, rutrum at sodales et, viverra in dolor. Sed bibendum elit et maximus volutpat. Phasellus justo ipsum, laoreet sit amet faucibus eu, ultricies suscipit mauris. Nullam aliquam libero eu ante ultrices mattis. Donec non justo hendrerit neque volutpat placerat. Ut euismod est nec sem mollis, sit amet porttitor massa rhoncus. Aenean id erat sit amet nunc ultrices scelerisque non in ipsum. Curabitur sollicitudin nulla id mi accumsan venenatis.',
registeredStatus: 1,
logo: null,
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
},
verified: true,
open_time: '2017-04-26T03:39:11Z',
description: 'deskripsi',
close_time: '2017-04-30T03:39:11Z',
created: '2017-04-26T03:39:39.916758Z',
updated: '2017-04-26T03:41:07.157634Z',
name: 'Kepala Sekolah',
status: 0,
bookmarked: false,
id: 4,
},
{
company: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/8/',
username: 'Tutuplapak',
email: '',
is_staff: false,
},
name: 'Tutuplapak',
created: '2017-03-28T07:30:10.535240Z',
updated: '2017-05-07T13:22:19.175033Z',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla aliquet semper neque a fermentum. Duis ac tellus vitae augue iaculis ultrices. Curabitur commodo et neque nec feugiat. Morbi ac diam vel nunc commodo cursus. Phasellus nulla sapien, hendrerit vitae bibendum at, sollicitudin eu ante. Maecenas maximus, ante eu sollicitudin convallis, mauris nunc posuere risus, eu porttitor diam lacus vitae enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse at lectus a elit sollicitudin tempor. Nullam condimentum, justo nec tincidunt maximus, neque mi vulputate leo, sit amet lacinia massa ex eget sem. Duis ac erat facilisis, fringilla mauris in, consequat neque. In et neque consequat, vehicula magna at, efficitur ante. Mauris ac lacinia nibh.\r\n\r\nProin sagittis, lectus quis maximus varius, libero justo sollicitudin augue, non lacinia risus orci a enim. Curabitur iaculis enim quis ullamcorper commodo. Vivamus id nisi rhoncus, dignissim tellus quis, interdum est. Fusce sollicitudin eu libero ac feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper posuere ex, sed accumsan libero iaculis faucibus. Fusce laoreet ac ligula ut consectetur. Donec tortor mauris, rutrum at sodales et, viverra in dolor. Sed bibendum elit et maximus volutpat. Phasellus justo ipsum, laoreet sit amet faucibus eu, ultricies suscipit mauris. Nullam aliquam libero eu ante ultrices mattis. Donec non justo hendrerit neque volutpat placerat. Ut euismod est nec sem mollis, sit amet porttitor massa rhoncus. Aenean id erat sit amet nunc ultrices scelerisque non in ipsum. Curabitur sollicitudin nulla id mi accumsan venenatis.',
registeredStatus: 1,
logo: 'http://localhost:8000/files/company-logo/8a258a48-3bce-4873-b5d1-538b360d0059.png',
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
},
verified: true,
open_time: '2017-04-26T03:39:11Z',
description: 'deskripsi',
close_time: '2017-04-30T03:39:11Z',
created: '2017-04-26T03:39:39.916758Z',
updated: '2017-04-26T03:41:07.157634Z',
name: 'Kepala Sekolah',
status: 1,
bookmarked: false,
id: 4,
},
{
company: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/8/',
username: 'Tutuplapak',
email: '',
is_staff: false,
},
name: 'Tutuplapak',
created: '2017-03-28T07:30:10.535240Z',
updated: '2017-05-07T13:22:19.175033Z',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla aliquet semper neque a fermentum. Duis ac tellus vitae augue iaculis ultrices. Curabitur commodo et neque nec feugiat. Morbi ac diam vel nunc commodo cursus. Phasellus nulla sapien, hendrerit vitae bibendum at, sollicitudin eu ante. Maecenas maximus, ante eu sollicitudin convallis, mauris nunc posuere risus, eu porttitor diam lacus vitae enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse at lectus a elit sollicitudin tempor. Nullam condimentum, justo nec tincidunt maximus, neque mi vulputate leo, sit amet lacinia massa ex eget sem. Duis ac erat facilisis, fringilla mauris in, consequat neque. In et neque consequat, vehicula magna at, efficitur ante. Mauris ac lacinia nibh.\r\n\r\nProin sagittis, lectus quis maximus varius, libero justo sollicitudin augue, non lacinia risus orci a enim. Curabitur iaculis enim quis ullamcorper commodo. Vivamus id nisi rhoncus, dignissim tellus quis, interdum est. Fusce sollicitudin eu libero ac feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper posuere ex, sed accumsan libero iaculis faucibus. Fusce laoreet ac ligula ut consectetur. Donec tortor mauris, rutrum at sodales et, viverra in dolor. Sed bibendum elit et maximus volutpat. Phasellus justo ipsum, laoreet sit amet faucibus eu, ultricies suscipit mauris. Nullam aliquam libero eu ante ultrices mattis. Donec non justo hendrerit neque volutpat placerat. Ut euismod est nec sem mollis, sit amet porttitor massa rhoncus. Aenean id erat sit amet nunc ultrices scelerisque non in ipsum. Curabitur sollicitudin nulla id mi accumsan venenatis.',
registeredStatus: 1,
logo: null,
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
},
verified: true,
open_time: '2017-04-26T03:39:11Z',
description: 'deskripsi',
close_time: '2017-04-30T03:39:11Z',
created: '2017-04-26T03:39:39.916758Z',
updated: '2017-04-26T03:41:07.157634Z',
name: 'Kepala Sekolah',
status: 2,
bookmarked: true,
id: 4,
},
{
company: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/8/',
username: 'Tutuplapak',
email: '',
is_staff: false,
},
name: 'Tutuplapak',
created: '2017-03-28T07:30:10.535240Z',
updated: '2017-05-07T13:22:19.175033Z',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla aliquet semper neque a fermentum. Duis ac tellus vitae augue iaculis ultrices. Curabitur commodo et neque nec feugiat. Morbi ac diam vel nunc commodo cursus. Phasellus nulla sapien, hendrerit vitae bibendum at, sollicitudin eu ante. Maecenas maximus, ante eu sollicitudin convallis, mauris nunc posuere risus, eu porttitor diam lacus vitae enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse at lectus a elit sollicitudin tempor. Nullam condimentum, justo nec tincidunt maximus, neque mi vulputate leo, sit amet lacinia massa ex eget sem. Duis ac erat facilisis, fringilla mauris in, consequat neque. In et neque consequat, vehicula magna at, efficitur ante. Mauris ac lacinia nibh.\r\n\r\nProin sagittis, lectus quis maximus varius, libero justo sollicitudin augue, non lacinia risus orci a enim. Curabitur iaculis enim quis ullamcorper commodo. Vivamus id nisi rhoncus, dignissim tellus quis, interdum est. Fusce sollicitudin eu libero ac feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper posuere ex, sed accumsan libero iaculis faucibus. Fusce laoreet ac ligula ut consectetur. Donec tortor mauris, rutrum at sodales et, viverra in dolor. Sed bibendum elit et maximus volutpat. Phasellus justo ipsum, laoreet sit amet faucibus eu, ultricies suscipit mauris. Nullam aliquam libero eu ante ultrices mattis. Donec non justo hendrerit neque volutpat placerat. Ut euismod est nec sem mollis, sit amet porttitor massa rhoncus. Aenean id erat sit amet nunc ultrices scelerisque non in ipsum. Curabitur sollicitudin nulla id mi accumsan venenatis.',
registeredStatus: 1,
logo: null,
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
},
verified: true,
open_time: '2017-04-26T03:39:11Z',
description: 'deskripsi',
close_time: '2017-04-30T03:39:11Z',
created: '2017-04-26T03:39:39.916758Z',
updated: '2017-04-26T03:41:07.157634Z',
name: 'Kepala Sekolah',
status: 3,
bookmarked: true,
id: 4,
},
{
company: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/8/',
username: 'Tutuplapak',
email: '',
is_staff: false,
},
name: 'Tutuplapak',
created: '2017-03-28T07:30:10.535240Z',
updated: '2017-05-07T13:22:19.175033Z',
description: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla aliquet semper neque a fermentum. Duis ac tellus vitae augue iaculis ultrices. Curabitur commodo et neque nec feugiat. Morbi ac diam vel nunc commodo cursus. Phasellus nulla sapien, hendrerit vitae bibendum at, sollicitudin eu ante. Maecenas maximus, ante eu sollicitudin convallis, mauris nunc posuere risus, eu porttitor diam lacus vitae enim. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse at lectus a elit sollicitudin tempor. Nullam condimentum, justo nec tincidunt maximus, neque mi vulputate leo, sit amet lacinia massa ex eget sem. Duis ac erat facilisis, fringilla mauris in, consequat neque. In et neque consequat, vehicula magna at, efficitur ante. Mauris ac lacinia nibh.\r\n\r\nProin sagittis, lectus quis maximus varius, libero justo sollicitudin augue, non lacinia risus orci a enim. Curabitur iaculis enim quis ullamcorper commodo. Vivamus id nisi rhoncus, dignissim tellus quis, interdum est. Fusce sollicitudin eu libero ac feugiat. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Maecenas semper posuere ex, sed accumsan libero iaculis faucibus. Fusce laoreet ac ligula ut consectetur. Donec tortor mauris, rutrum at sodales et, viverra in dolor. Sed bibendum elit et maximus volutpat. Phasellus justo ipsum, laoreet sit amet faucibus eu, ultricies suscipit mauris. Nullam aliquam libero eu ante ultrices mattis. Donec non justo hendrerit neque volutpat placerat. Ut euismod est nec sem mollis, sit amet porttitor massa rhoncus. Aenean id erat sit amet nunc ultrices scelerisque non in ipsum. Curabitur sollicitudin nulla id mi accumsan venenatis.',
registeredStatus: 1,
logo: null,
address: 'Jl. Kebayoran Baru nomor 13, Jakarta Barat',
},
verified: true,
open_time: '2017-04-26T03:39:11Z',
description: 'deskripsi',
close_time: '2017-04-30T03:39:11Z',
created: '2017-04-26T03:39:39.916758Z',
updated: '2017-04-26T03:41:07.157634Z',
name: 'Kepala Sekolah',
status: 4,
bookmarked: true,
id: 4,
},
];
it('renders for companies without problem', () => { it('renders for companies without problem', () => {
const applicantPage = ReactTestUtils.renderIntoDocument( const applicantPage = ReactTestUtils.renderIntoDocument(
<ApplicantPage user={companyUser} />); <ApplicantPage user={companyUser} />);
expect(applicantPage).to.exist; expect(applicantPage).to.exist;
}); });
it('handle dropdown changes without problem', () => {
fetchMock.get('*', newResponse);
const applicantPage = ReactTestUtils.renderIntoDocument(
<ApplicantPage user={companyUser} />);
const dropdown = ReactTestUtils.findRenderedDOMComponentWithTag(applicantPage, 'select');
ReactTestUtils.Simulate.change(dropdown);
applicantPage.handleChange({}, {value: 'pilih'});
expect(applicantPage).to.exist;
fetchMock.restore();
});
it('handle dropdown changes without problem', () => {
fetchMock.get('*', 404);
const applicantPage = ReactTestUtils.renderIntoDocument(
<ApplicantPage user={companyUser} />);
const dropdown = ReactTestUtils.findRenderedDOMComponentWithTag(applicantPage, 'select');
ReactTestUtils.Simulate.change(dropdown);
applicantPage.handleChange({}, {value: 'pilih'});
expect(applicantPage).to.exist;
fetchMock.restore();
});
}); });
import React from 'react'; import React from 'react';
import { Item, Grid } from 'semantic-ui-react'; import { Item, Grid, Container } from 'semantic-ui-react';
import Applicant from './Applicant'; import Applicant from './Applicant';
export default class ApplicantList extends React.Component { export default class ApplicantList extends React.Component {
...@@ -33,6 +33,17 @@ export default class ApplicantList extends React.Component { ...@@ -33,6 +33,17 @@ export default class ApplicantList extends React.Component {