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

Farzin/76562/Remove legacy connect method from cashier #7238

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion packages/cashier/build/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ module.exports = function (env) {
'react-router-dom': 'react-router-dom',
'react-router': 'react-router',
mobx: 'mobx',
'mobx-react-lite': 'mobx-react-lite',
'@deriv/shared': '@deriv/shared',
'@deriv/components': '@deriv/components',
'@deriv/translations': '@deriv/translations',
Expand Down
1 change: 0 additions & 1 deletion packages/cashier/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"loadjs": "^4.2.0",
"lodash.debounce": "^4.0.8",
"mobx": "^6.6.1",
"mobx-react": "^7.5.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should’ve been mobx-react-lite, But seems like we have missed it in merge conflicts and didn’t notice it.

"moment": "^2.29.2",
"prop-types": "^15.7.2",
"qrcode.react": "^1.0.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/cashier/src/app.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { setWebsocket } from '@deriv/shared';
import { StoreProvider } from '@deriv/stores';
import { init } from 'Utils/server_time';
import Routes from 'Containers/routes';
import { MobxContentProvider } from 'Stores/connect';

const App = ({ passthrough: { WS, root_store } }) => {
React.useEffect(() => {
Expand All @@ -13,11 +12,9 @@ const App = ({ passthrough: { WS, root_store } }) => {
}, []);

return (
<MobxContentProvider store={root_store}>
<StoreProvider store={root_store}>
<Routes />
</StoreProvider>
</MobxContentProvider>
<StoreProvider store={root_store}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<StoreProvider store={root_store}>
<StoreProvider>

Later when we could move all stores to the @deriv/stores we won’t need to pass anything to the provider anymore as the stores already live in the @deriv/stores package.

<Routes />
</StoreProvider>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import CashierLocked from '../cashier-locked';
import { StoreProvider } from '@deriv/stores';
import { TRootStore } from '../../../types';
import type { DeepPartial } from '@deriv/stores/types';
import { TRootStore } from 'Types';

describe('<CashierLocked />', () => {
it('should show the proper message if there is a cryptocashier maintenance', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import CashierOnboardingDetails from '../cashier-onboarding-details';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CashierOnboardingDetails />', () => {
let props;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { fireEvent, render, screen } from '@testing-library/react';
import CashierOnboardingSideNote from '../cashier-onboarding-side-note';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CashierOnboardingSideNote />', () => {
let mockRootStore;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ import { Router } from 'react-router';
import { routes } from '@deriv/shared';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CashierOnboarding />', () => {
let mockRootStore;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import { StoreProvider } from '@deriv/stores';
import { Formik } from 'formik';
import * as formik from 'formik';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CryptoFiatConverter />', () => {
let mockRootStore, mockProps;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { fireEvent, render, screen } from '@testing-library/react';
import CryptoTransactionsCancelModal from '../crypto-transactions-cancel-modal';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CryptoTransactionsCancelModal />', () => {
let modal_root_el, mockRootStore;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { fireEvent, render, screen } from '@testing-library/react';
import CryptoTransactionsHistory from '../crypto-transactions-history';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CryptoTransactionsHistory />', () => {
let mockRootStore;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ import { isMobile } from '@deriv/shared';
import CryptoTransactionsRenderer from '../crypto-transactions-renderer';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

jest.mock('@deriv/shared/src/utils/screen/responsive', () => ({
...jest.requireActual('@deriv/shared/src/utils/screen/responsive'),
isMobile: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ import { fireEvent, render, screen } from '@testing-library/react';
import CryptoTransactionsStatusModal from '../crypto-transactions-status-modal';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect.js', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<CryptoTransactionsStatusModal />', () => {
let modal_root_el, mockRootStore;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { render, screen } from '@testing-library/react';
import EmailVerificationEmptyState from '../email-verification-empty-state';
import { StoreProvider } from '@deriv/stores';
import { TRootStore } from '../../../types';
import { TRootStore } from 'Types';

const mock_store: DeepPartial<TRootStore> = {
client: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { Router } from 'react-router';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import { routes } from '@deriv/shared';
import { StoreProvider } from '@deriv/stores';
import { TRootStore } from '../../../types';
import type { DeepPartial } from '@deriv/stores/types';
import { TRootStore } from 'Types';

const mockRootStore: DeepPartial<TRootStore> = {
ui: { disableApp: jest.fn(), enableApp: jest.fn() },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import FundsProtection from '../funds-protection';
import { StoreProvider } from '@deriv/stores';
import { TRootStore } from '../../../types';
import type { DeepPartial } from '@deriv/stores/types';
import { TRootStore } from 'Types';

const mockRootStore: DeepPartial<TRootStore> = {
modules: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import { createBrowserHistory } from 'history';
import { Router } from 'react-router';
import { StoreProvider } from '@deriv/stores';

jest.mock('Stores/connect', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<RecentTransaction />', () => {
let history, mockRootStore;
beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import TransferConfirm from '../transfer-confirm';
import { StoreProvider } from '@deriv/stores';
import { TRootStore } from '../../../types';
import type { DeepPartial } from '@deriv/stores/types';
import { TRootStore } from 'Types';

const mockRootStore: DeepPartial<TRootStore> = {
ui: {
Expand All @@ -12,12 +11,6 @@ const mockRootStore: DeepPartial<TRootStore> = {
},
};

jest.mock('Stores/connect', () => ({
__esModule: true,
default: 'mockedDefaultExport',
connect: () => Component => Component,
}));

describe('<TransferConfirm />', () => {
let modal_root_el;
beforeAll(() => {
Expand Down
Loading