mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-13 19:13:46 +00:00
Moved copy-to-clipboard control next to short URL
This commit is contained in:
@@ -4,6 +4,7 @@ import moment from 'moment';
|
||||
import Moment from 'react-moment';
|
||||
import { assoc, toString } from 'ramda';
|
||||
import { ExternalLink } from 'react-external-link';
|
||||
import { CopyToClipboard } from 'react-copy-to-clipboard';
|
||||
import createShortUrlsRow from '../../../src/short-urls/helpers/ShortUrlsRow';
|
||||
import Tag from '../../../src/tags/helpers/Tag';
|
||||
|
||||
@@ -87,17 +88,17 @@ describe('<ShortUrlsRow />', () => {
|
||||
});
|
||||
|
||||
it('updates state when copied to clipboard', () => {
|
||||
const col = wrapper.find('td').at(5);
|
||||
const menu = col.find(ShortUrlsRowMenu);
|
||||
const col = wrapper.find('td').at(1);
|
||||
const menu = col.find(CopyToClipboard);
|
||||
|
||||
expect(menu).toHaveLength(1);
|
||||
expect(stateFlagTimeout).not.toHaveBeenCalled();
|
||||
menu.simulate('copyToClipboard');
|
||||
menu.simulate('copy');
|
||||
expect(stateFlagTimeout).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('shows copy hint when state prop is true', () => {
|
||||
const isHidden = () => wrapper.find('td').at(5).find('.short-urls-row__copy-hint').prop('hidden');
|
||||
const isHidden = () => wrapper.find('td').at(1).find('.short-urls-row__copy-hint').prop('hidden');
|
||||
|
||||
expect(isHidden()).toEqual(true);
|
||||
wrapper.setState({ copiedToClipboard: true });
|
||||
|
||||
@@ -49,8 +49,8 @@ describe('<ShortUrlsRowMenu />', () => {
|
||||
const wrapper = createWrapper();
|
||||
const items = wrapper.find(DropdownItem);
|
||||
|
||||
expect(items).toHaveLength(9);
|
||||
expect(items.find('[divider]')).toHaveLength(2);
|
||||
expect(items).toHaveLength(7);
|
||||
expect(items.find('[divider]')).toHaveLength(1);
|
||||
});
|
||||
|
||||
describe('toggles state when toggling modal windows', () => {
|
||||
|
||||
Reference in New Issue
Block a user