mirror of
https://github.com/apache/superset.git
synced 2026-04-09 11:25:23 +00:00
* 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
28 lines
800 B
JavaScript
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);
|
|
});
|
|
});
|