Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyrillic #5745

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d86309c
Disable ripple effect
fzaninotto Nov 27, 2020
e46c682
Merge pull request #5598 from marmelab/improve-perfo-disableripple
djhi Nov 30, 2020
766997d
Upgrade "@testing-library/react" to v11.2.2
Luwangel Dec 16, 2020
cfe998d
Cleanup is automatically called in the new testing library version
Luwangel Dec 16, 2020
2850e63
Fix <Responsive> unit tests
Luwangel Dec 16, 2020
fd7fa4d
Fix <ReferenceField> unit tests
Luwangel Dec 16, 2020
5934893
Fix <AutocompleteInput> unit tests
Luwangel Dec 16, 2020
d0683ef
Fix <AutocompleteArrayInput> unit tests
Luwangel Dec 16, 2020
82408e6
Fix deprecated usage of waitForElement in unit tests
Luwangel Dec 16, 2020
a24ee8c
Fix <SingleFieldList> unit tests
Luwangel Dec 16, 2020
9dcb54f
Prevent an error when cleaning the <RichTextInput> input
Luwangel Dec 16, 2020
f2bcad1
Upgrade jest and ts-jest to v26.4.4
Luwangel Dec 16, 2020
e1e2b60
Merge pull request #5679 from marmelab/upgrade-test-dependencies
djhi Dec 16, 2020
5781f4a
Add container prop to SimpleForm
Dec 21, 2020
140876b
Renamed container prop to component
Dec 22, 2020
e392680
Add success to NotificationType type
Dec 22, 2020
1f22c38
Add success styling to Notification component
Dec 22, 2020
710c018
Added missing info styling to Notification component
Dec 22, 2020
8127a41
Fix warning type styling for Notification component
Dec 22, 2020
df3892d
Merge pull request #5710 from WiXSL/fix-notification-colors
fzaninotto Dec 23, 2020
6cbfa2b
Merge pull request #5703 from WiXSL/add-simplefor-container
fzaninotto Dec 23, 2020
87e0e55
Allow MenuItemLink to receive TooltipPops
Dec 23, 2020
69bd082
Change Notification's error color from dark to main
Dec 28, 2020
8b4029d
Merge pull request #5724 from WiXSL/fix-error-color
fzaninotto Jan 3, 2021
b355a9d
Merge pull request #5714 from WiXSL/allow-tooltip-props
fzaninotto Jan 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"devDependencies": {
"@types/fetch-mock": "^7.3.2",
"@types/classnames": "^2.2.9",
"@types/jest": "^24.0.23",
"@types/jest": "^26.0.19",
"@types/node": "^12.12.14",
"@types/query-string": "5.1.0",
"@types/react": "^16.9.13",
Expand Down
52 changes: 52 additions & 0 deletions examples/demo/src/layout/themes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,32 @@ export const darkTheme = {
backgroundColor: '#616161e6',
},
},
MuiButtonBase: {
root: {
'&:hover:active::after': {
// recreate a static ripple color
// use the currentColor to make it work both for outlined and contained buttons
// but to dim the background without dimming the text,
// put another element on top with a limited opacity
content: '""',
display: 'block',
width: '100%',
height: '100%',
position: 'absolute',
top: 0,
right: 0,
backgroundColor: 'currentColor',
opacity: 0.3,
borderRadius: 'inherit',
},
},
},
},
props: {
MuiButtonBase: {
// disable ripple for perf reasons
disableRipple: true,
},
},
};

