Files
superset2/superset/assets/spec/javascripts/welcome/DashboardTable_spec.jsx
Chris Williams b453cd2bf2 [lint] turn no-undef back on, set browser, cypress, and mocha env's (#5879)
* [lint] turn no-undef back on, set browser, cypress, and mocha env's, and fix issues

* [lint] fix undefined var in TimeTable.jsx
2018-09-13 14:45:24 -07:00

32 lines
730 B
JavaScript

import React from 'react';
import { mount } from 'enzyme';
import { expect } from 'chai';
import sinon from 'sinon';
import DashboardTable from '../../../src/welcome/DashboardTable';
const $ = window.$ = require('jquery');
describe('DashboardTable', () => {
const mockedProps = {};
let stub;
beforeEach(() => {
stub = sinon.stub($, 'getJSON');
});
afterEach(() => {
stub.restore();
});
it('is valid', () => {
expect(
React.isValidElement(<DashboardTable {...mockedProps} />),
).to.equal(true);
});
it('renders', () => {
const wrapper = mount(<DashboardTable {...mockedProps} />);
expect(stub.callCount).to.equal(1);
expect(wrapper.find('img')).to.have.length(1);
});
});