From 9a052ee87616b6b2a3690990865a23c0d75ea1f6 Mon Sep 17 00:00:00 2001 From: soupette Date: Wed, 13 Apr 2022 17:15:16 +0200 Subject: [PATCH] Fix tests Signed-off-by: soupette --- packages/admin-test-utils/lib/setup/strapi.js | 2 + .../GuidedTour/Homepage/tests/index.test.js | 18 +- .../GuidedTour/Modal/tests/index.test.js | 18 +- .../tests/__snapshots__/index.test.js.snap | 1176 +++++++++++++++ .../components/Register/tests/index.test.js | 1200 +-------------- .../src/pages/ProfilePage/tests/index.test.js | 1 + .../ApiTokens/ListView/tests/index.test.js | 26 +- .../pages/Roles/ListPage/tests/index.test.js | 18 +- .../tests/__snapshots__/index.test.js.snap | 26 +- .../PaginationFooter/tests/index.test.js | 25 +- .../pages/Users/ListPage/tests/index.test.js | 26 +- .../pages/SettingsPage/tests/index.test.js | 40 +- .../pages/Roles/ListPage/tests/index.test.js | 18 +- .../src/pages/ListView/tests/index.test.js | 1 + .../AssetDialog/tests/AssetDialog.test.js | 1 + .../tests/EditAssetDialog.test.js | 18 +- .../EditAssetDialog/tests/index.test.js | 24 +- .../tests/FromComputerForm.test.js | 91 +- .../tests/UploadAssetDialog.test.js | 9 +- .../UploadAssetDialog.test.js.snap | 1324 ++++++++--------- .../src/pages/App/tests/MediaLibrary.test.js | 14 +- .../pages/EmailTemplates/tests/index.test.js | 6 +- .../Roles/CreatePage/tests/index.test.js | 1 + .../pages/Roles/ListPage/tests/index.test.js | 19 +- 24 files changed, 2075 insertions(+), 2027 deletions(-) create mode 100644 packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/__snapshots__/index.test.js.snap diff --git a/packages/admin-test-utils/lib/setup/strapi.js b/packages/admin-test-utils/lib/setup/strapi.js index a6421d14cf..b2139b8cec 100644 --- a/packages/admin-test-utils/lib/setup/strapi.js +++ b/packages/admin-test-utils/lib/setup/strapi.js @@ -23,6 +23,8 @@ global.strapi = { projectType: 'Community', }; +// console.error = jest.fn(); + global.prompt = jest.fn(); global.URL.createObjectURL = file => `http://localhost:4000/assets/${file.name}`; diff --git a/packages/core/admin/admin/src/components/GuidedTour/Homepage/tests/index.test.js b/packages/core/admin/admin/src/components/GuidedTour/Homepage/tests/index.test.js index 28c2893938..4c3ab290c1 100644 --- a/packages/core/admin/admin/src/components/GuidedTour/Homepage/tests/index.test.js +++ b/packages/core/admin/admin/src/components/GuidedTour/Homepage/tests/index.test.js @@ -3,7 +3,7 @@ import { render, screen } from '@testing-library/react'; import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; import { IntlProvider } from 'react-intl'; -import { useGuidedTour } from '@strapi/helper-plugin'; +import { useGuidedTour, TrackingContext } from '@strapi/helper-plugin'; import { ThemeProvider, lightTheme } from '@strapi/design-system'; import GuidedTourHomepage from '../index'; @@ -31,13 +31,15 @@ jest.mock('@strapi/helper-plugin', () => ({ const history = createMemoryHistory(); const App = ( - - - - - - - + + + + + + + + + ); describe('GuidedTour Homepage', () => { diff --git a/packages/core/admin/admin/src/components/GuidedTour/Modal/tests/index.test.js b/packages/core/admin/admin/src/components/GuidedTour/Modal/tests/index.test.js index acd476218a..f87326b9d0 100644 --- a/packages/core/admin/admin/src/components/GuidedTour/Modal/tests/index.test.js +++ b/packages/core/admin/admin/src/components/GuidedTour/Modal/tests/index.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; import { IntlProvider } from 'react-intl'; -import { useGuidedTour } from '@strapi/helper-plugin'; +import { useGuidedTour, TrackingContext } from '@strapi/helper-plugin'; import { lightTheme, darkTheme } from '@strapi/design-system'; import Theme from '../../../Theme'; import ThemeToggleProvider from '../../../ThemeToggleProvider'; @@ -30,13 +30,15 @@ jest.mock('@strapi/helper-plugin', () => ({ })); const App = ( - - - - - - - + + + + + + + + + ); describe('', () => { diff --git a/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/__snapshots__/index.test.js.snap b/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/__snapshots__/index.test.js.snap new file mode 100644 index 0000000000..d71d36157e --- /dev/null +++ b/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/__snapshots__/index.test.js.snap @@ -0,0 +1,1176 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ADMIN | PAGES | AUTH | Register should render and match the snapshot 1`] = ` +.c1 { + padding-top: 24px; + padding-right: 40px; +} + +.c9 { + padding-top: 8px; + padding-bottom: 64px; +} + +.c10 { + background: #ffffff; + padding-top: 48px; + padding-right: 56px; + padding-bottom: 48px; + padding-left: 56px; + border-radius: 4px; + box-shadow: 0px 1px 4px rgba(33,33,52,0.1); +} + +.c16 { + padding-top: 24px; + padding-bottom: 4px; +} + +.c18 { + padding-bottom: 32px; +} + +.c47 { + font-weight: 600; + color: #32324d; + font-size: 0.875rem; + line-height: 1.43; +} + +.c44 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + cursor: pointer; + padding: 8px; + border-radius: 4px; + background: #ffffff; + border: 1px solid #dcdce4; + position: relative; + outline: none; +} + +.c44 svg { + height: 12px; + width: 12px; +} + +.c44 svg > g, +.c44 svg path { + fill: #ffffff; +} + +.c44[aria-disabled='true'] { + pointer-events: none; +} + +.c44:after { + -webkit-transition-property: all; + transition-property: all; + -webkit-transition-duration: 0.2s; + transition-duration: 0.2s; + border-radius: 8px; + content: ''; + position: absolute; + top: -4px; + bottom: -4px; + left: -4px; + right: -4px; + border: 2px solid transparent; +} + +.c44:focus-visible { + outline: none; +} + +.c44:focus-visible:after { + border-radius: 8px; + content: ''; + position: absolute; + top: -5px; + bottom: -5px; + left: -5px; + right: -5px; + border: 2px solid #4945ff; +} + +.c45 { + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 10px 16px; + background: #4945ff; + border: none; + border: 1px solid #4945ff; + background: #4945ff; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-box-pack: center; + -webkit-justify-content: center; + -ms-flex-pack: center; + justify-content: center; + width: 100%; +} + +.c45 .sc-eCImPb { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c45 .c46 { + color: #ffffff; +} + +.c45[aria-disabled='true'] { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c45[aria-disabled='true'] .c46 { + color: #666687; +} + +.c45[aria-disabled='true'] svg > g, +.c45[aria-disabled='true'] svg path { + fill: #666687; +} + +.c45[aria-disabled='true']:active { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c45[aria-disabled='true']:active .c46 { + color: #666687; +} + +.c45[aria-disabled='true']:active svg > g, +.c45[aria-disabled='true']:active svg path { + fill: #666687; +} + +.c45:hover { + border: 1px solid #7b79ff; + background: #7b79ff; +} + +.c45:active { + border: 1px solid #4945ff; + background: #4945ff; +} + +.c45 svg > g, +.c45 svg path { + fill: #ffffff; +} + +.c41 { + margin: 0; + height: 18px; + min-width: 18px; + border-radius: 4px; + border: 1px solid #c0c0cf; + -webkit-appearance: none; + background-color: #ffffff; + cursor: pointer; +} + +.c41:checked { + background-color: #4945ff; + border: 1px solid #4945ff; +} + +.c41:checked:after { + content: ''; + display: block; + position: relative; + background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGQ9Ik04LjU1MzIzIDAuMzk2OTczQzguNjMxMzUgMC4zMTYzNTUgOC43NjA1MSAwLjMxNTgxMSA4LjgzOTMxIDAuMzk1NzY4TDkuODYyNTYgMS40MzQwN0M5LjkzODkzIDEuNTExNTcgOS45MzkzNSAxLjYzNTkgOS44NjM0OSAxLjcxMzlMNC4wNjQwMSA3LjY3NzI0QzMuOTg1OSA3Ljc1NzU1IDMuODU3MDcgNy43NTgwNSAzLjc3ODM0IDcuNjc4MzRMMC4xMzg2NiAzLjk5MzMzQzAuMDYxNzc5OCAzLjkxNTQ5IDAuMDYxNzEwMiAzLjc5MDMyIDAuMTM4NTA0IDMuNzEyNEwxLjE2MjEzIDIuNjczNzJDMS4yNDAzOCAyLjU5NDMyIDEuMzY4NDMgMi41OTQyMiAxLjQ0NjggMi42NzM0OEwzLjkyMTc0IDUuMTc2NDdMOC41NTMyMyAwLjM5Njk3M1oiCiAgICBmaWxsPSJ3aGl0ZSIKICAvPgo8L3N2Zz4=) no-repeat no-repeat center center; + width: 10px; + height: 10px; + left: 50%; + top: 50%; + -webkit-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} + +.c41:checked:disabled:after { + background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGQ9Ik04LjU1MzIzIDAuMzk2OTczQzguNjMxMzUgMC4zMTYzNTUgOC43NjA1MSAwLjMxNTgxMSA4LjgzOTMxIDAuMzk1NzY4TDkuODYyNTYgMS40MzQwN0M5LjkzODkzIDEuNTExNTcgOS45MzkzNSAxLjYzNTkgOS44NjM0OSAxLjcxMzlMNC4wNjQwMSA3LjY3NzI0QzMuOTg1OSA3Ljc1NzU1IDMuODU3MDcgNy43NTgwNSAzLjc3ODM0IDcuNjc4MzRMMC4xMzg2NiAzLjk5MzMzQzAuMDYxNzc5OCAzLjkxNTQ5IDAuMDYxNzEwMiAzLjc5MDMyIDAuMTM4NTA0IDMuNzEyNEwxLjE2MjEzIDIuNjczNzJDMS4yNDAzOCAyLjU5NDMyIDEuMzY4NDMgMi41OTQyMiAxLjQ0NjggMi42NzM0OEwzLjkyMTc0IDUuMTc2NDdMOC41NTMyMyAwLjM5Njk3M1oiCiAgICBmaWxsPSIjOEU4RUE5IgogIC8+Cjwvc3ZnPg==) no-repeat no-repeat center center; +} + +.c41:disabled { + background-color: #dcdce4; + border: 1px solid #c0c0cf; +} + +.c41:indeterminate { + background-color: #4945ff; + border: 1px solid #4945ff; +} + +.c41:indeterminate:after { + content: ''; + display: block; + position: relative; + color: white; + height: 2px; + width: 10px; + background-color: #ffffff; + left: 50%; + top: 50%; + -webkit-transform: translateX(-50%) translateY(-50%); + -ms-transform: translateX(-50%) translateY(-50%); + transform: translateX(-50%) translateY(-50%); +} + +.c41:indeterminate:disabled { + background-color: #dcdce4; + border: 1px solid #c0c0cf; +} + +.c41:indeterminate:disabled:after { + background-color: #8e8ea9; +} + +.c42 { + padding-left: 8px; +} + +.c38 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.c38 > * { + margin-top: 0; + margin-bottom: 0; +} + +.c38 > * + * { + margin-top: 4px; +} + +.c39 { + color: #32324d; + font-size: 0.875rem; + line-height: 1.43; +} + +.c40 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: flex-start; + -webkit-box-align: flex-start; + -ms-flex-align: flex-start; + align-items: flex-start; +} + +.c40 * { + cursor: pointer; +} + +.c35 { + border: none; + background: transparent; + font-size: 1.6rem; + width: auto; + padding: 0; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c0 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: end; + -webkit-justify-content: flex-end; + -ms-flex-pack: end; + justify-content: flex-end; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c13 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c21 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.c21 > * { + margin-top: 0; + margin-bottom: 0; +} + +.c21 > * + * { + margin-top: 24px; +} + +.c34 { + padding-right: 12px; + padding-left: 8px; +} + +.c26 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c29 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-box-pack: justify; + -webkit-justify-content: space-between; + -ms-flex-pack: justify; + justify-content: space-between; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c25 { + font-weight: 600; + color: #32324d; + font-size: 0.75rem; + line-height: 1.33; +} + +.c27 { + color: #d02b20; + font-size: 0.875rem; + line-height: 1.43; +} + +.c37 { + color: #666687; + font-size: 0.75rem; + line-height: 1.33; +} + +.c28 { + line-height: 0; +} + +.c31 { + border: none; + border-radius: 4px; + padding-left: 16px; + padding-right: 16px; + color: #32324d; + font-weight: 400; + font-size: 0.875rem; + display: block; + width: 100%; + background: inherit; +} + +.c31::-webkit-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c31::-moz-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c31:-ms-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c31::placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c31[aria-disabled='true'] { + color: inherit; +} + +.c31:focus { + outline: none; + box-shadow: none; +} + +.c32 { + border: none; + border-radius: 4px; + padding-left: 16px; + padding-right: 0; + color: #32324d; + font-weight: 400; + font-size: 0.875rem; + display: block; + width: 100%; + background: inherit; +} + +.c32::-webkit-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c32::-moz-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c32:-ms-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c32::placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c32[aria-disabled='true'] { + color: inherit; +} + +.c32:focus { + outline: none; + box-shadow: none; +} + +.c30 { + border: 1px solid #dcdce4; + border-radius: 4px; + background: #ffffff; + height: 2.5rem; + outline: none; + box-shadow: 0; + -webkit-transition-property: border-color,box-shadow,fill; + transition-property: border-color,box-shadow,fill; + -webkit-transition-duration: 0.2s; + transition-duration: 0.2s; +} + +.c30:focus-within { + border: 1px solid #4945ff; + box-shadow: #4945ff 0px 0px 0px 2px; +} + +.c24 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.c24 > * { + margin-top: 0; + margin-bottom: 0; +} + +.c24 > * + * { + margin-top: 4px; +} + +.c17 { + color: #32324d; + font-weight: 600; + font-size: 2rem; + line-height: 1.25; +} + +.c20 { + color: #666687; + font-size: 1rem; + line-height: 1.5; +} + +.c12:focus-visible { + outline: none; +} + +.c22 { + display: grid; + grid-template-columns: repeat(12,1fr); + gap: 16px; +} + +.c23 { + grid-column: span 6; + max-width: 100%; +} + +.c5 { + font-weight: 600; + color: #32324d; + font-size: 0.75rem; + line-height: 1.33; +} + +.c7 { + padding-left: 8px; +} + +.c2 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + cursor: pointer; + padding: 8px; + border-radius: 4px; + background: #ffffff; + border: 1px solid #dcdce4; + position: relative; + outline: none; +} + +.c2 svg { + height: 12px; + width: 12px; +} + +.c2 svg > g, +.c2 svg path { + fill: #ffffff; +} + +.c2[aria-disabled='true'] { + pointer-events: none; +} + +.c2:after { + -webkit-transition-property: all; + transition-property: all; + -webkit-transition-duration: 0.2s; + transition-duration: 0.2s; + border-radius: 8px; + content: ''; + position: absolute; + top: -4px; + bottom: -4px; + left: -4px; + right: -4px; + border: 2px solid transparent; +} + +.c2:focus-visible { + outline: none; +} + +.c2:focus-visible:after { + border-radius: 8px; + content: ''; + position: absolute; + top: -5px; + bottom: -5px; + left: -5px; + right: -5px; + border: 2px solid #4945ff; +} + +.c3 { + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 8px 16px; + background: #4945ff; + border: none; + border: 1px solid transparent; + background: transparent; +} + +.c3 .c6 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c3 .c4 { + color: #ffffff; +} + +.c3[aria-disabled='true'] { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c3[aria-disabled='true'] .c4 { + color: #666687; +} + +.c3[aria-disabled='true'] svg > g, +.c3[aria-disabled='true'] svg path { + fill: #666687; +} + +.c3[aria-disabled='true']:active { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c3[aria-disabled='true']:active .c4 { + color: #666687; +} + +.c3[aria-disabled='true']:active svg > g, +.c3[aria-disabled='true']:active svg path { + fill: #666687; +} + +.c3:hover { + background-color: #f6f6f9; +} + +.c3:active { + border: 1px solid undefined; + background: undefined; +} + +.c3 .c4 { + color: #32324d; +} + +.c3 svg > g, +.c3 svg path { + fill: #8e8ea9; +} + +.c8 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c8 svg { + height: 4px; + width: 6px; +} + +.c11 { + margin: 0 auto; + width: 552px; +} + +.c14 { + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.c15 { + height: 4.5rem; +} + +.c36 svg { + height: 1rem; + width: 1rem; +} + +.c36 svg path { + fill: #666687; +} + +.c19 { + text-align: center; +} + +.c43 { + color: #4945ff; +} + +.c33::-ms-reveal { + display: none; +} + +@media (max-width:68.75rem) { + .c23 { + grid-column: span; + } +} + +@media (max-width:34.375rem) { + .c23 { + grid-column: span; + } +} + +
+
+
+
+ +
+
+
+
+
+
+
+
+ +
+

