Fakultas Ilmu Komputer UI

Commit 6da1cdab authored by Syahrul Findi's avatar Syahrul Findi
Browse files

Merge branch '1506757352-235' into 'master'

fix(Admin Verification): Remove unused files

See merge request !262
parents 64b52d44 1a393073
Pipeline #26784 passed with stages
in 41 minutes and 55 seconds
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
import AdminVerificationModal from '../../components/AdminVerificationModal';
describe('AdminVerificationModal', () => {
it('renders without problem', () => {
const modalAdmin = ReactTestUtils.renderIntoDocument(
<AdminVerificationModal />,
);
expect(modalAdmin).to.exist;
});
it('close without problem', () => {
const modalAdmin = ReactTestUtils.renderIntoDocument(
<AdminVerificationModal />,
);
modalAdmin.handleClose();
expect(modalAdmin.state.modalOpen).to.equal(false);
});
it('open without problem', () => {
const modalAdmin = ReactTestUtils.renderIntoDocument(
<AdminVerificationModal />,
);
modalAdmin.handleOpen();
expect(modalAdmin.state.modalOpen).to.equal(true);
});
});
import React from 'react';
import ReactTestUtils from 'react-dom/test-utils';
import VerifyAdminModal from '../../components/VerifyAdminModal';
describe('VerifyAdminModal', () => {
it('renders without problem', () => {
const verifyModal = ReactTestUtils.renderIntoDocument(
<VerifyAdminModal />,
);
expect(verifyModal).to.exist;
});
it('open without problem', () => {
const verifyModal = ReactTestUtils.renderIntoDocument(
<VerifyAdminModal id={4} />,
);
const modal = ReactTestUtils.findRenderedDOMComponentWithTag(verifyModal, 'Button');
ReactTestUtils.Simulate.click(modal);
expect(verifyModal.state.modalOpen).to.equal(true);
});
it('close without problem', () => {
const verifyModal = ReactTestUtils.renderIntoDocument(
<VerifyAdminModal id={4} />,
);
verifyModal.handleClose();
expect(verifyModal.state.modalOpen).to.equal(false);
});
});
import React from 'react';
import {
Button, Header, Modal, Grid,
} from 'semantic-ui-react';
export default class AdminVerificationModal extends React.Component {
state = { modalOpen: false }
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');
};
handleOpen = () => this.setState({
modalOpen: true,
});
handleClose = () => this.setState({
modalOpen: false,
});
render() {
return (
<Modal
trigger={
<Button color="blue" icon="right chevron" labelPosition="right" floated="right" content="ubah" onClick={this.handleOpen} />
}
closeIcon="close"
open={this.state.modalOpen}
onClose={this.handleClose}
>
<Modal.Header>Software Engineer</Modal.Header>
<Modal.Content>
<Modal.Description>
<Header>Deskripsi Lowongan</Header>
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
</Modal.Description>
</Modal.Content>
<Modal.Actions>
<Grid columns={2}>
<Grid.Column>
<Button color="red" floated="left" onClick={this.handleClose}>Hapus</Button>
</Grid.Column>
<Grid.Column>
<Button color="blue" floated="right" onClick={this.handleClose}>Ubah</Button>
<Button color="green" floated="right" onClick={this.handleClose}>Verifikasi</Button>
</Grid.Column>
</Grid>
</Modal.Actions>
</Modal>
);
}
}
import React from 'react';
import { Button, Header, Modal } from 'semantic-ui-react';
export default class VerifyAdminModal extends React.Component {
state = { modalOpen: false }
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');
};
handleOpen = () => this.setState({
modalOpen: true,
});
handleClose = () => this.setState({
modalOpen: false,
});
render() {
return (
<Modal
trigger={
<Button color="blue" icon="right chevron" labelPosition="right" floated="right" content="ubah" onClick={this.handleOpen} />
}
closeIcon="close"
open={this.state.modalOpen}
onClose={this.handleClose}
>
<Modal.Header>Software Engineer</Modal.Header>
<Modal.Content>
<Modal.Description>
<Header>Deskripsi Lowongan</Header>
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
</Modal.Description>
</Modal.Content>
<Modal.Actions>
<Button color="green" floated="right" onClick={this.handleClose}>Verifikasi</Button>
</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