mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 13:06:22 +00:00
Implemented dependency injection in all tag related components
This commit is contained in:
@@ -3,12 +3,12 @@ import { shallow } from 'enzyme';
|
||||
import sinon from 'sinon';
|
||||
import searchBarCreator from '../../src/short-urls/SearchBar';
|
||||
import SearchField from '../../src/utils/SearchField';
|
||||
import Tag from '../../src/tags/helpers/Tag';
|
||||
|
||||
describe('<SearchBar />', () => {
|
||||
let wrapper;
|
||||
const listShortUrlsMock = sinon.spy();
|
||||
const Tag = () => '';
|
||||
const SearchBar = searchBarCreator(Tag);
|
||||
const SearchBar = searchBarCreator({});
|
||||
|
||||
afterEach(() => {
|
||||
listShortUrlsMock.resetHistory();
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { Link } from 'react-router-dom';
|
||||
import TagCard from '../../src/tags/TagCard';
|
||||
import createTagCard from '../../src/tags/TagCard';
|
||||
import TagBullet from '../../src/tags/helpers/TagBullet';
|
||||
|
||||
describe('<TagCard />', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
const TagCard = createTagCard(() => '', () => '', {});
|
||||
|
||||
wrapper = shallow(<TagCard tag="ssr" currentServerId="1" />);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
@@ -2,16 +2,17 @@ import React from 'react';
|
||||
import { shallow } from 'enzyme';
|
||||
import { identity, range } from 'ramda';
|
||||
import * as sinon from 'sinon';
|
||||
import TagsList from '../../src/tags/TagsList';
|
||||
import createTagsList from '../../src/tags/TagsList';
|
||||
import MuttedMessage from '../../src/utils/MuttedMessage';
|
||||
import TagCard from '../../src/tags/TagCard';
|
||||
import SearchField from '../../src/utils/SearchField';
|
||||
|
||||
describe('<TagsList />', () => {
|
||||
let wrapper;
|
||||
const filterTags = sinon.spy();
|
||||
const TagCard = () => '';
|
||||
const createWrapper = (tagsList) => {
|
||||
const params = { serverId: '1' };
|
||||
const TagsList = createTagsList(TagCard);
|
||||
|
||||
wrapper = shallow(
|
||||
<TagsList forceListTags={identity} filterTags={filterTags} match={{ params }} tagsList={tagsList} />
|
||||
|
||||
Reference in New Issue
Block a user