Fakultas Ilmu Komputer UI

TranscriptPage-test.jsx 670 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import React from 'react';
import ReactTestUtils from 'react-addons-test-utils';
import fetchMock from 'fetch-mock';
import TranscriptPage from '../TranscriptPage';

describe('TranscriptPage', () => {
  const data = {
    transcript: [
      { kelas: { nm_kls: 'kelas1' }, nilai: 'A' },
      { kelas: { nm_kls: 'kelas2' }, nilai: 'B' },
      { nilai: 'B' },
    ],
    name: 'Badak Terbang',
  };

  fetchMock.get('*', data);

  it('renders for admin without problem', () => {
    const transcriptPage = ReactTestUtils.renderIntoDocument(
      <TranscriptPage params={{ id: 1 }} />);
    transcriptPage.setState({data})
    expect(transcriptPage).to.exist;
  });
});