Fakultas Ilmu Komputer UI

Commit 611f1346 authored by Ahmad Yazid's avatar Ahmad Yazid
Browse files

[GREEN] Implemented new feature all test passed

parent 9241af29
Pipeline #26717 passed with stages
in 8 minutes and 23 seconds
...@@ -11,7 +11,7 @@ describe('CompanyInfo', () => { ...@@ -11,7 +11,7 @@ describe('CompanyInfo', () => {
it('open without problem', () => { it('open without problem', () => {
const modalCompany = ReactTestUtils.renderIntoDocument(<CompanyInfo buttonTitle="submit" />); const modalCompany = ReactTestUtils.renderIntoDocument(<CompanyInfo buttonTitle="submit" />);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(modalPendaftaran, 'Button'); const modal = ReactTestUtils.findRenderedDOMComponentWithTag(modalCompany, 'Button');
modalCompany.handleApply(); modalCompany.handleApply();
ReactTestUtils.Simulate.click(modal); ReactTestUtils.Simulate.click(modal);
expect(modalCompany).to.exist; expect(modalCompany).to.exist;
...@@ -19,7 +19,7 @@ describe('CompanyInfo', () => { ...@@ -19,7 +19,7 @@ describe('CompanyInfo', () => {
it('open with problem', () => { it('open with problem', () => {
const modalCompany = ReactTestUtils.renderIntoDocument(<CompanyInfo buttonTitle="submit" />); const modalCompany = ReactTestUtils.renderIntoDocument(<CompanyInfo buttonTitle="submit" />);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(modalInfo, 'Button'); const modal = ReactTestUtils.findRenderedDOMComponentWithTag(modalCompany, 'Button');
ReactTestUtils.Simulate.click(modal); ReactTestUtils.Simulate.click(modal);
expect(modalCompany).to.exist; expect(modalCompany).to.exist;
}); });
......
import React from 'react';
import { Modal, Button } from 'semantic-ui-react';
import ModalAlert from './ModalAlert';
import GeneralModal from './GeneralModal';
export default class CompanyInfo extends GeneralModal {
render() {
return (
<Modal
trigger={(
<Button primary onClick={this.handleOpen} floated="center">
Cara Tambah Lowongan
</Button>
)}
closeIcon="close"
open={this.state.modalOpen}
onClose={this.handleClose}
>
<Modal.Header>Cara Tambah Lowongan</Modal.Header>
<Modal.Content>
<ModalAlert
ref={(modal) => {
this.modalAlert = modal;
}}
/>
<Modal.Description>
<Modal.Header>
{' '}
<h1>Berikut Cara Menambahkan Lowongan Pada Situs Kape:</h1>
</Modal.Header>
</Modal.Description>
<h2>
{' '}
1.Click tombol warna hijau yang bertuliskan tambah lowongan baru.
</h2>
<h2>
{' '}
2.Isi semua informasi secara rinci supaya lowongan lebih deskriptif.
</h2>
<h2>
{' '}
3.Klik tombol submit.
</h2>
<h2>
{' '}
4. Lowongan berhasil ditambahkan.
</h2>
<h2>
{' '}
5. Untuk melihat semua pendaftar tekan lah tombol warna biru yang bertuliskan lihat semua pendaftar
</h2>
<h2>
{' '}
6. Jangan lupa untuk melihat secara berkala sehingga tidak tertingal calon perkerja pada perusahaan anda.
</h2>
</Modal.Content>
<Modal.Actions />
</Modal>
);
}
}
...@@ -6,7 +6,7 @@ import Server from '../lib/Server'; ...@@ -6,7 +6,7 @@ import Server from '../lib/Server';
import Storage from '../lib/Storage'; import Storage from '../lib/Storage';
import moment from 'moment'; import moment from 'moment';
import ModalAlert from './ModalAlert'; import ModalAlert from './ModalAlert';
import CompanyInfo from './CompanyInfo';
var quotes = require('starwars'); var quotes = require('starwars');
const defaultPicture = 'https://semantic-ui.com/images/avatar/small/elliot.jpg'; const defaultPicture = 'https://semantic-ui.com/images/avatar/small/elliot.jpg';
...@@ -56,9 +56,8 @@ export default class TopMenu extends React.Component { ...@@ -56,9 +56,8 @@ export default class TopMenu extends React.Component {
"4. Pastikan persyaratan sudah terpenuhi\n" + "4. Pastikan persyaratan sudah terpenuhi\n" +
"5. Jelaskan mengapa anda ingin mengikuti lowongan internship tersebut di 'Cover Letter'\n"+ "5. Jelaskan mengapa anda ingin mengikuti lowongan internship tersebut di 'Cover Letter'\n"+
"6. Klik tombol 'Daftar'\n", "6. Klik tombol 'Daftar'\n",
kapeDescription: "Kanal Akses Pendaftaran KP Elektronik" kapeDescription: "Kanal Akses Pendaftaran KP Elektronik",
welcomeStudent: "Selamat Datang, "
}; };
this.logout = this.logout.bind(this); this.logout = this.logout.bind(this);
this.logoutCompany = this.logoutCompany.bind(this); this.logoutCompany = this.logoutCompany.bind(this);
...@@ -171,10 +170,20 @@ export default class TopMenu extends React.Component { ...@@ -171,10 +170,20 @@ export default class TopMenu extends React.Component {
{this.state.kapeDescription} {this.state.kapeDescription}
</Menu.Item> </Menu.Item>
</Menu.Menu> </Menu.Menu>
<Menu.Menu position="center">
{this.props.user.role === 'student' && (
<Menu.Item style={{ padding: '25px' }}>
{this.state.welcomeStudent} {data.name}
</Menu.Item>
)}
</Menu.Menu>
<Menu.Menu position="right"> <Menu.Menu position="right">
{this.props.user.role === 'student' && ( {this.props.user.role === 'student' && (
<Menu.Item>{btn}</Menu.Item> <Menu.Item>{btn}</Menu.Item>
)}
{this.props.user.role === 'company' && (
<CompanyInfo>Company Info</CompanyInfo>
)} )}
<Menu.Item style={{ margin: '3px' }}> <Menu.Item style={{ margin: '3px' }}>
{this.state.currentDate} {this.state.currentDate}
......
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