Fakultas Ilmu Komputer UI

Commit d3695a34 authored by M. Reza Qorib's avatar M. Reza Qorib
Browse files

Merge branch 'develop' of https://gitlab.com/PPL2017csui/PPLA1 into Features/CompanyBrowseByVacancy

# Conflicts:
#	assets/css/custom.css
#	assets/js/components/VacancyList.jsx
#	core/tests/test_vacancies.py
parents 54527864 3ecfd274
......@@ -248,6 +248,37 @@ card .formRegis{
.ui.segment.paginationCompany{
margin-left: 10%;
margin-right: 10%;
.ui.segment.biodata-section{
background-color: white;
}
.ui.segment.biodata-section h1{
color: black;
}
.ui.segment.biodata-section h3{
color: black;
}
.ui.segment.biodata-section h4{
color: black;
}
.ui.segment.biodata-section h5{
color: black;
}
.ui.segments.biodataBorder{
border-color: transparent;
}
.transkrip{
color: black;
}
.ui.segment.biodata-section b{
color: white;
}
.admin-bar{
......@@ -269,4 +300,4 @@ card .formRegis{
margin-left:7%;
margin-top:2%;
margin-bottom: 0;
}
\ No newline at end of file
}
import React from 'react';
import Tabs from './components/Tabs';
import Pane from './components/Pane';
import AdminVacancy from './components/AdminVacancy';
import { Item } from 'semantic-ui-react';
export default class AdminVacancyPage extends React.Component {
render() {
return (
<Tabs selected={0}>
<Pane label="Lowongan Belum Terferivikasi" >
<Item.Group>
<AdminVacancy />
</Item.Group>
</Pane>
<Pane label=" Semua Lamaran" />
</Tabs>
);
}
}
......@@ -12,6 +12,7 @@ export default class CompanyPage extends React.Component {
};
handleClick = () => window.open('/admin/');
handleVacancy = () => window.open('/lowongan');
render() {
return (
......@@ -19,6 +20,11 @@ export default class CompanyPage extends React.Component {
<div className="button-administrasi">
<Button onClick={this.handleClick} icon="dashboard" labelPosition="left" color="facebook" content="Buka Menu Administrasi" />
</div>
<div style={{ paddingLeft: '10px', paddingTop : '10px'}}>
<Button onClick={this.handleVacancy} icon="dashboard" labelPosition="left" color="facebook" content="Halaman Verifikasi Lowongan" />
</div>
<Tabs selected={0}>
<Pagination
key={1}
......
import React from 'react';
import TopMenu from './components/TopMenu';
import Server from './lib/Server';
import Footer from './components/Footer';
export default class Dashboard extends React.Component {
static propTypes = {
user: React.PropTypes.object.isRequired,
route: React.PropTypes.object.isRequired,
params: React.PropTypes.object.isRequired,
children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.node),
React.PropTypes.node,
]).isRequired,
user: React.PropTypes.object.isRequired,
};
constructor(props) {
super(props);
/* istanbul ignore next */
}
render = () => (
<div>
<TopMenu user={this.props.user} />
<div className="content"> {this.props.children} </div>
<Footer />
{this.props.children}
</div>
)
}
import React from 'react';
import { Segment, Image, Header, Icon, Checkbox, Container, Button, Form } from 'semantic-ui-react';
import { Segment, Image, Header, Icon, Checkbox, Container, Button, Form, Grid } from 'semantic-ui-react';
import Server from './lib/Server';
import Storage from './lib/Storage';
import ModalAlert from './components/ModalAlert';
......@@ -168,29 +168,79 @@ export default class ProfilePage extends React.Component {
const defaultPicture = 'http://semantic-ui.com/images/wireframe/square-image.png';
return (
<div className="profilePage">
<Segment className="biodata-section">
<Header as="h2" icon textAlign="center">
<Image src={this.state.photo ? this.state.photo : defaultPicture} size="small" shape="circular" />
</Header>
<Container textAlign="center" className="profile-biodata">
<div className="biodata">
<h3> { this.state.name } </h3>
<h5> { this.state.major }, { this.state.batch } </h5>
<h5> { this.state.email } </h5>
<h5> { this.state.phone_number } </h5>
<h5> { this.state.cityOfBirth}, { this.state.dateOfBirth } </h5>
<p>Sudah diterima di { this.state.acceptedNo } perusahaan</p>
</div>
<div className="button-profile">
<a target="_blank" rel="noopener noreferrer" href={this.state.resume ? this.state.resume : '#'} >
<Button primary size="small">Resume</Button>
</a>
</div>
<div>
<br />
Bagikan Transkrip: <b>{ this.state.bagikanTranskrip ? 'Ya' : 'Tidak'}</b>
</div>
</Container>
<Segment className="biodata-section" >
<Grid>
<Grid.Column width={7}>
<Header as="h2" icon textAlign="center">
<br />
<Image src={this.state.photo || defaultPicture} size="medium" />
</Header>
</Grid.Column>
<Grid.Column width={6}>
<Container textAlign="left" className="profile-biodata">
<div className="biodata">
<Segment basic textAlign="center">
<h1> { this.state.name } </h1>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="university" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<h3> { this.state.major }, { this.state.batch } </h3>
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="mail" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<h3> { this.state.email } </h3>
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="phone" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<h3> { this.state.phone_number }</h3>
</Grid.Column>
</Grid>
</Segment>
<Segment basic vertical>
<Grid>
<Grid.Column width={2}>
<Icon name="gift" size="big" />
</Grid.Column>
<Grid.Column width={13}>
<h3> { this.state.cityOfBirth}, { this.state.dateOfBirth } </h3>
</Grid.Column>
</Grid>
</Segment>
</div>
<Container textAlign="center">
<div className="button-profile">
<a href={this.state.resume || '#'} ><Button primary size="small">Resume</Button></a>
</div>
<div>
<h4> Bagikan Transkrip : { this.state.bagikanTranskrip }</h4>
</div>
</Container>
</Container>
</Grid.Column >
</Grid>
</Segment >
{ this.updateForm(this.props.route.own) }
</div>
......
import React from 'react';
import { Header, Icon, Grid } from 'semantic-ui-react';
import Pagination from './components/Pagination';
import Server from './lib/Server';
import ApplicationList from './components/ApplicationList';
const cols = [
{ key: 'StudentName', label: 'Nama' },
{ key: 'StudentID', label: 'NPM' },
{ key: 'Perusahaan', label: 'Perusahaan' },
{ key: 'Posisi', label: 'Posisi' },
{ key: 'Status', label: 'Status' },
];
export default class SupervisorPage extends React.Component {
constructor(props) {
super(props);
/* istanbul ignore next */
this.state = { list: [] };
}
componentDidMount() {
this.UserList();
}
UserList() {
Server.get('/student-applications/', false).then((data) => {
this.setState({ list: data.results });
});
}
render = () => {
return (
<Grid container columns="eleven" doubling>
<Grid.Row>
<br />
</Grid.Row>
<Grid.Row>
<Header as="h2">
<Icon name="list" />
Daftar Mahasiswa
</Header>
</Grid.Row>
<Grid.Row>
<div id="layout-content" className="layout-content-wrapper">
<Pagination url={'/student-applications/'} child={<ApplicationList cols={cols} />} />
</div>
</Grid.Row>
</Grid>
);
}
}
......@@ -15,8 +15,10 @@ export default class VacancyPage extends React.Component {
const role = user.role;
if (role === 'student') {
return user.data.student.id;
} else if (role === 'company' || role === 'admin') {
} else if (role === 'company' || (role === 'admin' && user.data.company != null)) {
return user.data.company.id;
} else if (role === 'supervisor' || (role === 'admin' && user.data.supervisor != null)) {
return user.data.supervisor.id;
}
return 0;
......@@ -31,6 +33,7 @@ export default class VacancyPage extends React.Component {
};
}
generateVacancies() {
if (this.props.user.role === 'student') {
return (
......@@ -76,7 +79,8 @@ export default class VacancyPage extends React.Component {
</Pane>
</Tabs>
);
} else if (this.props.user.role === 'company' || this.props.user.role === 'admin') {
} else if ((this.props.user.role === 'admin' && this.props.user.data.company != null)
|| this.props.user.role === 'company') {
return (
<Segment className="paginationCompany">
<Pagination
......@@ -93,6 +97,37 @@ export default class VacancyPage extends React.Component {
/>
</Segment>
);
} else if (this.props.user.role === 'admin' || this.props.user.role === 'supervisor') {
return (
<Tabs selected={0}>
<Pane label="Lowongan Belum Terverifikasi" >
<Pagination
key={1}
url="/vacancies/?verified=false"
child={
<VacancyList
user={this.props.user}
key={1}
userId={this.state.id}
/>
}
/>
</Pane>
<Pane label="Lowongan Terverifikasi" >
<Pagination
key={2}
url="/vacancies/?verified=true"
child={
<VacancyList
user={this.props.user}
key={2}
userId={this.state.id}
/>
}
/>
</Pane>
</Tabs>
);
}
return (
......
......@@ -4,7 +4,6 @@ import fetchMock from 'fetch-mock';
import ApplicantPage from '../ApplicantPage';
describe('ApplicantPage', () => {
fetchMock.get('*', { data: 'value' });
const companyUser = {
role: 'company',
......@@ -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', () => {
const applicantPage = ReactTestUtils.renderIntoDocument(
<ApplicantPage user={companyUser} />);
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();
});
});
......@@ -43,7 +43,7 @@ describe('CompanyPage', () => {
it('click dashboard button problem', () => {
const companyPage = ReactTestUtils.renderIntoDocument(
<CompanyPage user={adminUser} />);
const dashboardButton = ReactTestUtils.findRenderedDOMComponentWithTag(companyPage, 'Button');
const dashboardButton = ReactTestUtils.scryRenderedDOMComponentsWithTag(companyPage, 'Button')[0];
ReactTestUtils.Simulate.click(dashboardButton);
expect(companyPage).to.exist;
expect(dashboardButton).to.exist;
......
......@@ -90,7 +90,28 @@ describe('Dashboard', () => {
email: '',
is_staff: false,
company: null,
supervisor: null,
supervisor: {
id: 3,
user: {
url: 'http://localhost:8000/api/users/9/',
username: 'muhammad.reza42',
email: 'muhammad.reza42@ui.ac.id',
is_staff: false,
},
name: 'Muhammad R.',
created: '2017-03-28T13:33:46.147241Z',
updated: '2017-03-28T13:33:46.148248Z',
npm: 1406543593,
resume: null,
phone_number: null,
bookmarked_vacancies: [
3,
],
applied_vacancies: [
3,
1,
],
},
student: null,
},
};
......
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import fetchMock from 'fetch-mock';
import SupervisorPage from '../SupervisorPage';
describe('SupervisorPage', () => {
const data = {
count: 5,
next: null,
previous: null,
results: [
{
company_name: 'Tutuplapak',
name: 'Joshua Casey Darian Gunawan',
npm: 1406622616,