Expand Down Expand Up @@ -62,6 +88,26 @@ export const lightTheme = {
boxShadow: 'none',
},
},
MuiButtonBase: {
root: {
'&:hover:active::after': {
// recreate a static ripple color
// use the currentColor to make it work both for outlined and contained buttons
// but to dim the background without dimming the text,
// put another element on top with a limited opacity
content: '""',
display: 'block',
width: '100%',
height: '100%',
position: 'absolute',
top: 0,
right: 0,
backgroundColor: 'currentColor',
opacity: 0.3,
borderRadius: 'inherit',
},
},
},
MuiAppBar: {
colorSecondary: {
color: '#808080',
Expand All @@ -85,4 +131,10 @@ export const lightTheme = {
},
},
},
props: {
MuiButtonBase: {
// disable ripple for perf reasons
disableRipple: true,
},
},
};
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
}
},
"devDependencies": {
"@types/jest": "^24.0.13",
"@types/jest": "^26.0.19",
"@types/react": "^16.9.0",
"@types/react-redux": "^7.1.1",
"@typescript-eslint/eslint-plugin": "^3.10.1",
Expand All @@ -63,14 +63,14 @@
"express": "~4.16.3",
"full-icu": "~1.3.1",
"husky": "^2.3.0",
"jest": "^24.7.0",
"jest": "^26.6.3",
"lerna": "~2.9.1",
"lint-staged": "^8.1.7",
"lolex": "~2.3.2",
"mutationobserver-shim": "^0.3.3",
"prettier": "~2.1.1",
"raf": "~3.4.1",
"ts-jest": "^24.0.0",
"ts-jest": "^26.4.4",
"wait-on": "^3.2.0",
"whatwg-fetch": "^3.0.0"
},
Expand All @@ -82,4 +82,4 @@
"dependencies": {
"typescript": "^4.0.2"
}
}
}
2 changes: 1 addition & 1 deletion packages/ra-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"redux-saga": "^1.0.0"
},
"dependencies": {
"@testing-library/react": "^8.0.7",
"@testing-library/react": "^11.2.2",
"classnames": "~2.2.5",
"date-fns": "^1.29.0",
"eventemitter3": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/ra-core/src/actions/notificationActions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const SHOW_NOTIFICATION = 'RA/SHOW_NOTIFICATION';

export type NotificationType = 'info' | 'warning' | 'error';
export type NotificationType = 'success' | 'info' | 'warning' | 'error';

interface NotificationOptions {
// The duration in milliseconds the notification is shown
Expand Down
4 changes: 1 addition & 3 deletions packages/ra-core/src/auth/Authenticated.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { cleanup, wait } from '@testing-library/react';
import { wait } from '@testing-library/react';

import Authenticated from './Authenticated';
import AuthContext from './AuthContext';
Expand All @@ -10,8 +10,6 @@ import { createMemoryHistory } from 'history';
import { Router } from 'react-router-dom';

describe('<Authenticated>', () => {
afterEach(cleanup);

const Foo = () => <div>Foo</div>;

it('should render its child by default', async () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/ra-core/src/auth/useAuthState.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { cleanup, wait } from '@testing-library/react';
import { wait } from '@testing-library/react';

import useAuthState from './useAuthState';
import AuthContext from './AuthContext';
Expand All @@ -20,8 +20,6 @@ const stateInpector = state => (
);

describe('useAuthState', () => {
afterEach(cleanup);

it('should return a loading state on mount', () => {
const { queryByText } = renderWithRedux(
<UseAuth>{stateInpector}</UseAuth>
Expand Down
4 changes: 1 addition & 3 deletions packages/ra-core/src/auth/useAuthenticated.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { cleanup, wait } from '@testing-library/react';
import { wait } from '@testing-library/react';

import Authenticated from './Authenticated';
import AuthContext from './AuthContext';
Expand All @@ -10,8 +10,6 @@ import { createMemoryHistory } from 'history';
import { Router } from 'react-router-dom';

describe('useAuthenticated', () => {
afterEach(cleanup);

const Foo = () => <div>Foo</div>;

it('should call authProvider on mount', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/ra-core/src/auth/useCheckAuth.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { useState, useEffect } from 'react';
import expect from 'expect';
import { render, cleanup, wait } from '@testing-library/react';
import { render, wait } from '@testing-library/react';

import useCheckAuth from './useCheckAuth';
import AuthContext from './AuthContext';
Expand Down Expand Up @@ -60,7 +60,6 @@ describe('useCheckAuth', () => {
afterEach(() => {
logout.mockClear();
notify.mockClear();
cleanup();
});

it('should not logout if has credentials', async () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/ra-core/src/auth/useLogoutIfAccessDenied.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as React from 'react';
import { useState, useEffect } from 'react';
import expect from 'expect';
import { render, cleanup, wait } from '@testing-library/react';
import { render, wait } from '@testing-library/react';

import useLogoutIfAccessDenied from './useLogoutIfAccessDenied';
import AuthContext from './AuthContext';
Expand Down Expand Up @@ -55,7 +55,6 @@ describe('useLogoutIfAccessDenied', () => {
afterEach(() => {
logout.mockClear();
notify.mockClear();
cleanup();
});

it('should not logout if passed no error', async () => {
Expand Down
4 changes: 1 addition & 3 deletions packages/ra-core/src/auth/usePermissions.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { cleanup, wait } from '@testing-library/react';
import { wait } from '@testing-library/react';

import usePermissions from './usePermissions';
import AuthContext from './AuthContext';
Expand All @@ -21,8 +21,6 @@ const stateInpector = state => (
);

describe('usePermissions', () => {
afterEach(cleanup);

it('should return a loading state on mount', () => {
const { queryByText } = renderWithRedux(
<UsePermissions>{stateInpector}</UsePermissions>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import expect from 'expect';
import { act, cleanup } from '@testing-library/react';
import { act } from '@testing-library/react';

import { getRecord } from './useCreateController';
import { CreateController } from './CreateController';
Expand All @@ -9,8 +9,6 @@ import { DataProviderContext } from '../../dataProvider';
import { DataProvider } from '../../types';

describe('useCreateController', () => {
afterEach(cleanup);

describe('getRecord', () => {
const location = {
pathname: '/foo',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import * as React from 'react';
import expect from 'expect';
import { act, cleanup, wait } from '@testing-library/react';
import { act, wait } from '@testing-library/react';

import { EditController } from './EditController';
import renderWithRedux from '../../util/renderWithRedux';
import { DataProviderContext } from '../../dataProvider';
import { DataProvider } from '../../types';

describe('useEditController', () => {
afterEach(cleanup);

const defaultProps = {
basePath: '',
hasCreate: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as React from 'react';
import { cleanup } from '@testing-library/react';
import expect from 'expect';

import ReferenceArrayFieldController from './ReferenceArrayFieldController';
import { DataProviderContext } from '../../dataProvider';
import renderWithRedux from '../../util/renderWithRedux';

describe('<ReferenceArrayFieldController />', () => {
afterEach(cleanup);
it('should set the loaded prop to false when related records are not yet fetched', () => {
const children = jest.fn().mockReturnValue('child');

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as React from 'react';
import { cleanup } from '@testing-library/react';
import expect from 'expect';

import ReferenceFieldController from './ReferenceFieldController';
Expand All @@ -13,7 +12,6 @@ const defaultState = {
};

describe('<ReferenceFieldController />', () => {
afterEach(cleanup);
it('should call the CRUD_GET_MANY action on mount if reference source is defined', async () => {
const dataProvider = {
getMany: jest.fn(() =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import * as React from 'react';
import { cleanup, wait } from '@testing-library/react';
import { wait } from '@testing-library/react';
import expect from 'expect';

import ReferenceManyFieldController from './ReferenceManyFieldController';
import renderWithRedux from '../../util/renderWithRedux';

describe('<ReferenceManyFieldController />', () => {
afterEach(cleanup);
it('should set loaded to false when related records are not yet fetched', async () => {
const children = jest.fn().mockReturnValue('children');
const { dispatch } = renderWithRedux(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { cleanup, wait, fireEvent } from '@testing-library/react';
import { wait, fireEvent } from '@testing-library/react';
import ReferenceArrayInputController from './ReferenceArrayInputController';
import { renderWithRedux } from '../../util';
import { CRUD_GET_MATCHING, CRUD_GET_MANY } from '../../../lib';
Expand All @@ -15,8 +15,6 @@ describe('<ReferenceArrayInputController />', () => {
source: 'tag_ids',
};

afterEach(cleanup);

it('should set loading to true as long as there are no references fetched and no selected references', () => {
const children = jest.fn(({ loading }) => (
<div>{loading.toString()}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { useState, useCallback } from 'react';
import { cleanup, fireEvent, wait } from '@testing-library/react';
import { fireEvent, wait } from '@testing-library/react';
import omit from 'lodash/omit';
import expect from 'expect';

Expand All @@ -19,8 +19,6 @@ describe('<ReferenceInputController />', () => {
source: 'post_id',
};

afterEach(cleanup);

const dataProvider = {
getMany: jest.fn(() =>
Promise.resolve({ data: [{ id: 1, title: 'foo' }] })
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import renderHook from '../../util/renderHook';
import useMatchingReferences from './useGetMatchingReferences';
import { cleanup } from '@testing-library/react';

describe('useMatchingReferences', () => {
const defaultProps = {
Expand All @@ -16,8 +15,6 @@ describe('useMatchingReferences', () => {
referenceSource: undefined,
};

afterEach(cleanup);

it('should fetch matchingReferences only on mount', () => {
const { dispatch } = renderHook(
() => {
Expand Down
4 changes: 1 addition & 3 deletions packages/ra-core/src/controller/useListContext.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import * as React from 'react';
import expect from 'expect';
import { render, cleanup } from '@testing-library/react';
import { render } from '@testing-library/react';

import ListContext from './ListContext';
import useListContext from './useListContext';

describe('useListContext', () => {
afterEach(cleanup);

const NaiveList = props => {
const { ids, data } = useListContext(props);
return (
Expand Down
3 changes: 1 addition & 2 deletions packages/ra-core/src/controller/useListController.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import expect from 'expect';
import { fireEvent, wait, cleanup } from '@testing-library/react';
import { fireEvent, wait } from '@testing-library/react';
import lolex from 'lolex';
import TextField from '@material-ui/core/TextField/TextField';

Expand Down Expand Up @@ -205,7 +205,6 @@ describe('useListController', () => {

afterEach(() => {
clock.uninstall();
cleanup();
});
});
describe('showFilter', () => {
Expand Down
Loading