From d008235cf051ae12592bb7d845f342257530aed3 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Wed, 15 Feb 2023 14:08:09 +0100 Subject: [PATCH 1/2] AdminSeatInfo: Add component unit tests --- .../AdminSeatInfo/tests/index.test.js | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 packages/core/admin/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/tests/index.test.js diff --git a/packages/core/admin/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/tests/index.test.js b/packages/core/admin/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/tests/index.test.js new file mode 100644 index 0000000000..e5a9703795 --- /dev/null +++ b/packages/core/admin/ee/admin/pages/SettingsPage/pages/ApplicationInfosPage/components/AdminSeatInfo/tests/index.test.js @@ -0,0 +1,124 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import { IntlProvider } from 'react-intl'; +import { ThemeProvider, lightTheme } from '@strapi/design-system'; +import { useLicenseLimits } from '../../../../../../../hooks'; + +import AdminSeatInfo from '..'; + +const LICENSE_MOCK = { + license: { + data: { + enforcementUserCount: 10, + licenseLimitStatus: '', + permittedSeats: 100, + isHostedOnStrapiCloud: false, + }, + }, +}; + +const withMarkup = (query) => (text) => + query((content, node) => { + const hasText = (node) => node.textContent === text; + const childrenDontHaveText = Array.from(node.children).every((child) => !hasText(child)); + + return hasText(node) && childrenDontHaveText; + }); + +jest.mock('../../../../../../../hooks', () => ({ + ...jest.requireActual('../../../../../../../hooks'), + useLicenseLimits: jest.fn(), +})); + +const ComponentFixture = (props) => ( + + + + + +); + +function setup(props) { + return render(); +} + +describe('', () => { + beforeEach(() => { + jest.clearAllMocks(); + + useLicenseLimits.mockReturnValue(LICENSE_MOCK); + }); + + test('Do not render anything, when permittedSeats is falsy', () => { + useLicenseLimits.mockReturnValue({ + ...LICENSE_MOCK, + license: { + ...LICENSE_MOCK.license, + data: { + ...LICENSE_MOCK.license.data, + permittedSeats: null, + }, + }, + }); + + const { queryByText } = setup(); + + expect(queryByText('Admin seats')).not.toBeInTheDocument(); + }); + + test('Render seat info', () => { + const { getByText } = setup(); + const getByTextWithMarkup = withMarkup(getByText); + + expect(getByText('Admin seats')).toBeInTheDocument(); + expect(getByTextWithMarkup('10/100')).toBeInTheDocument(); + }); + + test('Render billing link (not on strapi cloud)', () => { + const { getByText } = setup(); + + expect(getByText('Contact sales')).toBeInTheDocument(); + expect(getByText('Contact sales').closest('a')).toHaveAttribute( + 'href', + 'https://share.hsforms.com/1WhxtbTkJSUmfqqEuv4pwuA43qp4' + ); + }); + + test('Render billing link (on strapi cloud)', () => { + useLicenseLimits.mockReturnValue({ + ...LICENSE_MOCK, + license: { + ...LICENSE_MOCK.license, + data: { + ...LICENSE_MOCK.license.data, + isHostedOnStrapiCloud: true, + }, + }, + }); + + const { getByText } = setup(); + + expect(getByText('Add seats')).toBeInTheDocument(); + expect(getByText('Add seats').closest('a')).toHaveAttribute( + 'href', + 'https://cloud.strapi.io/profile/billing' + ); + }); + + test('Render OVER_LIMIT icon', () => { + useLicenseLimits.mockReturnValue({ + ...LICENSE_MOCK, + license: { + ...LICENSE_MOCK.license, + data: { + ...LICENSE_MOCK.license.data, + licenseLimitStatus: 'OVER_LIMIT', + }, + }, + }); + + const { getByText } = setup(); + + expect(getByText('At limit: add seats to invite more users')).toBeInTheDocument(); + }); +}); From 4cb664dae17f0bbade7ee2373281170aa4ce7c95 Mon Sep 17 00:00:00 2001 From: Gustav Hansen Date: Wed, 15 Feb 2023 14:21:41 +0100 Subject: [PATCH 2/2] CreateAction: Add component unit tests --- .../Users/ListPage/CreateAction/index.js | 2 +- .../ListPage/CreateAction/tests/index.test.js | 36 + .../tests/__snapshots__/index.test.js.snap | 1335 ++++++++++++++++ .../pages/Users/ListPage/tests/index.test.js | 1340 +---------------- 4 files changed, 1375 insertions(+), 1338 deletions(-) create mode 100644 packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/tests/index.test.js create mode 100644 packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/tests/__snapshots__/index.test.js.snap diff --git a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js index cb8d3ef079..d2035c6647 100644 --- a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js +++ b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/CreateAction/index.js @@ -8,7 +8,7 @@ const CreateAction = ({ onClick }) => { const { formatMessage } = useIntl(); return ( - + +
+ +
+ + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + +
+
+
+ +
+ +
+
+
+ + + Firstname + + + + + + + +
+
+
+ + + + +
+
+
+ + + + +
+
+
+ + + Roles + + + +
+
+
+ + + + +
+
+
+ + + User status + + + +
+
+
+
+ Actions +
+ +
+
+
+
+
+
+ Loading content... +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+ +
+ + + +`; diff --git a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/tests/index.test.js b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/tests/index.test.js index 2e20bdb3d5..3c80733240 100644 --- a/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/tests/index.test.js +++ b/packages/core/admin/admin/src/pages/SettingsPage/pages/Users/ListPage/tests/index.test.js @@ -78,1339 +78,7 @@ describe('ADMIN | Pages | USERS | ListPage', () => { const { container } = render(app); - expect(container.firstChild).toMatchInlineSnapshot(` - .c15 { - 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; - } - - .c41 { - -webkit-animation: gzYjWD 1s infinite linear; - animation: gzYjWD 1s infinite linear; - will-change: transform; - } - - .c2 { - background: #f6f6f9; - padding-top: 40px; - padding-right: 56px; - padding-bottom: 40px; - padding-left: 56px; - } - - .c8 { - padding-right: 56px; - padding-left: 56px; - } - - .c9 { - padding-bottom: 16px; - } - - .c16 { - color: #32324d; - } - - .c18 { - padding-top: 4px; - padding-bottom: 4px; - } - - .c20 { - padding-right: 8px; - } - - .c23 { - background: #ffffff; - border-radius: 4px; - box-shadow: 0px 1px 4px rgba(33,33,52,0.1); - } - - .c25 { - position: relative; - } - - .c27 { - padding-right: 24px; - padding-left: 24px; - } - - .c40 { - background: #ffffff; - padding: 64px; - } - - .c42 { - padding-top: 16px; - } - - .c49 { - padding-right: 16px; - padding-left: 16px; - } - - .c51 { - padding-left: 12px; - } - - .c54 { - padding-left: 8px; - } - - .c3 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - 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; - } - - .c4 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - } - - .c10 { - -webkit-align-items: flex-start; - -webkit-box-align: flex-start; - -ms-flex-align: flex-start; - align-items: flex-start; - 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; - } - - .c11 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-flex-wrap: wrap; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - } - - .c39 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - 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: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - } - - .c43 { - -webkit-align-items: flex-end; - -webkit-box-align: flex-end; - -ms-flex-align: flex-end; - align-items: flex-end; - 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; - } - - .c44 { - -webkit-align-items: stretch; - -webkit-box-align: stretch; - -ms-flex-align: stretch; - align-items: stretch; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } - - .c6 { - font-weight: 600; - font-size: 2rem; - line-height: 1.25; - color: #32324d; - } - - .c7 { - font-size: 1rem; - line-height: 1.5; - color: #666687; - } - - .c22 { - font-size: 0.75rem; - line-height: 1.33; - font-weight: 600; - color: #32324d; - } - - .c35 { - font-weight: 600; - font-size: 0.6875rem; - line-height: 1.45; - text-transform: uppercase; - color: #666687; - } - - .c50 { - font-size: 0.875rem; - line-height: 1.43; - display: block; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - color: #32324d; - } - - .c55 { - font-size: 0.875rem; - line-height: 1.43; - color: #666687; - } - - .c45 > * { - margin-top: 0; - margin-bottom: 0; - } - - .c13 { - 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; - } - - .c13 svg { - height: 12px; - width: 12px; - } - - .c13 svg > g, - .c13 svg path { - fill: #ffffff; - } - - .c13[aria-disabled='true'] { - pointer-events: none; - } - - .c13: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; - } - - .c13:focus-visible { - outline: none; - } - - .c13:focus-visible:after { - border-radius: 8px; - content: ''; - position: absolute; - top: -5px; - bottom: -5px; - left: -5px; - right: -5px; - border: 2px solid #4945ff; - } - - .c21 { - height: 100%; - } - - .c19 { - -webkit-align-items: center; - -webkit-box-align: center; - -ms-flex-align: center; - align-items: center; - background-color: #4945ff; - border: 1px solid #4945ff; - height: 2rem; - padding-left: 16px; - padding-right: 16px; - border: 1px solid #dcdce4; - background: #ffffff; - } - - .c19 .c1 { - 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; - } - - .c19 .c5 { - color: #ffffff; - } - - .c19[aria-disabled='true'] { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c19[aria-disabled='true'] .c5 { - color: #666687; - } - - .c19[aria-disabled='true'] svg > g,.c19[aria-disabled='true'] svg path { - fill: #666687; - } - - .c19[aria-disabled='true']:active { - border: 1px solid #dcdce4; - background: #eaeaef; - } - - .c19[aria-disabled='true']:active .c5 { - color: #666687; - } - - .c19[aria-disabled='true']:active svg > g,.c19[aria-disabled='true']:active svg path { - fill: #666687; - } - - .c19:hover { - background-color: #f6f6f9; - } - - .c19:active { - background-color: #eaeaef; - } - - .c19 .c5 { - color: #32324d; - } - - .c19 svg > g, - .c19 svg path { - fill: #32324d; - } - - .c24 { - overflow: hidden; - border: 1px solid #eaeaef; - } - - .c29 { - width: 100%; - white-space: nowrap; - } - - .c26:before { - background: linear-gradient(90deg,#c0c0cf 0%,rgba(0,0,0,0) 100%); - opacity: 0.2; - position: absolute; - height: 100%; - box-shadow: 0px 1px 4px rgba(33,33,52,0.1); - width: 8px; - left: 0; - } - - .c26:after { - background: linear-gradient(270deg,#c0c0cf 0%,rgba(0,0,0,0) 100%); - opacity: 0.2; - position: absolute; - height: 100%; - box-shadow: 0px 1px 4px rgba(33,33,52,0.1); - width: 8px; - right: 0; - top: 0; - } - - .c28 { - overflow-x: auto; - } - - .c38 tr:last-of-type { - border-bottom: none; - } - - .c30 { - border-bottom: 1px solid #eaeaef; - } - - .c31 { - border-bottom: 1px solid #eaeaef; - } - - .c31 td, - .c31 th { - padding: 16px; - } - - .c31 td:first-of-type, - .c31 th:first-of-type { - padding: 0 4px; - } - - .c31 th { - padding-top: 0; - padding-bottom: 0; - height: 3.5rem; - } - - .c32 { - vertical-align: middle; - text-align: left; - color: #666687; - outline-offset: -4px; - } - - .c32 input { - vertical-align: sub; - } - - .c34 svg { - height: 0.25rem; - } - - .c33 { - height: 18px; - min-width: 18px; - margin: 0; - border-radius: 4px; - border: 1px solid #c0c0cf; - -webkit-appearance: none; - background-color: #ffffff; - cursor: pointer; - } - - .c33:checked { - background-color: #4945ff; - border: 1px solid #4945ff; - } - - .c33: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%); - } - - .c33:checked:disabled:after { - background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iOCIgdmlld0JveD0iMCAwIDEwIDgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGgKICAgIGQ9Ik04LjU1MzIzIDAuMzk2OTczQzguNjMxMzUgMC4zMTYzNTUgOC43NjA1MSAwLjMxNTgxMSA4LjgzOTMxIDAuMzk1NzY4TDkuODYyNTYgMS40MzQwN0M5LjkzODkzIDEuNTExNTcgOS45MzkzNSAxLjYzNTkgOS44NjM0OSAxLjcxMzlMNC4wNjQwMSA3LjY3NzI0QzMuOTg1OSA3Ljc1NzU1IDMuODU3MDcgNy43NTgwNSAzLjc3ODM0IDcuNjc4MzRMMC4xMzg2NiAzLjk5MzMzQzAuMDYxNzc5OCAzLjkxNTQ5IDAuMDYxNzEwMiAzLjc5MDMyIDAuMTM4NTA0IDMuNzEyNEwxLjE2MjEzIDIuNjczNzJDMS4yNDAzOCAyLjU5NDMyIDEuMzY4NDMgMi41OTQyMiAxLjQ0NjggMi42NzM0OEwzLjkyMTc0IDUuMTc2NDdMOC41NTMyMyAwLjM5Njk3M1oiCiAgICBmaWxsPSIjOEU4RUE5IgogIC8+Cjwvc3ZnPg==) no-repeat no-repeat center center; - } - - .c33:disabled { - background-color: #dcdce4; - border: 1px solid #c0c0cf; - } - - .c33:indeterminate { - background-color: #4945ff; - border: 1px solid #4945ff; - } - - .c33: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%); - } - - .c33:indeterminate:disabled { - background-color: #dcdce4; - border: 1px solid #c0c0cf; - } - - .c33:indeterminate:disabled:after { - background-color: #8e8ea9; - } - - .c14 { - 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; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - height: 2rem; - width: 2rem; - } - - .c14 svg > g, - .c14 svg path { - fill: #8e8ea9; - } - - .c14:hover svg > g, - .c14:hover svg path { - fill: #666687; - } - - .c14:active svg > g, - .c14:active svg path { - fill: #a5a5ba; - } - - .c14[aria-disabled='true'] { - background-color: #eaeaef; - } - - .c14[aria-disabled='true'] svg path { - fill: #666687; - } - - .c36 { - 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; - -webkit-box-pack: center; - -webkit-justify-content: center; - -ms-flex-pack: center; - justify-content: center; - height: 2rem; - width: 2rem; - border: none; - } - - .c36 svg > g, - .c36 svg path { - fill: #8e8ea9; - } - - .c36:hover svg > g, - .c36:hover svg path { - fill: #666687; - } - - .c36:active svg > g, - .c36:active svg path { - fill: #a5a5ba; - } - - .c36[aria-disabled='true'] { - background-color: #eaeaef; - } - - .c36[aria-disabled='true'] svg path { - fill: #666687; - } - - .c37 { - -webkit-transform: rotate(0deg); - -ms-transform: rotate(0deg); - transform: rotate(0deg); - } - - .c47 { - position: absolute; - left: 0; - right: 0; - bottom: 0; - top: 0; - width: 100%; - background: transparent; - border: none; - } - - .c47:focus { - outline: none; - } - - .c47[aria-disabled='true'] { - cursor: not-allowed; - } - - .c46 { - position: relative; - border: 1px solid #dcdce4; - padding-right: 12px; - border-radius: 4px; - background: #ffffff; - overflow: hidden; - min-height: 2rem; - 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; - } - - .c46:focus-within { - border: 1px solid #4945ff; - box-shadow: #4945ff 0px 0px 0px 2px; - } - - .c52 { - background: transparent; - border: none; - position: relative; - z-index: 1; - } - - .c52 svg { - height: 0.6875rem; - width: 0.6875rem; - } - - .c52 svg path { - fill: #666687; - } - - .c53 { - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - background: none; - border: none; - } - - .c53 svg { - width: 0.375rem; - } - - .c48 { - width: 100%; - } - - .c17 path { - fill: #32324d; - } - - .c56 > * + * { - margin-left: 4px; - } - - .c57 { - padding: 12px; - border-radius: 4px; - -webkit-text-decoration: none; - text-decoration: none; - display: -webkit-box; - display: -webkit-flex; - display: -ms-flexbox; - display: flex; - position: relative; - outline: none; - } - - .c57: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; - } - - .c57:focus-visible { - outline: none; - } - - .c57:focus-visible:after { - border-radius: 8px; - content: ''; - position: absolute; - top: -5px; - bottom: -5px; - left: -5px; - right: -5px; - border: 2px solid #4945ff; - } - - .c58 { - font-size: 0.7rem; - pointer-events: none; - } - - .c58 svg path { - fill: #c0c0cf; - } - - .c58:focus svg path, - .c58:hover svg path { - fill: #c0c0cf; - } - - .c59 { - font-size: 0.7rem; - } - - .c59 svg path { - fill: #666687; - } - - .c59:focus svg path, - .c59:hover svg path { - fill: #4a4a6a; - } - - .c12 > * + * { - margin-left: 8px; - } - - .c0:focus-visible { - outline: none; - } - -
-
-
-
-
-

- Users -

-
-
-

- All the users who have access to the Strapi admin panel -

-
-
-
-
-
-
- - - -
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - -
-
-
- -
- -
-
-
- - - Firstname - - - - - - - -
-
-
- - - - -
-
-
- - - - -
-
-
- - - Roles - - - -
-
-
- - - - -
-
-
- - - User status - - - -
-
-
-
- Actions -
- -
-
-
-
-
-
- Loading content... -
- -
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
-
-
-
- -
-
- -
- - -
- `); + expect(container.firstChild).toMatchSnapshot(); }); it('should show a list of users', async () => { @@ -1437,10 +105,8 @@ describe('ADMIN | Pages | USERS | ListPage', () => { history.push('/settings/user?pageSize=10&page=1&sort=firstname'); const app = makeApp(history); - const { queryByTestId } = render(app); + const { queryByText } = render(app); - await waitFor(() => { - expect(queryByTestId('create-user-button')).not.toBeInTheDocument(); - }); + expect(queryByText('Invite new user')).not.toBeInTheDocument(); }); });