mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-04-21 05:56:20 +00:00
Add Shlink prefix to api-contract models
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { fromPartial } from '@total-typescript/shoehorn';
|
||||
import { MemoryRouter } from 'react-router-dom';
|
||||
import type { ShortUrl } from '../../../src/short-urls/data';
|
||||
import type { ShlinkShortUrl } from '../../../src/short-urls/data';
|
||||
import type { LinkSuffix } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
|
||||
import { ShortUrlDetailLink } from '../../../src/short-urls/helpers/ShortUrlDetailLink';
|
||||
import { RoutesPrefixProvider } from '../../../src/utils/routesPrefix';
|
||||
@@ -12,8 +12,8 @@ describe('<ShortUrlDetailLink />', () => {
|
||||
[false, null],
|
||||
[true, null],
|
||||
[true, undefined],
|
||||
[false, fromPartial<ShortUrl>({})],
|
||||
[false, fromPartial<ShortUrl>({})],
|
||||
[false, fromPartial<ShlinkShortUrl>({})],
|
||||
[false, fromPartial<ShlinkShortUrl>({})],
|
||||
])('only renders a plain span when either server or short URL are not set', (asLink, shortUrl) => {
|
||||
render(
|
||||
<ShortUrlDetailLink shortUrl={shortUrl} asLink={asLink} suffix="visits">
|
||||
@@ -28,25 +28,25 @@ describe('<ShortUrlDetailLink />', () => {
|
||||
it.each([
|
||||
[
|
||||
'/server/1',
|
||||
fromPartial<ShortUrl>({ shortCode: 'abc123' }),
|
||||
fromPartial<ShlinkShortUrl>({ shortCode: 'abc123' }),
|
||||
'visits' as LinkSuffix,
|
||||
'/server/1/short-code/abc123/visits',
|
||||
],
|
||||
[
|
||||
'/foobar',
|
||||
fromPartial<ShortUrl>({ shortCode: 'def456', domain: 'example.com' }),
|
||||
fromPartial<ShlinkShortUrl>({ shortCode: 'def456', domain: 'example.com' }),
|
||||
'visits' as LinkSuffix,
|
||||
'/foobar/short-code/def456/visits?domain=example.com',
|
||||
],
|
||||
[
|
||||
'/server/1',
|
||||
fromPartial<ShortUrl>({ shortCode: 'abc123' }),
|
||||
fromPartial<ShlinkShortUrl>({ shortCode: 'abc123' }),
|
||||
'edit' as LinkSuffix,
|
||||
'/server/1/short-code/abc123/edit',
|
||||
],
|
||||
[
|
||||
'/server/3',
|
||||
fromPartial<ShortUrl>({ shortCode: 'def456', domain: 'example.com' }),
|
||||
fromPartial<ShlinkShortUrl>({ shortCode: 'def456', domain: 'example.com' }),
|
||||
'edit' as LinkSuffix,
|
||||
'/server/3/short-code/def456/edit?domain=example.com',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user