Fakultas Ilmu Komputer UI

Commit 8256f1e1 authored by Farhan Farasdak's avatar Farhan Farasdak
Browse files

[#140653601] [#42] [Red] Test For VerifyAdminModal

parent 5dcd1082
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import VerifyAdminModal from '../../components/VerifyAdminModal';
import fetchMock from 'fetch-mock';
import Storage from '../../lib/Storage';
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);
});
});
Markdown is supported
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