mirror of
https://github.com/strapi/strapi.git
synced 2025-12-10 22:44:39 +00:00
Merge branch 'typescript/telemetry' of github.com:strapi/strapi into typescript/telemetry
This commit is contained in:
commit
a9872a56a8
@ -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}`;
|
||||
|
||||
@ -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 = (
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<IntlProvider locale="en" messages={{}} textComponent="span">
|
||||
<Router history={history}>
|
||||
<GuidedTourHomepage />
|
||||
</Router>
|
||||
</IntlProvider>
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<IntlProvider locale="en" messages={{}} textComponent="span">
|
||||
<Router history={history}>
|
||||
<GuidedTourHomepage />
|
||||
</Router>
|
||||
</IntlProvider>
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
);
|
||||
|
||||
describe('GuidedTour Homepage', () => {
|
||||
|
||||
@ -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 = (
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<IntlProvider locale="en" messages={{}} defaultLocale="en" textComponent="span">
|
||||
<GuidedTourModal />
|
||||
</IntlProvider>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<IntlProvider locale="en" messages={{}} defaultLocale="en" textComponent="span">
|
||||
<GuidedTourModal />
|
||||
</IntlProvider>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</TrackingContext.Provider>
|
||||
);
|
||||
|
||||
describe('<GuidedTourModal />', () => {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -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({
|
||||
|
||||
@ -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 (
|
||||
<QueryClientProvider client={client}>
|
||||
<IntlProvider messages={{}} defaultLocale="en" textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/api-tokens">
|
||||
<ListView />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<IntlProvider messages={{}} defaultLocale="en" textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/api-tokens">
|
||||
<ListView />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
};
|
||||
|
||||
@ -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 => (
|
||||
<IntlProvider messages={{}} defaultLocale="en" textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<ListPage />
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<ListPage />
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</TrackingContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
<div>
|
||||
<div
|
||||
class="c0"
|
||||
@ -462,7 +462,7 @@ exports[`DynamicTable renders and matches the snapshot 1`] = `
|
||||
</div>
|
||||
<nav
|
||||
aria-label="pagination"
|
||||
class="sc-ljMRFG"
|
||||
class="sc-dMOJrz"
|
||||
>
|
||||
<ul
|
||||
class="c16 c17"
|
||||
|
||||
@ -4,23 +4,26 @@ import { IntlProvider } from 'react-intl';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { Router, Route } from 'react-router-dom';
|
||||
import { lightTheme, darkTheme } from '@strapi/design-system';
|
||||
import { TrackingContext } from '@strapi/helper-plugin';
|
||||
import Theme from '../../../../../../../components/Theme';
|
||||
import ThemeToggleProvider from '../../../../../../../components/ThemeToggleProvider';
|
||||
import PaginationFooter from '../index';
|
||||
|
||||
const makeApp = (history, pagination) => {
|
||||
return (
|
||||
<IntlProvider messages={{}} textComponent="span" locale="en" defaultLocale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/user">
|
||||
<PaginationFooter pagination={pagination} />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<IntlProvider messages={{}} textComponent="span" locale="en" defaultLocale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/user">
|
||||
<PaginationFooter pagination={pagination} />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
</TrackingContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -4,7 +4,7 @@ import { IntlProvider } from 'react-intl';
|
||||
import { Router, Route } from 'react-router-dom';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { createMemoryHistory } from 'history';
|
||||
import { useRBAC } from '@strapi/helper-plugin';
|
||||
import { useRBAC, TrackingContext } from '@strapi/helper-plugin';
|
||||
import { lightTheme, darkTheme } from '@strapi/design-system';
|
||||
import Theme from '../../../../../../components/Theme';
|
||||
import ThemeToggleProvider from '../../../../../../components/ThemeToggleProvider';
|
||||
@ -31,17 +31,19 @@ const client = new QueryClient({
|
||||
const makeApp = history => {
|
||||
return (
|
||||
<QueryClientProvider client={client}>
|
||||
<IntlProvider messages={{}} defaultLocale="en" textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/user">
|
||||
<ListPage />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<IntlProvider messages={{}} defaultLocale="en" textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/user">
|
||||
<ListPage />
|
||||
</Route>
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</IntlProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
};
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Router, Route } from 'react-router-dom';
|
||||
import { StrapiAppProvider, AppInfosContext } from '@strapi/helper-plugin';
|
||||
import { StrapiAppProvider, AppInfosContext, TrackingContext } from '@strapi/helper-plugin';
|
||||
import { render, screen, waitFor } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { createMemoryHistory } from 'history';
|
||||
@ -28,24 +28,26 @@ jest.mock('../pages/ApplicationInfosPage', () => () => <h1>App infos</h1>);
|
||||
|
||||
const makeApp = (history, settings) => (
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<AppInfosContext.Provider value={{ shouldUpdateStrapi: false }}>
|
||||
<StrapiAppProvider
|
||||
settings={settings}
|
||||
plugins={{}}
|
||||
getPlugin={jest.fn()}
|
||||
runHookParallel={jest.fn()}
|
||||
runHookWaterfall={jest.fn()}
|
||||
runHookSeries={jest.fn()}
|
||||
menu={[]}
|
||||
>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/:settingId" component={SettingsPage} />
|
||||
<Route path="/settings" component={SettingsPage} />
|
||||
</Router>
|
||||
</StrapiAppProvider>
|
||||
</AppInfosContext.Provider>
|
||||
</Theme>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<Theme>
|
||||
<AppInfosContext.Provider value={{ shouldUpdateStrapi: false }}>
|
||||
<StrapiAppProvider
|
||||
settings={settings}
|
||||
plugins={{}}
|
||||
getPlugin={jest.fn()}
|
||||
runHookParallel={jest.fn()}
|
||||
runHookWaterfall={jest.fn()}
|
||||
runHookSeries={jest.fn()}
|
||||
menu={[]}
|
||||
>
|
||||
<Router history={history}>
|
||||
<Route path="/settings/:settingId" component={SettingsPage} />
|
||||
<Route path="/settings" component={SettingsPage} />
|
||||
</Router>
|
||||
</StrapiAppProvider>
|
||||
</AppInfosContext.Provider>
|
||||
</Theme>
|
||||
</TrackingContext.Provider>
|
||||
</ThemeToggleProvider>
|
||||
);
|
||||
|
||||
|
||||
@ -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 '../../../../../../../../admin/src/hooks';
|
||||
|
||||
@ -33,13 +33,15 @@ jest.mock('../../../../../../../../admin/src/hooks', () => ({
|
||||
|
||||
const makeApp = history => (
|
||||
<IntlProvider messages={{}} textComponent="span" locale="en">
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<ListPage />
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeToggleProvider themes={{ light: lightTheme, dark: darkTheme }}>
|
||||
<Theme>
|
||||
<Router history={history}>
|
||||
<ListPage />
|
||||
</Router>
|
||||
</Theme>
|
||||
</ThemeToggleProvider>
|
||||
</TrackingContext.Provider>
|
||||
</IntlProvider>
|
||||
);
|
||||
|
||||
|
||||
@ -35,6 +35,7 @@ jest.mock('@strapi/helper-plugin', () => ({
|
||||
...jest.requireActual('@strapi/helper-plugin'),
|
||||
// eslint-disable-next-line
|
||||
CheckPermissions: ({ children }) => <div>{children}</div>,
|
||||
useTracking: jest.fn(() => ({ trackUsage: jest.fn() })),
|
||||
}));
|
||||
|
||||
const makeApp = () => {
|
||||
|
||||
@ -15,6 +15,7 @@ jest.mock('@strapi/helper-plugin', () => ({
|
||||
useRBAC: jest.fn(),
|
||||
useNotification: jest.fn(() => jest.fn()),
|
||||
useQueryParams: jest.fn(),
|
||||
useTracking: jest.fn(() => ({ trackUsage: jest.fn() })),
|
||||
}));
|
||||
|
||||
jest.mock('../../../utils/getTrad', () => x => x);
|
||||
|
||||
@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { NotificationsProvider } from '@strapi/helper-plugin';
|
||||
import { NotificationsProvider, TrackingContext } from '@strapi/helper-plugin';
|
||||
import { EditAssetDialog } from '../index';
|
||||
import en from '../../../translations/en.json';
|
||||
import { downloadFile } from '../../../utils/downloadFile';
|
||||
@ -96,13 +96,15 @@ const renderCompo = (
|
||||
) =>
|
||||
render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<NotificationsProvider toggleNotification={toggleNotification}>
|
||||
<IntlProvider locale="en" messages={messageForPlugin} defaultLocale="en">
|
||||
<EditAssetDialog asset={asset} onClose={jest.fn()} {...props} />
|
||||
</IntlProvider>
|
||||
</NotificationsProvider>
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: false, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<NotificationsProvider toggleNotification={toggleNotification}>
|
||||
<IntlProvider locale="en" messages={messageForPlugin} defaultLocale="en">
|
||||
<EditAssetDialog asset={asset} onClose={jest.fn()} {...props} />
|
||||
</IntlProvider>
|
||||
</NotificationsProvider>
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>,
|
||||
{ container: document.body }
|
||||
);
|
||||
|
||||
@ -9,7 +9,7 @@ import { render, screen, fireEvent } from '@testing-library/react';
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import { IntlProvider } from 'react-intl';
|
||||
import { QueryClient, QueryClientProvider } from 'react-query';
|
||||
import { NotificationsProvider } from '@strapi/helper-plugin';
|
||||
import { NotificationsProvider, TrackingContext } from '@strapi/helper-plugin';
|
||||
import { EditAssetDialog } from '../index';
|
||||
import en from '../../../translations/en.json';
|
||||
import { downloadFile } from '../../../utils/downloadFile';
|
||||
@ -98,13 +98,21 @@ const queryClient = new QueryClient({
|
||||
const renderCompo = (toggleNotification = jest.fn()) =>
|
||||
render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<NotificationsProvider toggleNotification={toggleNotification}>
|
||||
<IntlProvider locale="en" messages={messageForPlugin} defaultLocale="en">
|
||||
<EditAssetDialog asset={asset} onClose={jest.fn()} canUpdate canCopyLink canDownload />
|
||||
</IntlProvider>
|
||||
</NotificationsProvider>
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: false, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<NotificationsProvider toggleNotification={toggleNotification}>
|
||||
<IntlProvider locale="en" messages={messageForPlugin} defaultLocale="en">
|
||||
<EditAssetDialog
|
||||
asset={asset}
|
||||
onClose={jest.fn()}
|
||||
canUpdate
|
||||
canCopyLink
|
||||
canDownload
|
||||
/>
|
||||
</IntlProvider>
|
||||
</NotificationsProvider>
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>,
|
||||
{ container: document.body }
|
||||
);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import React from 'react';
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import { render as renderTL } from '@testing-library/react';
|
||||
import { TrackingContext } from '@strapi/helper-plugin';
|
||||
import { FromComputerForm } from '../FromComputerForm';
|
||||
import en from '../../../../translations/en.json';
|
||||
|
||||
@ -13,9 +14,11 @@ jest.mock('react-intl', () => ({
|
||||
describe('FromComputerForm', () => {
|
||||
it('snapshots the component', async () => {
|
||||
const { container } = renderTL(
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<FromComputerForm onClose={jest.fn()} onAddAssets={jest.fn()} />
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<FromComputerForm onClose={jest.fn()} onAddAssets={jest.fn()} />
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
);
|
||||
|
||||
expect(container).toMatchInlineSnapshot(`
|
||||
@ -67,45 +70,6 @@ describe('FromComputerForm', () => {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.c3 {
|
||||
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;
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.c4 {
|
||||
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;
|
||||
}
|
||||
|
||||
.c8 {
|
||||
color: #666687;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.c15 {
|
||||
font-weight: 600;
|
||||
color: #32324d;
|
||||
@ -183,7 +147,7 @@ describe('FromComputerForm', () => {
|
||||
background: #4945ff;
|
||||
}
|
||||
|
||||
.c13 .sc-hJhJFJ {
|
||||
.c13 .sc-DtmNo {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
@ -253,7 +217,7 @@ describe('FromComputerForm', () => {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.c21 .sc-hJhJFJ {
|
||||
.c21 .sc-DtmNo {
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
@ -313,6 +277,45 @@ describe('FromComputerForm', () => {
|
||||
fill: #32324d;
|
||||
}
|
||||
|
||||
.c3 {
|
||||
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;
|
||||
-webkit-align-items: center;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.c4 {
|
||||
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;
|
||||
}
|
||||
|
||||
.c8 {
|
||||
color: #666687;
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.c16 {
|
||||
background: #f6f6f9;
|
||||
padding-top: 16px;
|
||||
|
||||
@ -2,6 +2,7 @@ import React from 'react';
|
||||
import { render as renderTL, fireEvent, screen, waitFor, within } from '@testing-library/react';
|
||||
import { ThemeProvider, lightTheme } from '@strapi/design-system';
|
||||
import { QueryClientProvider, QueryClient } from 'react-query';
|
||||
import { TrackingContext } from '@strapi/helper-plugin';
|
||||
import en from '../../../translations/en.json';
|
||||
import { UploadAssetDialog } from '../UploadAssetDialog';
|
||||
import { server } from './server';
|
||||
@ -23,9 +24,11 @@ const queryClient = new QueryClient({
|
||||
const render = (props = { onClose: () => {} }) =>
|
||||
renderTL(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<UploadAssetDialog {...props} />
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: false, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<UploadAssetDialog {...props} />
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>,
|
||||
{ container: document.body }
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -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(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<MemoryRouter>
|
||||
<MediaLibrary />
|
||||
</MemoryRouter>
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: false, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<MemoryRouter>
|
||||
<MediaLibrary />
|
||||
</MemoryRouter>
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
</QueryClientProvider>
|
||||
);
|
||||
|
||||
|
||||
@ -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({
|
||||
|
||||
@ -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() })),
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@ -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 => (
|
||||
<Router history={history}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<QueryClientProvider client={client}>
|
||||
<IntlProvider locale="en" messages={{}} textComponent="span">
|
||||
<RoleListPage />
|
||||
</IntlProvider>
|
||||
</QueryClientProvider>
|
||||
</ThemeProvider>
|
||||
<TrackingContext.Provider value={{ uuid: null, telemetryProperties: undefined }}>
|
||||
<ThemeProvider theme={lightTheme}>
|
||||
<QueryClientProvider client={client}>
|
||||
<IntlProvider locale="en" messages={{}} textComponent="span">
|
||||
<RoleListPage />
|
||||
</IntlProvider>
|
||||
</QueryClientProvider>
|
||||
</ThemeProvider>
|
||||
</TrackingContext.Provider>
|
||||
</Router>
|
||||
);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user