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
This commit is contained in:
Jay Lindquist
2018-08-03 11:22:39 -05:00
committed by Maxime Beauchemin
parent 0aff8659d8
commit aa9b30cf55
9 changed files with 552 additions and 117 deletions

View File

@@ -0,0 +1,27 @@
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);
});
});