Fakultas Ilmu Komputer UI

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

[#140654507] #12 Refactor component name

parent b9ec122f
/* eslint-disable no-unused-expressions */
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import ModalPendaftaran from '../../components/ApplyModal';
import ApplyModal from '../../components/ApplyModal';
describe('ApplyModal', () => {
it('renders without problem', () => {
const modalPendaftaran = ReactTestUtils.renderIntoDocument(
<ApplicancyModal id={4} data={{key: 'value'}} buttonTitle="submit" />);
<ApplyModal id={4} data={{key: 'value'}} buttonTitle="submit" />);
expect(modalPendaftaran).to.exist;
});
it('open without problem', () => {
const modalPendaftaran = ReactTestUtils.renderIntoDocument(
<ApplicancyModal id={4} data={{ key: 'value' }} buttonTitle="submit" />);
<ApplyModal id={4} data={{ key: 'value' }} buttonTitle="submit" />);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(modalPendaftaran, 'Button');
ReactTestUtils.Simulate.click(modal);
......
......@@ -2,7 +2,7 @@ import React from 'react';
import { Modal, Button, Icon, TextArea, Form } from 'semantic-ui-react';
import ModalAlert from './ModalAlert';
export default class AplicancyModal extends React.Component {
export default class ApplyModal extends React.Component {
static propTypes = {
data: React.PropTypes.object.isRequired,
id: React.PropTypes.number.isRequired,
......
import React from 'react';
import { Button, Image as ImageComponent, Item, Rating, Icon } from 'semantic-ui-react'
import ModalPendaftaran from './ModalPendaftaran';
import ModalPendaftaran from './ApplyModal';
const paragraph = <ImageComponent src="http://semantic-ui.com/images/wireframe/short-paragraph.png" />;
......@@ -26,7 +26,7 @@ export default class Lowongan extends React.Component {
<h4>PT. Koding Kuat </h4>
<h5> JL.Kali deres utara no.1 Jakarta Barat, DKI Jakarta</h5>
<ModalPendaftaran id={1} data={ { header: 'Deskripsi Lowongan', description: 'Lorem ipsum dolor sit amet'} } buttonTitle="Daftar" />
<ApplicancyModal id={1} data={ { header: 'Deskripsi Lowongan', description: 'Lorem ipsum dolor sit amet'} } buttonTitle="Daftar" />
</Item.Content>
</Item.Content>
......
import React from 'react';
import { Button, Image as ImageComponent, Item, Rating } from 'semantic-ui-react';
import ModalPendaftaran from './ModalPendaftaran';
import ApplyModal from './ApplyModal';
import Storage from '../lib/Storage';
import Server from '../lib/Server';
......@@ -48,7 +48,7 @@ export default class Vacancy extends React.Component {
<h4>{ this.props.data.company.name }</h4>
<h5>{ this.props.data.company.address }</h5>
<ModalPendaftaran
<ApplyModal
id={this.props.data.id} data={{ header: this.props.data.name,
description: this.props.data.description }} buttonTitle="Daftar"
/>
......
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