Files
superset2/superset/assets/spec/javascripts/components/URLShortLinkModal_spec.jsx
Jay Lindquist aa9b30cf55 Re-add dashboard short links (#5398)
* Re-add dashboard short links

* Make the short link available to all users
* Include filters in the short link for dashboards

* Remove duplicate key causing linter error

* Change URL Short link button into a menu item with Modal

* Split out tests, bind URL short link in constructor
2018-08-03 09:22:39 -07:00

28 lines
800 B
JavaScript

import React from 'react';
import configureStore from 'redux-mock-store';
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { shallow } from 'enzyme';
import URLShortLinkModal from '../../../src/components/URLShortLinkModal';
import ModalTrigger from '../../../src/components/ModalTrigger';
describe('URLShortLinkModal', () => {
const defaultProps = {
url: 'mockURL',
emailSubject: 'Mock Subject',
emailContent: 'mock content',
};
function setup() {
const mockStore = configureStore([]);
const store = mockStore({});
return shallow(<URLShortLinkModal {...defaultProps} />, { context: { store } }).dive();
}
it('renders ModalTrigger', () => {
const wrapper = setup();
expect(wrapper.find(ModalTrigger)).have.length(1);
});
});