Files
superset2/superset/assets/spec/javascripts/sqllab/Timer_spec.jsx
vera-liu 8ef730b5fe Added timer to explore v2 and share it with sqllab (#1802)
* Added timer to explore v2 and share it with sqllab

* Fixed js tests

* Add timer to initial load

* Make timer smaller

* nits
2016-12-09 13:39:53 -08:00

28 lines
751 B
JavaScript

import React from 'react';
import Timer from '../../../javascripts/components/Timer';
import { shallow } from 'enzyme';
import { describe, it } from 'mocha';
import { expect } from 'chai';
import { now } from '../../../javascripts/modules/dates';
describe('Timer', () => {
const mockedProps = {
startTime: now(),
endTime: null,
isRunning: true,
state: 'warning',
};
it('renders', () => {
expect(React.isValidElement(<Timer />)).to.equal(true);
});
it('renders with props', () => {
expect(React.isValidElement(<Timer {...mockedProps} />))
.to.equal(true);
});
it('renders a span', () => {
const wrapper = shallow(<Timer {...mockedProps} />);
expect(wrapper.find('span')).to.have.length(1);
});
});