+ Welcome to Strapi! +

+
+
+ + Credentials are only used to authenticate in Strapi. All saved data will be stored in your database. + +
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+ +
+ +
+
+

+ Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number +

+
+
+
+
+
+
+ +
+ +
+ +
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+`; diff --git a/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/index.test.js b/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/index.test.js index d03ca88ca5..502c700b17 100644 --- a/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/index.test.js +++ b/packages/core/admin/admin/src/pages/AuthPage/components/Register/tests/index.test.js @@ -3,6 +3,7 @@ import { render } from '@testing-library/react'; import { ThemeProvider } from '@strapi/design-system/ThemeProvider'; import { lightTheme } from '@strapi/design-system/themes'; import { Router } from 'react-router-dom'; +import { TrackingContext } from '@strapi/helper-plugin'; import { createMemoryHistory } from 'history'; import * as yup from 'yup'; import { IntlProvider } from 'react-intl'; @@ -23,1193 +24,22 @@ describe('ADMIN | PAGES | AUTH | Register', () => { const history = createMemoryHistory(); const { container } = render( - - - {}} - schema={yup.object()} - /> - - + + + + {}} + schema={yup.object()} + /> + + + ); - expect(container.firstChild).toMatchInlineSnapshot(` - .c1 { - padding-top: 24px; - padding-right: 40px; - } - - .c9 { - padding-top: 8px; - padding-bottom: 64px; - } - - .c10 { - background: #ffffff; - padding-top: 48px; - padding-right: 56px; - padding-bottom: 48px; - padding-left: 56px; - border-radius: 4px; - box-shadow: 0px 1px 4px rgba(33,33,52,0.1); - } - - .c16 { - padding-top: 24px; - padding-bottom: 4px; - } - - .c18 { - padding-bottom: 32px; - } - - .c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - - .c21 > * { - margin-top: 0; - margin-bottom: 0; - } - - .c21 > * + * { - margin-top: 24px; - } - - .c12:focus-visible { - outline: none; - } - - .c0 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: end; - -webkit-justify-content: flex-end; - -ms-flex-pack: end; - justify-content: flex-end; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c13 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c47 { - font-weight: 600; - color: #32324d; - font-size: 0.875rem; - line-height: 1.43; - } - - .c44 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - cursor: pointer; - padding: 8px; - border-radius: 4px; - background: #ffffff; - border: 1px solid #dcdce4; - position: relative; - outline: none; - } - - .c44 svg { - height: 12px; - width: 12px; - } - - .c44 svg > g, - .c44 svg path { - fill: #ffffff; - } - - .c44[aria-disabled='true'] { - pointer-events: none; - } - - .c44:after { - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: 0.2s; - transition-duration: 0.2s; - border-radius: 8px; - content: ''; - position: absolute; - top: -4px; - bottom: -4px; - left: -4px; - right: -4px; - border: 2px solid transparent; - } - - .c44:focus-visible { - outline: none; - } - - .c44:focus-visible:after { - border-radius: 8px; - content: ''; - position: absolute; - top: -5px; - bottom: -5px; - left: -5px; - right: -5px; - border: 2px solid #4945ff; - } - - .c45 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding: 10px 16px; - background: #4945ff; - border: none; - border: 1px solid #4945ff; - background: #4945ff; - display: -webkit-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-flex; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - width: 100%; - } - - .c45 .sc-ksdxgE { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c45 .c46 { - color: #ffffff; - } - - .c45[aria-disabled='true'] { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c45[aria-disabled='true'] .c46 { - color: #666687; - } - - .c45[aria-disabled='true'] svg > g, - .c45[aria-disabled='true'] svg path { - fill: #666687; - } - - .c45[aria-disabled='true']:active { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c45[aria-disabled='true']:active .c46 { - color: #666687; - } - - .c45[aria-disabled='true']:active svg > g, - .c45[aria-disabled='true']:active svg path { - fill: #666687; - } - - .c45:hover { - border: 1px solid #7b79ff; - background: #7b79ff; - } - - .c45:active { - border: 1px solid #4945ff; - background: #4945ff; - } - - .c45 svg > g, - .c45 svg path { - fill: #ffffff; - } - - .c34 { - padding-right: 12px; - padding-left: 8px; - } - - .c26 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c29 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-pack: justify; - -webkit-justify-content: space-between; - -ms-flex-pack: justify; - justify-content: space-between; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c25 { - font-weight: 600; - color: #32324d; - font-size: 0.75rem; - line-height: 1.33; - } - - .c27 { - color: #d02b20; - font-size: 0.875rem; - line-height: 1.43; - } - - .c37 { - color: #666687; - font-size: 0.75rem; - line-height: 1.33; - } - - .c28 { - line-height: 0; - } - - .c31 { - border: none; - border-radius: 4px; - padding-left: 16px; - padding-right: 16px; - color: #32324d; - font-weight: 400; - font-size: 0.875rem; - display: block; - width: 100%; - background: inherit; - } - - .c31::-webkit-input-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c31::-moz-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c31:-ms-input-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c31::placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c31[aria-disabled='true'] { - color: inherit; - } - - .c31:focus { - outline: none; - box-shadow: none; - } - - .c32 { - border: none; - border-radius: 4px; - padding-left: 16px; - padding-right: 0; - color: #32324d; - font-weight: 400; - font-size: 0.875rem; - display: block; - width: 100%; - background: inherit; - } - - .c32::-webkit-input-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c32::-moz-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c32:-ms-input-placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c32::placeholder { - color: #8e8ea9; - opacity: 1; - } - - .c32[aria-disabled='true'] { - color: inherit; - } - - .c32:focus { - outline: none; - box-shadow: none; - } - - .c30 { - border: 1px solid #dcdce4; - border-radius: 4px; - background: #ffffff; - height: 2.5rem; - outline: none; - box-shadow: 0; - -webkit-transition-property: border-color,box-shadow,fill; - transition-property: border-color,box-shadow,fill; - -webkit-transition-duration: 0.2s; - transition-duration: 0.2s; - } - - .c30:focus-within { - border: 1px solid #4945ff; - box-shadow: #4945ff 0px 0px 0px 2px; - } - - .c24 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - - .c24 > * { - margin-top: 0; - margin-bottom: 0; - } - - .c24 > * + * { - margin-top: 4px; - } - - .c41 { - margin: 0; - height: 18px; - min-width: 18px; - border-radius: 4px; - border: 1px solid #c0c0cf; - -webkit-appearance: none; - background-color: #ffffff; - cursor: pointer; - } - - .c41:checked { - background-color: #4945ff; - border: 1px solid #4945ff; - } - - .c41:checked:after { - content: ''; - display: block; - position: relative; - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGQ9Ik04LjU1MzIzIDAuMzk2OTczQzguNjMxMzUgMC4zMTYzNTUgOC43NjA1MSAwLjMxNTgxMSA4LjgzOTMxIDAuMzk1NzY4TDkuODYyNTYgMS40MzQwN0M5LjkzODkzIDEuNTExNTcgOS45MzkzNSAxLjYzNTkgOS44NjM0OSAxLjcxMzlMNC4wNjQwMSA3LjY3NzI0QzMuOTg1OSA3Ljc1NzU1IDMuODU3MDcgNy43NTgwNSAzLjc3ODM0IDcuNjc4MzRMMC4xMzg2NiAzLjk5MzMzQzAuMDYxNzc5OCAzLjkxNTQ5IDAuMDYxNzEwMiAzLjc5MDMyIDAuMTM4NTA0IDMuNzEyNEwxLjE2MjEzIDIuNjczNzJDMS4yNDAzOCAyLjU5NDMyIDEuMzY4NDMgMi41OTQyMiAxLjQ0NjggMi42NzM0OEwzLjkyMTc0IDUuMTc2NDdMOC41NTMyMyAwLjM5Njk3M1oiCiAgICBmaWxsPSJ3aGl0ZSIKICAvPgo8L3N2Zz4=) no-repeat no-repeat center center; - width: 10px; - height: 10px; - left: 50%; - top: 50%; - -webkit-transform: translateX(-50%) translateY(-50%); - -ms-transform: translateX(-50%) translateY(-50%); - transform: translateX(-50%) translateY(-50%); - } - - .c41:checked:disabled:after { - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGQ9Ik04LjU1MzIzIDAuMzk2OTczQzguNjMxMzUgMC4zMTYzNTUgOC43NjA1MSAwLjMxNTgxMSA4LjgzOTMxIDAuMzk1NzY4TDkuODYyNTYgMS40MzQwN0M5LjkzODkzIDEuNTExNTcgOS45MzkzNSAxLjYzNTkgOS44NjM0OSAxLjcxMzlMNC4wNjQwMSA3LjY3NzI0QzMuOTg1OSA3Ljc1NzU1IDMuODU3MDcgNy43NTgwNSAzLjc3ODM0IDcuNjc4MzRMMC4xMzg2NiAzLjk5MzMzQzAuMDYxNzc5OCAzLjkxNTQ5IDAuMDYxNzEwMiAzLjc5MDMyIDAuMTM4NTA0IDMuNzEyNEwxLjE2MjEzIDIuNjczNzJDMS4yNDAzOCAyLjU5NDMyIDEuMzY4NDMgMi41OTQyMiAxLjQ0NjggMi42NzM0OEwzLjkyMTc0IDUuMTc2NDdMOC41NTMyMyAwLjM5Njk3M1oiCiAgICBmaWxsPSIjOEU4RUE5IgogIC8+Cjwvc3ZnPg==) no-repeat no-repeat center center; - } - - .c41:disabled { - background-color: #dcdce4; - border: 1px solid #c0c0cf; - } - - .c41:indeterminate { - background-color: #4945ff; - border: 1px solid #4945ff; - } - - .c41:indeterminate:after { - content: ''; - display: block; - position: relative; - color: white; - height: 2px; - width: 10px; - background-color: #ffffff; - left: 50%; - top: 50%; - -webkit-transform: translateX(-50%) translateY(-50%); - -ms-transform: translateX(-50%) translateY(-50%); - transform: translateX(-50%) translateY(-50%); - } - - .c41:indeterminate:disabled { - background-color: #dcdce4; - border: 1px solid #c0c0cf; - } - - .c41:indeterminate:disabled:after { - background-color: #8e8ea9; - } - - .c42 { - padding-left: 8px; - } - - .c38 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - - .c38 > * { - margin-top: 0; - margin-bottom: 0; - } - - .c38 > * + * { - margin-top: 4px; - } - - .c39 { - color: #32324d; - font-size: 0.875rem; - line-height: 1.43; - } - - .c40 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; - } - - .c40 * { - cursor: pointer; - } - - .c22 { - display: grid; - grid-template-columns: repeat(12,1fr); - gap: 16px; - } - - .c23 { - grid-column: span 6; - max-width: 100%; - } - - .c17 { - color: #32324d; - font-weight: 600; - font-size: 2rem; - line-height: 1.25; - } - - .c20 { - color: #666687; - font-size: 1rem; - line-height: 1.5; - } - - .c35 { - border: none; - background: transparent; - font-size: 1.6rem; - width: auto; - padding: 0; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c5 { - font-weight: 600; - color: #32324d; - font-size: 0.75rem; - line-height: 1.33; - } - - .c7 { - padding-left: 8px; - } - - .c2 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - cursor: pointer; - padding: 8px; - border-radius: 4px; - background: #ffffff; - border: 1px solid #dcdce4; - position: relative; - outline: none; - } - - .c2 svg { - height: 12px; - width: 12px; - } - - .c2 svg > g, - .c2 svg path { - fill: #ffffff; - } - - .c2[aria-disabled='true'] { - pointer-events: none; - } - - .c2:after { - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: 0.2s; - transition-duration: 0.2s; - border-radius: 8px; - content: ''; - position: absolute; - top: -4px; - bottom: -4px; - left: -4px; - right: -4px; - border: 2px solid transparent; - } - - .c2:focus-visible { - outline: none; - } - - .c2:focus-visible:after { - border-radius: 8px; - content: ''; - position: absolute; - top: -5px; - bottom: -5px; - left: -5px; - right: -5px; - border: 2px solid #4945ff; - } - - .c3 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding: 8px 16px; - background: #4945ff; - border: none; - border: 1px solid transparent; - background: transparent; - } - - .c3 .c6 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c3 .c4 { - color: #ffffff; - } - - .c3[aria-disabled='true'] { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c3[aria-disabled='true'] .c4 { - color: #666687; - } - - .c3[aria-disabled='true'] svg > g, - .c3[aria-disabled='true'] svg path { - fill: #666687; - } - - .c3[aria-disabled='true']:active { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c3[aria-disabled='true']:active .c4 { - color: #666687; - } - - .c3[aria-disabled='true']:active svg > g, - .c3[aria-disabled='true']:active svg path { - fill: #666687; - } - - .c3:hover { - background-color: #f6f6f9; - } - - .c3:active { - border: 1px solid undefined; - background: undefined; - } - - .c3 .c4 { - color: #32324d; - } - - .c3 svg > g, - .c3 svg path { - fill: #8e8ea9; - } - - .c8 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - } - - .c8 svg { - height: 4px; - width: 6px; - } - - .c11 { - margin: 0 auto; - width: 552px; - } - - .c14 { - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - - .c15 { - height: 4.5rem; - } - - .c36 svg { - height: 1rem; - width: 1rem; - } - - .c36 svg path { - fill: #666687; - } - - .c19 { - text-align: center; - } - - .c43 { - color: #4945ff; - } - - .c33::-ms-reveal { - display: none; - } - - @media (max-width:68.75rem) { - .c23 { - grid-column: span; - } - } - - @media (max-width:34.375rem) { - .c23 { - grid-column: span; - } - } - -
-
-
-
- -
-
-
-
-
-
-
-
- -
-

- Welcome to Strapi! -

-
-
- - Credentials are only used to authenticate in Strapi. All saved data will be stored in your database. - -
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
-
- -
- -
- -
-
-

- Must be at least 8 characters, 1 uppercase, 1 lowercase & 1 number -

-
-
-
-
-
-
- -
- -
- -
-
-
-
-
-
-
- -
-
- -
-
-
-
-
-
- `); + expect(container.firstChild).toMatchSnapshot(); }); }); diff --git a/packages/core/admin/admin/src/pages/ProfilePage/tests/index.test.js b/packages/core/admin/admin/src/pages/ProfilePage/tests/index.test.js index 66a8379cc5..c819af2a6b 100644 --- a/packages/core/admin/admin/src/pages/ProfilePage/tests/index.test.js +++ b/packages/core/admin/admin/src/pages/ProfilePage/tests/index.test.js @@ -20,6 +20,7 @@ jest.mock('@strapi/helper-plugin', () => ({ useFocusWhenNavigate: jest.fn(), useAppInfos: jest.fn(() => ({ setUserDisplayName: jest.fn() })), useOverlayBlocker: jest.fn(() => ({ lockApp: jest.fn, unlockApp: jest.fn() })), + useTracking: jest.fn(() => ({ trackUsage: jest.fn() })), })); const client = new QueryClient({ diff --git a/packages/core/admin/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/tests/index.test.js b/packages/core/admin/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/tests/index.test.js index 4db5f8446c..4de913c0da 100644 --- a/packages/core/admin/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/tests/index.test.js +++ b/packages/core/admin/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/tests/index.test.js @@ -3,7 +3,7 @@ import { render, waitFor } from '@testing-library/react'; import { IntlProvider } from 'react-intl'; import { Router, Route } from 'react-router-dom'; import { createMemoryHistory } from 'history'; -import { useRBAC } from '@strapi/helper-plugin'; +import { useRBAC, TrackingContext } from '@strapi/helper-plugin'; import { QueryClient, QueryClientProvider } from 'react-query'; import { lightTheme, darkTheme } from '@strapi/design-system'; import { axiosInstance } from '../../../../../../core/utils'; @@ -50,17 +50,19 @@ const client = new QueryClient({ const makeApp = history => { return ( - - - - - - - - - - - + + + + + + + + + + + + + ); }; diff --git a/packages/core/admin/admin/src/pages/SettingsPage/pages/Roles/ListPage/tests/index.test.js b/packages/core/admin/admin/src/pages/SettingsPage/pages/Roles/ListPage/tests/index.test.js index 10189c7ffa..1927f71ffa 100644 --- a/packages/core/admin/admin/src/pages/SettingsPage/pages/Roles/ListPage/tests/index.test.js +++ b/packages/core/admin/admin/src/pages/SettingsPage/pages/Roles/ListPage/tests/index.test.js @@ -9,7 +9,7 @@ import { render, screen } from '@testing-library/react'; import { createMemoryHistory } from 'history'; import { Router } from 'react-router-dom'; import { IntlProvider } from 'react-intl'; -import { useRBAC } from '@strapi/helper-plugin'; +import { useRBAC, TrackingContext } from '@strapi/helper-plugin'; import { lightTheme, darkTheme } from '@strapi/design-system'; import { useRolesList } from '../../../../../../hooks'; @@ -33,13 +33,15 @@ jest.mock('../../../../../../hooks', () => ({ const makeApp = history => ( - - - - - - - + + + + + + + + + ); diff --git a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/PaginationFooter/tests/__snapshots__/index.test.js.snap b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/PaginationFooter/tests/__snapshots__/index.test.js.snap index 20de14badf..582a3fce70 100644 --- a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/PaginationFooter/tests/__snapshots__/index.test.js.snap +++ b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/PaginationFooter/tests/__snapshots__/index.test.js.snap @@ -1,18 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`DynamicTable renders and matches the snapshot 1`] = ` -.c28 { - border: 0; - -webkit-clip: rect(0 0 0 0); - clip: rect(0 0 0 0); - height: 1px; - margin: -1px; - overflow: hidden; - padding: 0; - position: absolute; - width: 1px; -} - .c0 { padding-top: 16px; } @@ -376,6 +364,18 @@ exports[`DynamicTable renders and matches the snapshot 1`] = ` line-height: 1.43; } +.c28 { + border: 0; + -webkit-clip: rect(0 0 0 0); + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +
- .c1 { + .c9 { + padding-top: 24px; + padding-right: 40px; + padding-left: 40px; +} + +.c18 { + padding-top: 24px; + padding-right: 40px; + padding-bottom: 24px; + padding-left: 40px; +} + +.c32 { + font-weight: 600; + color: #32324d; + font-size: 0.75rem; + line-height: 1.33; +} + +.c29 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + cursor: pointer; + padding: 8px; + border-radius: 4px; + background: #ffffff; + border: 1px solid #dcdce4; + position: relative; + outline: none; +} + +.c29 svg { + height: 12px; + width: 12px; +} + +.c29 svg > g, +.c29 svg path { + fill: #ffffff; +} + +.c29[aria-disabled='true'] { + pointer-events: none; +} + +.c29:after { + -webkit-transition-property: all; + transition-property: all; + -webkit-transition-duration: 0.2s; + transition-duration: 0.2s; + border-radius: 8px; + content: ''; + position: absolute; + top: -4px; + bottom: -4px; + left: -4px; + right: -4px; + border: 2px solid transparent; +} + +.c29:focus-visible { + outline: none; +} + +.c29:focus-visible:after { + border-radius: 8px; + content: ''; + position: absolute; + top: -5px; + bottom: -5px; + left: -5px; + right: -5px; + border: 2px solid #4945ff; +} + +.c33 { + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 8px 16px; + background: #4945ff; + border: none; + border: 1px solid #4945ff; + background: #4945ff; +} + +.c33 .sc-DtmNo { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c33 .c31 { + color: #ffffff; +} + +.c33[aria-disabled='true'] { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c33[aria-disabled='true'] .c31 { + color: #666687; +} + +.c33[aria-disabled='true'] svg > g, +.c33[aria-disabled='true'] svg path { + fill: #666687; +} + +.c33[aria-disabled='true']:active { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c33[aria-disabled='true']:active .c31 { + color: #666687; +} + +.c33[aria-disabled='true']:active svg > g, +.c33[aria-disabled='true']:active svg path { + fill: #666687; +} + +.c33:hover { + border: 1px solid #7b79ff; + background: #7b79ff; +} + +.c33:active { + border: 1px solid #4945ff; + background: #4945ff; +} + +.c33 svg > g, +.c33 svg path { + fill: #ffffff; +} + +.c30 { + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + padding: 8px 16px; + background: #4945ff; + border: none; + border: 1px solid #dcdce4; + background: #ffffff; +} + +.c30 .sc-DtmNo { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c30 .c31 { + color: #ffffff; +} + +.c30[aria-disabled='true'] { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c30[aria-disabled='true'] .c31 { + color: #666687; +} + +.c30[aria-disabled='true'] svg > g, +.c30[aria-disabled='true'] svg path { + fill: #666687; +} + +.c30[aria-disabled='true']:active { + border: 1px solid #dcdce4; + background: #eaeaef; +} + +.c30[aria-disabled='true']:active .c31 { + color: #666687; +} + +.c30[aria-disabled='true']:active svg > g, +.c30[aria-disabled='true']:active svg path { + fill: #666687; +} + +.c30:hover { + background-color: #f6f6f9; +} + +.c30:active { + background-color: #eaeaef; +} + +.c30 .c31 { + color: #32324d; +} + +.c30 svg > g, +.c30 svg path { + fill: #32324d; +} + +.c21 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -ms-flex-direction: row; + flex-direction: row; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; +} + +.c22 { + font-weight: 600; + color: #32324d; + font-size: 0.75rem; + line-height: 1.33; +} + +.c25 { + color: #666687; + font-size: 0.75rem; + line-height: 1.33; +} + +.c23 { + border: 1px solid #dcdce4; + border-radius: 4px; + padding-left: 16px; + padding-right: 16px; + padding-top: 12px; + padding-bottom: 12px; + background: #ffffff; + outline: none; + box-shadow: 0; + -webkit-transition-property: border-color,box-shadow,fill; + transition-property: border-color,box-shadow,fill; + -webkit-transition-duration: 0.2s; + transition-duration: 0.2s; +} + +.c23:focus-within { + border: 1px solid #4945ff; + box-shadow: #4945ff 0px 0px 0px 2px; +} + +.c24 { + display: block; + width: 100%; + font-weight: 400; + font-size: 0.875rem; + border: none; + color: #32324d; + resize: none; + background: inherit; +} + +.c24::-webkit-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c24::-moz-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c24:-ms-input-placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c24::placeholder { + color: #8e8ea9; + opacity: 1; +} + +.c24:focus-within { + outline: none; +} + +.c20 { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.c20 > * { + margin-top: 0; + margin-bottom: 0; +} + +.c20 > * + * { + margin-top: 4px; +} + +.c19 textarea { + height: 5rem; + line-height: 1.25rem; +} + +.c19 textarea::-webkit-input-placeholder { + font-weight: 400; + font-size: 0.875rem; + line-height: 1.43; + color: #8e8ea9; + opacity: 1; +} + +.c19 textarea::-moz-placeholder { + font-weight: 400; + font-size: 0.875rem; + line-height: 1.43; + color: #8e8ea9; + opacity: 1; +} + +.c19 textarea:-ms-input-placeholder { + font-weight: 400; + font-size: 0.875rem; + line-height: 1.43; + color: #8e8ea9; + opacity: 1; +} + +.c19 textarea::placeholder { + font-weight: 400; + font-size: 0.875rem; + line-height: 1.43; + color: #8e8ea9; + opacity: 1; +} + +.c6 { + font-weight: 600; + color: #32324d; + font-size: 0.875rem; + line-height: 1.43; +} + +.c1 { background: #ffffff; border-radius: 4px; box-shadow: 0px 2px 15px rgba(33,33,52,0.1); @@ -1014,13 +1380,6 @@ exports[`UploadAssetDialog from url snapshots the component 1`] = ` margin-left: 8px; } -.c6 { - font-weight: 600; - color: #32324d; - font-size: 0.875rem; - line-height: 1.43; -} - .c16 { background: #eaeaef; } @@ -1031,19 +1390,6 @@ exports[`UploadAssetDialog from url snapshots the component 1`] = ` margin: 0; } -.c9 { - padding-top: 24px; - padding-right: 40px; - padding-left: 40px; -} - -.c18 { - padding-top: 24px; - padding-right: 40px; - padding-bottom: 24px; - padding-left: 40px; -} - .c15 { color: #4945ff; font-weight: 600; @@ -1076,352 +1422,6 @@ exports[`UploadAssetDialog from url snapshots the component 1`] = ` cursor: not-allowed; } -.c21 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c22 { - font-weight: 600; - color: #32324d; - font-size: 0.75rem; - line-height: 1.33; -} - -.c25 { - color: #666687; - font-size: 0.75rem; - line-height: 1.33; -} - -.c23 { - border: 1px solid #dcdce4; - border-radius: 4px; - padding-left: 16px; - padding-right: 16px; - padding-top: 12px; - padding-bottom: 12px; - background: #ffffff; - outline: none; - box-shadow: 0; - -webkit-transition-property: border-color,box-shadow,fill; - transition-property: border-color,box-shadow,fill; - -webkit-transition-duration: 0.2s; - transition-duration: 0.2s; -} - -.c23:focus-within { - border: 1px solid #4945ff; - box-shadow: #4945ff 0px 0px 0px 2px; -} - -.c24 { - display: block; - width: 100%; - font-weight: 400; - font-size: 0.875rem; - border: none; - color: #32324d; - resize: none; - background: inherit; -} - -.c24::-webkit-input-placeholder { - color: #8e8ea9; - opacity: 1; -} - -.c24::-moz-placeholder { - color: #8e8ea9; - opacity: 1; -} - -.c24:-ms-input-placeholder { - color: #8e8ea9; - opacity: 1; -} - -.c24::placeholder { - color: #8e8ea9; - opacity: 1; -} - -.c24:focus-within { - outline: none; -} - -.c20 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} - -.c20 > * { - margin-top: 0; - margin-bottom: 0; -} - -.c20 > * + * { - margin-top: 4px; -} - -.c19 textarea { - height: 5rem; - line-height: 1.25rem; -} - -.c19 textarea::-webkit-input-placeholder { - font-weight: 400; - font-size: 0.875rem; - line-height: 1.43; - color: #8e8ea9; - opacity: 1; -} - -.c19 textarea::-moz-placeholder { - font-weight: 400; - font-size: 0.875rem; - line-height: 1.43; - color: #8e8ea9; - opacity: 1; -} - -.c19 textarea:-ms-input-placeholder { - font-weight: 400; - font-size: 0.875rem; - line-height: 1.43; - color: #8e8ea9; - opacity: 1; -} - -.c19 textarea::placeholder { - font-weight: 400; - font-size: 0.875rem; - line-height: 1.43; - color: #8e8ea9; - opacity: 1; -} - -.c32 { - font-weight: 600; - color: #32324d; - font-size: 0.75rem; - line-height: 1.33; -} - -.c29 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - cursor: pointer; - padding: 8px; - border-radius: 4px; - background: #ffffff; - border: 1px solid #dcdce4; - position: relative; - outline: none; -} - -.c29 svg { - height: 12px; - width: 12px; -} - -.c29 svg > g, -.c29 svg path { - fill: #ffffff; -} - -.c29[aria-disabled='true'] { - pointer-events: none; -} - -.c29:after { - -webkit-transition-property: all; - transition-property: all; - -webkit-transition-duration: 0.2s; - transition-duration: 0.2s; - border-radius: 8px; - content: ''; - position: absolute; - top: -4px; - bottom: -4px; - left: -4px; - right: -4px; - border: 2px solid transparent; -} - -.c29:focus-visible { - outline: none; -} - -.c29:focus-visible:after { - border-radius: 8px; - content: ''; - position: absolute; - top: -5px; - bottom: -5px; - left: -5px; - right: -5px; - border: 2px solid #4945ff; -} - -.c33 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding: 8px 16px; - background: #4945ff; - border: none; - border: 1px solid #4945ff; - background: #4945ff; -} - -.c33 .sc-eJRTFu { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c33 .c31 { - color: #ffffff; -} - -.c33[aria-disabled='true'] { - border: 1px solid #dcdce4; - background: #eaeaef; -} - -.c33[aria-disabled='true'] .c31 { - color: #666687; -} - -.c33[aria-disabled='true'] svg > g, -.c33[aria-disabled='true'] svg path { - fill: #666687; -} - -.c33[aria-disabled='true']:active { - border: 1px solid #dcdce4; - background: #eaeaef; -} - -.c33[aria-disabled='true']:active .c31 { - color: #666687; -} - -.c33[aria-disabled='true']:active svg > g, -.c33[aria-disabled='true']:active svg path { - fill: #666687; -} - -.c33:hover { - border: 1px solid #7b79ff; - background: #7b79ff; -} - -.c33:active { - border: 1px solid #4945ff; - background: #4945ff; -} - -.c33 svg > g, -.c33 svg path { - fill: #ffffff; -} - -.c30 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - padding: 8px 16px; - background: #4945ff; - border: none; - border: 1px solid #dcdce4; - background: #ffffff; -} - -.c30 .sc-eJRTFu { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; -} - -.c30 .c31 { - color: #ffffff; -} - -.c30[aria-disabled='true'] { - border: 1px solid #dcdce4; - background: #eaeaef; -} - -.c30[aria-disabled='true'] .c31 { - color: #666687; -} - -.c30[aria-disabled='true'] svg > g, -.c30[aria-disabled='true'] svg path { - fill: #666687; -} - -.c30[aria-disabled='true']:active { - border: 1px solid #dcdce4; - background: #eaeaef; -} - -.c30[aria-disabled='true']:active .c31 { - color: #666687; -} - -.c30[aria-disabled='true']:active svg > g, -.c30[aria-disabled='true']:active svg path { - fill: #666687; -} - -.c30:hover { - background-color: #f6f6f9; -} - -.c30:active { - background-color: #eaeaef; -} - -.c30 .c31 { - color: #32324d; -} - -.c30 svg > g, -.c30 svg path { - fill: #32324d; -} -
diff --git a/packages/core/upload/admin/src/pages/App/tests/MediaLibrary.test.js b/packages/core/upload/admin/src/pages/App/tests/MediaLibrary.test.js index 801e911a31..a7a37bcd81 100644 --- a/packages/core/upload/admin/src/pages/App/tests/MediaLibrary.test.js +++ b/packages/core/upload/admin/src/pages/App/tests/MediaLibrary.test.js @@ -2,7 +2,7 @@ import React from 'react'; import { ThemeProvider, lightTheme } from '@strapi/design-system'; import { QueryClientProvider, QueryClient } from 'react-query'; import { render as renderTL, screen, waitFor, fireEvent } from '@testing-library/react'; -import { useRBAC, useQueryParams } from '@strapi/helper-plugin'; +import { useRBAC, useQueryParams, TrackingContext } from '@strapi/helper-plugin'; import { MemoryRouter } from 'react-router-dom'; import { rest } from 'msw'; import { MediaLibrary } from '../MediaLibrary'; @@ -38,11 +38,13 @@ const queryClient = new QueryClient({ const renderML = () => renderTL( - - - - - + + + + + + + ); diff --git a/packages/plugins/users-permissions/admin/src/pages/EmailTemplates/tests/index.test.js b/packages/plugins/users-permissions/admin/src/pages/EmailTemplates/tests/index.test.js index 6931a7a5cc..4e289463c6 100644 --- a/packages/plugins/users-permissions/admin/src/pages/EmailTemplates/tests/index.test.js +++ b/packages/plugins/users-permissions/admin/src/pages/EmailTemplates/tests/index.test.js @@ -14,9 +14,9 @@ jest.mock('@strapi/helper-plugin', () => ({ useOverlayBlocker: jest.fn(() => ({ lockApp: jest.fn, unlockApp: jest.fn() })), useRBAC: jest.fn(), CheckPagePermissions: ({ children }) => children, - // useTracking: jest.fn(() => ({ - // trackUsage: jest.fn() - // })) + useTracking: jest.fn(() => ({ + trackUsage: jest.fn(), + })), })); const client = new QueryClient({ diff --git a/packages/plugins/users-permissions/admin/src/pages/Roles/CreatePage/tests/index.test.js b/packages/plugins/users-permissions/admin/src/pages/Roles/CreatePage/tests/index.test.js index a0262b10e8..c8f610fb45 100644 --- a/packages/plugins/users-permissions/admin/src/pages/Roles/CreatePage/tests/index.test.js +++ b/packages/plugins/users-permissions/admin/src/pages/Roles/CreatePage/tests/index.test.js @@ -19,6 +19,7 @@ jest.mock('@strapi/helper-plugin', () => { ...jest.requireActual('@strapi/helper-plugin'), useNotification: mockUseNotification, useOverlayBlocker: jest.fn(() => ({ lockApp: jest.fn(), unlockApp: jest.fn() })), + useTracking: jest.fn(() => ({ trackUsage: jest.fn() })), }; }); diff --git a/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/tests/index.test.js b/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/tests/index.test.js index 1989d1e3d8..65edaf2745 100644 --- a/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/tests/index.test.js +++ b/packages/plugins/users-permissions/admin/src/pages/Roles/ListPage/tests/index.test.js @@ -3,7 +3,7 @@ import { render, screen, waitFor } from '@testing-library/react'; import { IntlProvider } from 'react-intl'; import { QueryClient, QueryClientProvider } from 'react-query'; import { ThemeProvider, lightTheme } from '@strapi/design-system'; -import { useRBAC } from '@strapi/helper-plugin'; +import { TrackingContext, useRBAC } from '@strapi/helper-plugin'; import { Router } from 'react-router-dom'; import { createMemoryHistory } from 'history'; @@ -12,7 +12,6 @@ import server from './server'; jest.mock('@strapi/helper-plugin', () => ({ ...jest.requireActual('@strapi/helper-plugin'), - useTracking: jest.fn(() => ({ trackUsage: jest.fn() })), useNotification: jest.fn(), useRBAC: jest.fn(), CheckPermissions: jest.fn(({ children }) => children), @@ -28,13 +27,15 @@ const client = new QueryClient({ const makeApp = history => ( - - - - - - - + + + + + + + + + );