From 5bce7b91f1e6fdfc1829c923dfcee6a163a6da2a Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 8 Aug 2023 11:24:19 +0200 Subject: [PATCH] Update testing library --- package-lock.json | 36 +++++++++++++++----------- package.json | 6 ++--- src/settings/ShortUrlsListSettings.tsx | 9 ++++++- src/settings/TagsSettings.tsx | 7 ++++- 4 files changed, 38 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index a760a593..d5683ce2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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": { diff --git a/package.json b/package.json index 2356928f..773e0384 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/settings/ShortUrlsListSettings.tsx b/src/settings/ShortUrlsListSettings.tsx index 5f5642bb..5ea84c94 100644 --- a/src/settings/ShortUrlsListSettings.tsx +++ b/src/settings/ShortUrlsListSettings.tsx @@ -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 = ( { settings: { shortUrlsList }, setShortUrlsListSettings }, ) => ( diff --git a/src/settings/TagsSettings.tsx b/src/settings/TagsSettings.tsx index de2827c7..025eaac5 100644 --- a/src/settings/TagsSettings.tsx +++ b/src/settings/TagsSettings.tsx @@ -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; @@ -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 = ({ settings: { tags }, setTagsSettings }) => (