-
Notifications
You must be signed in to change notification settings - Fork 61
/
Copy pathindex.test.js
29 lines (24 loc) · 847 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import React from 'react';
import chai, { expect } from 'chai';
import chaiEnzyme from 'chai-enzyme';
import { shallow } from 'enzyme';
import sinon from 'sinon';
import ReactHTMLTableToExcel from '../src/ReactHTMLTableToExcel';
chai.use(chaiEnzyme());
const props = {
id: 'test-table-xls-button',
className: 'download-table-xls-button',
table: 'table-to-xls',
filename: 'tablexls',
sheet: 'tablexls',
buttonText: 'Download as XLS',
};
const container = shallow(<ReactHTMLTableToExcel {...props} />);
describe('tests for <ReactHTMLTableToExcel> container', () => {
it('should render one button', () => {
expect(container.find('button').length).to.equal(1);
});
it('should render one button with the correct class applied', () => {
expect(container.find('button').hasClass(props.className)).to.equal(true);
});
});