Fakultas Ilmu Komputer UI

Commit 7405ee93 authored by Ahmad Yazid's avatar Ahmad Yazid
Browse files

1506722752 134

parent 9312cfc7
......@@ -92,7 +92,7 @@ export default class Login extends React.Component {
<Header as="h2" icon textAlign="center">
<Image src="/assets/img/logo.png" size="medium" centered />
<Header.Content>Kanal Akses Pendaftaran KP Elektronik</Header.Content>
<InfoModal>TEST</InfoModal>
<InfoModal>KAPE INFO</InfoModal>
</Header>
</div>
......
......@@ -6,6 +6,7 @@ import Tabs from './components/Tabs';
import Pane from './components/Pane';
import VacancyList from './components/VacancyList';
import Pagination from './components/Pagination';
import InfoLowonganModal from './components/InfoLowonganModal';
export default class VacancyPage extends React.Component {
static propTypes = {
......
/* eslint-disable no-unused-expressions */
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import InfoLowonganModal from '../../components/InfoLowonganModal';
describe('InfoLowonganModal', () => {
it('renders without problem', () => {
const modalInfo = ReactTestUtils.renderIntoDocument(
<InfoLowonganModal buttonTitle="submit" />
);
expect(modalInfo).to.exist;
});
it('open without problem', () => {
const modalInfo = ReactTestUtils.renderIntoDocument(
<InfoLowonganModal buttonTitle="submit" />
);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(
modalInfo,
'Button'
);
modalInfo.handleApply();
ReactTestUtils.Simulate.click(modal);
expect(modalInfo).to.exist;
});
it('open with problem', () => {
const modalInfo = ReactTestUtils.renderIntoDocument(
<InfoLowonganModal buttonTitle="submit" />
);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(
modalInfo,
'Button'
);
ReactTestUtils.Simulate.click(modal);
expect(modalInfo).to.exist;
});
});
import React from 'react';
import { Modal, Button } from 'semantic-ui-react';
import ModalAlert from './../components/ModalAlert';
export default class InfoModal extends React.Component {
static propTypes = {
data: React.PropTypes.object.isRequired,
active: React.PropTypes.bool.isRequired,
buttonTitle: React.PropTypes.string.isRequired,
resume: React.PropTypes.string,
studentId: React.PropTypes.number.isRequired,
updateStatus: React.PropTypes.func.isRequired
};
constructor(props) {
super(props);
/* istanbul ignore next */
this.state = {
modalOpen: false,
coverLetter: '',
load: false
};
this.handleChange = this.handleChange.bind(this);
this.handleOpen = this.handleOpen.bind(this);
this.handleApply = this.handleApply.bind(this);
}
componentWillUpdate() {
this.fixBody();
}
componentDidUpdate() {
this.fixBody();
}
fixBody = () => {
const anotherModal = document.getElementsByClassName('ui page modals')
.length;
if (anotherModal > 0)
document.body.classList.add('scrolling', 'dimmable', 'dimmed');
};
handleChange(event) {
this.setState({ coverLetter: event.target.value });
}
handleOpen() {
this.setState({ modalOpen: true });
}
handleClose = () =>
this.setState({
modalOpen: false,
load: false
});
handleApply = () => {
this.setState({ load: true });
};
render() {
return (
<Modal
trigger={
<Button primary onClick={this.handleOpen} floated="center">
INFORMASI
</Button>
}
closeIcon="close"
open={this.state.modalOpen}
onClose={this.handleClose}
>
<Modal.Header>Lowongan Page</Modal.Header>
<Modal.Content>
<ModalAlert
ref={modal => {
this.modalAlert = modal;
}}
/>
<Modal.Description>
<Modal.Header>
{' '}
<h1>Informasi</h1>
</Modal.Header>
</Modal.Description>
<h2>
{' '}
Pada page ini anda bisa melihat semua lowongan yang ada dan mencari
lowongan yang cocok buat anda. Ada banyak fitur yang anda bisa pilih
dari melihat lamaran yang ada. Menandai lamaran untuk kemudian hari.
Serta melihat lowongan yang tersedia. Kami menambahkan fitur secara
berkala jadi jangan lupa untuk mengecek info page ini setiap anda
kunjungi web KAPE.
</h2>
</Modal.Content>
<Modal.Actions />
</Modal>
);
}
}
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