Update testing library

This commit is contained in:
Alejandro Celaya 2023-08-08 11:24:19 +02:00
parent 2da0043e0a
commit 5bce7b91f1
4 changed files with 38 additions and 20 deletions

36
package-lock.json generated
View file

@ -52,10 +52,10 @@
"devDependencies": {
"@shlinkio/eslint-config-js-coding-standard": "~2.2.0",
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@total-typescript/shoehorn": "^0.1.0",
"@total-typescript/shoehorn": "^0.1.1",
"@types/json2csv": "^5.0.3",
"@types/leaflet": "^1.9.0",
"@types/qs": "^6.9.7",
@ -70,7 +70,7 @@
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.1",
"adm-zip": "^0.5.10",
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"eslint": "^8.46.0",
"jsdom": "^22.1.0",
"resize-observer-polyfill": "^1.5.1",
@ -3231,9 +3231,10 @@
}
},
"node_modules/@testing-library/jest-dom": {
"version": "5.16.5",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz",
"integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==",
"dev": true,
"license": "MIT",
"dependencies": {
"@adobe/css-tools": "^4.0.1",
"@babel/runtime": "^7.9.2",
@ -3354,9 +3355,9 @@
}
},
"node_modules/@total-typescript/shoehorn": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.0.tgz",
"integrity": "sha512-XKig6hXxWnUh0fsW3LR2vxpxwLlPFokfOSR0riHKA9uXvdHDfwOOPdAOi4U/YNKLmgYUu/plUfnF3yiAAz1+Zg==",
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.1.tgz",
"integrity": "sha512-XSPcazQsC2Cr7eCiAI+M2bTmMziBvFWYTYMgUDKLbU6i+7m3I2BF5gXF5vKDO8577fONs9CvmTvVa7+nMHMfxg==",
"dev": true
},
"node_modules/@types/aria-query": {
@ -4654,9 +4655,10 @@
}
},
"node_modules/chalk": {
"version": "5.2.0",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
"dev": true,
"license": "MIT",
"engines": {
"node": "^12.17.0 || ^14.13 || >=16.0.0"
},
@ -13387,7 +13389,9 @@
}
},
"@testing-library/jest-dom": {
"version": "5.16.5",
"version": "5.17.0",
"resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz",
"integrity": "sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg==",
"dev": true,
"requires": {
"@adobe/css-tools": "^4.0.1",
@ -13461,9 +13465,9 @@
"dev": true
},
"@total-typescript/shoehorn": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.0.tgz",
"integrity": "sha512-XKig6hXxWnUh0fsW3LR2vxpxwLlPFokfOSR0riHKA9uXvdHDfwOOPdAOi4U/YNKLmgYUu/plUfnF3yiAAz1+Zg==",
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@total-typescript/shoehorn/-/shoehorn-0.1.1.tgz",
"integrity": "sha512-XSPcazQsC2Cr7eCiAI+M2bTmMziBvFWYTYMgUDKLbU6i+7m3I2BF5gXF5vKDO8577fONs9CvmTvVa7+nMHMfxg==",
"dev": true
},
"@types/aria-query": {
@ -14351,7 +14355,9 @@
}
},
"chalk": {
"version": "5.2.0",
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz",
"integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==",
"dev": true
},
"chart.js": {

View file

@ -68,10 +68,10 @@
"devDependencies": {
"@shlinkio/eslint-config-js-coding-standard": "~2.2.0",
"@shlinkio/stylelint-config-css-coding-standard": "~1.1.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@total-typescript/shoehorn": "^0.1.0",
"@total-typescript/shoehorn": "^0.1.1",
"@types/json2csv": "^5.0.3",
"@types/leaflet": "^1.9.0",
"@types/qs": "^6.9.7",
@ -86,7 +86,7 @@
"@vitejs/plugin-react": "^4.0.4",
"@vitest/coverage-v8": "^0.34.1",
"adm-zip": "^0.5.10",
"chalk": "^5.2.0",
"chalk": "^5.3.0",
"eslint": "^8.46.0",
"jsdom": "^22.1.0",
"resize-observer-polyfill": "^1.5.1",

View file

@ -1,7 +1,6 @@
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '@shlinkio/shlink-frontend-kit';
import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from '@shlinkio/shlink-web-component';
import type { FC } from 'react';
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/src/short-urls/data';
import { DEFAULT_SHORT_URLS_ORDERING } from './reducers/settings';
interface ShortUrlsListSettingsProps {
@ -9,6 +8,14 @@ interface ShortUrlsListSettingsProps {
setShortUrlsListSettings: (settings: ShortUrlsSettings) => void;
}
const SHORT_URLS_ORDERABLE_FIELDS = {
dateCreated: 'Created at',
shortCode: 'Short URL',
longUrl: 'Long URL',
title: 'Title',
visits: 'Visits',
};
export const ShortUrlsListSettings: FC<ShortUrlsListSettingsProps> = (
{ settings: { shortUrlsList }, setShortUrlsListSettings },
) => (

View file

@ -1,7 +1,6 @@
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '@shlinkio/shlink-frontend-kit';
import type { Settings, TagsSettings as TagsSettingsOptions } from '@shlinkio/shlink-web-component';
import type { FC } from 'react';
import { TAGS_ORDERABLE_FIELDS } from '../../shlink-web-component/src/tags/data/TagsListChildrenProps';
import type { Defined } from '../utils/types';
export type TagsOrder = Defined<TagsSettingsOptions['defaultOrdering']>;
@ -11,6 +10,12 @@ interface TagsProps {
setTagsSettings: (settings: TagsSettingsOptions) => void;
}
const TAGS_ORDERABLE_FIELDS = {
tag: 'Tag',
shortUrls: 'Short URLs',
visits: 'Visits',
};
export const TagsSettings: FC<TagsProps> = ({ settings: { tags }, setTagsSettings }) => (
<SimpleCard title="Tags" className="h-100">
<LabeledFormGroup noMargin label="Default ordering for tags list:">