mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-19 21:16:18 +00:00
Fixed coding styles
This commit is contained in:
@@ -30,7 +30,7 @@ describe('<ErrorHandler />', () => {
|
||||
|
||||
expect(wrapper.text()).toContain('Oops! This is awkward :S');
|
||||
expect(wrapper.text()).toContain(
|
||||
'It seems that something went wrong. Try refreshing the page or just click this button.'
|
||||
'It seems that something went wrong. Try refreshing the page or just click this button.',
|
||||
);
|
||||
expect(wrapper.find(Button)).toHaveLength(1);
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('<NotFound />', () => {
|
||||
const { content } = createWrapper();
|
||||
|
||||
expect(content).toContain(
|
||||
'Use your browser\'s back button to navigate to the page you have previously come from, or just press this button.'
|
||||
'Use your browser\'s back button to navigate to the page you have previously come from, or just press this button.',
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('<CreateServer />', () => {
|
||||
const CreateServer = createServerConstruct(ImportServersBtn, () => [ serversImported, () => '' ]);
|
||||
|
||||
wrapper = shallow(
|
||||
<CreateServer createServer={createServerMock} resetSelectedServer={identity} history={historyMock} />
|
||||
<CreateServer createServer={createServerMock} resetSelectedServer={identity} history={historyMock} />,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -22,7 +22,7 @@ describe('<DeleteServerModal />', () => {
|
||||
isOpen={true}
|
||||
deleteServer={deleteServerMock}
|
||||
history={historyMock}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
@@ -38,7 +38,7 @@ describe('<DeleteServerModal />', () => {
|
||||
const modalBody = wrapper.find(ModalBody);
|
||||
|
||||
expect(modalBody.find('p').first().text()).toEqual(
|
||||
`Are you sure you want to remove ${serverName}?`
|
||||
`Are you sure you want to remove ${serverName}?`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ describe('<EditServer />', () => {
|
||||
match={match}
|
||||
selectedServer={selectedServer}
|
||||
selectServer={jest.fn()}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('<ServersDropdown />', () => {
|
||||
|
||||
it('shows a message when no servers exist yet', () => {
|
||||
wrapped = shallow(
|
||||
<ServersDropdown servers={{}} listServers={identity} history={history} />
|
||||
<ServersDropdown servers={{}} listServers={identity} history={history} />,
|
||||
);
|
||||
const item = wrapped.find(DropdownItem);
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ describe('<ForServerVersion />', () => {
|
||||
wrapped = mount(
|
||||
<ForServerVersion minVersion={minVersion} maxVersion={maxVersion} selectedServer={selectedServer}>
|
||||
<span>Hello</span>
|
||||
</ForServerVersion>
|
||||
</ForServerVersion>,
|
||||
);
|
||||
|
||||
return wrapped;
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('<ImportServersBtn />', () => {
|
||||
const ImportServersBtn = importServersBtnConstruct(serversImporterMock);
|
||||
|
||||
wrapper = shallow(
|
||||
<ImportServersBtn createServers={createServersMock} fileRef={fileRef} onImport={onImportMock} />
|
||||
<ImportServersBtn createServers={createServersMock} fileRef={fileRef} onImport={onImportMock} />,
|
||||
);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('<ServerError />', () => {
|
||||
wrapper = shallow(
|
||||
<BrowserRouter>
|
||||
<ServerError type={type} servers={{}} selectedServer={selectedServer} />
|
||||
</BrowserRouter>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
const wrapperText = wrapper.html();
|
||||
const textPairs = Object.entries(textsToFind);
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('<CreateShortUrl />', () => {
|
||||
const CreateShortUrl = createShortUrlsCreator(TagsSelector, () => '', () => '');
|
||||
|
||||
wrapper = shallow(
|
||||
<CreateShortUrl shortUrlCreationResult={shortUrlCreationResult} createShortUrl={createShortUrl} />
|
||||
<CreateShortUrl shortUrlCreationResult={shortUrlCreationResult} createShortUrl={createShortUrl} />,
|
||||
);
|
||||
});
|
||||
afterEach(() => {
|
||||
|
||||
@@ -52,7 +52,7 @@ describe('<SearchBar />', () => {
|
||||
|
||||
it('updates short URLs list when a tag is removed', () => {
|
||||
wrapper = shallow(
|
||||
<SearchBar shortUrlsListParams={{ tags: [ 'foo' ] }} listShortUrls={listShortUrlsMock} />
|
||||
<SearchBar shortUrlsListParams={{ tags: [ 'foo' ] }} listShortUrls={listShortUrlsMock} />,
|
||||
);
|
||||
const tag = wrapper.find(Tag).first();
|
||||
|
||||
@@ -63,7 +63,7 @@ describe('<SearchBar />', () => {
|
||||
|
||||
it.each([ 'startDateChange', 'endDateChange' ])('updates short URLs list when date range changes', (event) => {
|
||||
wrapper = shallow(
|
||||
<SearchBar shortUrlsListParams={{}} listShortUrls={listShortUrlsMock} />
|
||||
<SearchBar shortUrlsListParams={{}} listShortUrls={listShortUrlsMock} />,
|
||||
);
|
||||
const dateRange = wrapper.find(DateRangeRow);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ describe('<ShortUrlsList />', () => {
|
||||
]
|
||||
}
|
||||
mercureInfo={{ loading: true }}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ describe('<DeleteShortUrlModal />', () => {
|
||||
toggle={identity}
|
||||
deleteShortUrl={deleteShortUrl}
|
||||
resetDeleteShortUrl={identity}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('<EditMetaModal />', () => {
|
||||
toggle={toggle}
|
||||
editShortUrlMeta={editShortUrlMeta}
|
||||
resetShortUrlMeta={resetShortUrlMeta}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('<EditShortUrlModal />', () => {
|
||||
shortUrlEdition={shortUrlEdition}
|
||||
toggle={toggle}
|
||||
editShortUrl={editShortUrl}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -26,7 +26,7 @@ describe('<EditTagsModal />', () => {
|
||||
toggle={toggle}
|
||||
editShortUrlTags={editShortUrlTags}
|
||||
resetShortUrlsTags={resetShortUrlsTags}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('<ShortUrlVisitsCount />', () => {
|
||||
const maxVisitsTooltip = wrapper.find(UncontrolledTooltip);
|
||||
|
||||
expect(wrapper.html()).toEqual(
|
||||
`<span><strong class="short-url-visits-count__amount">${visitsCount}</strong></span>`
|
||||
`<span><strong class="short-url-visits-count__amount">${visitsCount}</strong></span>`,
|
||||
);
|
||||
expect(maxVisitsHelper).toHaveLength(0);
|
||||
expect(maxVisitsTooltip).toHaveLength(0);
|
||||
|
||||
@@ -34,7 +34,7 @@ describe('<ShortUrlsRow />', () => {
|
||||
const ShortUrlsRow = createShortUrlsRow(ShortUrlsRowMenu, colorGenerator, useStateFlagTimeout);
|
||||
|
||||
wrapper = shallow(
|
||||
<ShortUrlsRow shortUrlsListParams={{}} refreshList={mockFunction} selecrtedServer={server} shortUrl={shortUrl} />
|
||||
<ShortUrlsRow shortUrlsListParams={{}} refreshList={mockFunction} selecrtedServer={server} shortUrl={shortUrl} />,
|
||||
);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
@@ -23,7 +23,7 @@ describe('<ShortUrlsRowMenu />', () => {
|
||||
EditTagsModal,
|
||||
EditMetaModal,
|
||||
EditShortUrlModal,
|
||||
() => ''
|
||||
() => '',
|
||||
);
|
||||
|
||||
wrapper = shallow(
|
||||
@@ -31,7 +31,7 @@ describe('<ShortUrlsRowMenu />', () => {
|
||||
selectedServer={selectedServer}
|
||||
shortUrl={shortUrl}
|
||||
onCopyToClipboard={onCopyToClipboard}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -60,7 +60,7 @@ describe('shortUrlDeletionReducer', () => {
|
||||
});
|
||||
|
||||
it.each(
|
||||
[[ undefined ], [ null ], [ 'example.com' ]]
|
||||
[[ undefined ], [ null ], [ 'example.com' ]],
|
||||
)('dispatches proper actions if API client request succeeds', async (domain) => {
|
||||
const apiClientMock = {
|
||||
deleteShortUrl: jest.fn(() => ''),
|
||||
|
||||
@@ -70,7 +70,7 @@ describe('shortUrlTagsReducer', () => {
|
||||
expect(dispatch).toHaveBeenNthCalledWith(1, { type: EDIT_SHORT_URL_TAGS_START });
|
||||
expect(dispatch).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
{ type: SHORT_URL_TAGS_EDITED, tags: normalizedTags, shortCode, domain }
|
||||
{ type: SHORT_URL_TAGS_EDITED, tags: normalizedTags, shortCode, domain },
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ describe('<TagsList />', () => {
|
||||
const TagsList = createTagsList(TagCard);
|
||||
|
||||
wrapper = shallow(
|
||||
<TagsList forceListTags={identity} filterTags={filterTags} match={{ params }} tagsList={tagsList} />
|
||||
<TagsList forceListTags={identity} filterTags={filterTags} match={{ params }} tagsList={tagsList} />,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -17,7 +17,7 @@ describe('<DeleteTagConfirmModal />', () => {
|
||||
deleteTag={deleteTag}
|
||||
tagDeleted={tagDeleted}
|
||||
tagDelete={tagDelete}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -42,7 +42,7 @@ describe('ShlinkApiClient', () => {
|
||||
const { createShortUrl } = new ShlinkApiClient(axiosSpy);
|
||||
|
||||
await createShortUrl(
|
||||
{ foo: 'bar', empty: undefined, anotherEmpty: null }
|
||||
{ foo: 'bar', empty: undefined, anotherEmpty: null },
|
||||
);
|
||||
|
||||
expect(axiosSpy).toHaveBeenCalledWith(expect.objectContaining({ data: { foo: 'bar' } }));
|
||||
|
||||
@@ -30,7 +30,7 @@ describe('<ShortUrlVisits />', () => {
|
||||
shortUrlDetail={{}}
|
||||
cancelGetShortUrlVisits={identity}
|
||||
matchMedia={() => ({ matches: false })}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('<ShortUrlVisitsHeader />', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<ShortUrlVisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} goBack={goBack} />
|
||||
<ShortUrlVisitsHeader shortUrlDetail={shortUrlDetail} shortUrlVisits={shortUrlVisits} goBack={goBack} />,
|
||||
);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
@@ -25,7 +25,7 @@ describe('<TagVisits />', () => {
|
||||
history={history}
|
||||
tagVisits={{ loading: true, visits: [] }}
|
||||
cancelGetTagVisits={identity}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ describe('<TagVisitsHeader />', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<TagVisitsHeader tagVisits={tagVisits} goBack={goBack} colorGenerator={{}} />
|
||||
<TagVisitsHeader tagVisits={tagVisits} goBack={goBack} colorGenerator={{}} />,
|
||||
);
|
||||
});
|
||||
afterEach(() => wrapper.unmount());
|
||||
|
||||
@@ -10,7 +10,7 @@ describe('<VisitsHeader />', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = shallow(
|
||||
<VisitsHeader visits={visits} goBack={goBack} title={title} />
|
||||
<VisitsHeader visits={visits} goBack={goBack} title={title} />,
|
||||
);
|
||||
});
|
||||
|
||||
@@ -21,7 +21,7 @@ describe('<VisitsHeader />', () => {
|
||||
const visitsBadge = wrapper.find('.badge');
|
||||
|
||||
expect(visitsBadge.html()).toContain(
|
||||
`Visits: <span><strong class="short-url-visits-count__amount">${visits.length}</strong></span>`
|
||||
`Visits: <span><strong class="short-url-visits-count__amount">${visits.length}</strong></span>`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('<VisitStats />', () => {
|
||||
visitsInfo={visitsInfo}
|
||||
cancelGetVisits={identity}
|
||||
matchMedia={() => ({ matches: false })}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
|
||||
@@ -16,7 +16,7 @@ describe('<VisitsTable />', () => {
|
||||
selectedVisits={selectedVisits}
|
||||
setSelectedVisits={setSelectedVisits}
|
||||
matchMedia={matchMedia}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
@@ -64,7 +64,7 @@ describe('<VisitsTable />', () => {
|
||||
});
|
||||
|
||||
it.each(
|
||||
rangeOf(20, (value) => [ value ])
|
||||
rangeOf(20, (value) => [ value ]),
|
||||
)('does not render footer when there is only one page to render', (visitsCount) => {
|
||||
const wrapper = createWrapper(rangeOf(visitsCount, () => ({ browser: '', date: '', referer: '' })));
|
||||
const tr = wrapper.find('tbody').find('tr');
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('<SortableBarGraph />', () => {
|
||||
stats={{ ...stats, ...extraStats }}
|
||||
sortingItems={sortingItems}
|
||||
withPagination={withPagination}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
return wrapper;
|
||||
@@ -108,7 +108,7 @@ describe('<SortableBarGraph />', () => {
|
||||
</span>
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
</span>,
|
||||
).find(SortableBarGraph);
|
||||
const header = wrapper.renderProp('extraHeaderContent')();
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ describe('visitCreationReducer', () => {
|
||||
describe('createNewVisit', () => {
|
||||
it('just returns the action with proper type', () =>
|
||||
expect(createNewVisit({ shortUrl: {}, visit: {} })).toEqual(
|
||||
{ type: CREATE_VISIT, shortUrl: {}, visit: {} }
|
||||
{ type: CREATE_VISIT, shortUrl: {}, visit: {} },
|
||||
));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user