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

chore: add querykey to ctrader and derivx #104

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
2 changes: 2 additions & 0 deletions src/hooks/useCtraderAccountsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { useExchangeRates } from './useExchangeRates';
export const useCtraderAccountsList = () => {
const { data, ...rest } = useTradingPlatformAccounts({
payload: { platform: 'ctrader' },
queryKey: ['ctrader'],
});

const { getExchangeRate } = useExchangeRates();

const { formatMoney } = FormatUtils;
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useDxtradeAccountsList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { useExchangeRates } from './useExchangeRates';
export const useDxtradeAccountsList = () => {
const { data, ...rest } = useTradingPlatformAccounts({
payload: { platform: 'dxtrade' },
queryKey: ['dxtrade'],
});

const { getExchangeRate } = useExchangeRates();
Expand Down
3 changes: 2 additions & 1 deletion src/modals/Modals.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Fragment } from 'react/jsx-runtime';

import { MT5PasswordModal, MT5SuccessModal, TradeModal } from '@/cfd/modals';
import { DxtradePasswordModal, MT5PasswordModal, MT5SuccessModal, TradeModal } from '@/cfd/modals';
import { RealAccountCreation } from '@/flows';

import { JurisdictionModal } from './JurisdictionModal';
Expand All @@ -17,6 +17,7 @@ export const Modals = () => {
{/* PLS DO NOT ADD ANY PROPS TO ANY MODALS HERE.💥 */}
<AccountSelector />
<AccountOpeningSuccessModal />
<DxtradePasswordModal />
<JurisdictionModal />
<MT5PasswordModal />
<MT5SuccessModal />
Expand Down
7 changes: 7 additions & 0 deletions src/modals/__tests__/Modals.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ jest.mock('@/cfd/modals/TradeModal', () => {
return { TradeModal };
});

jest.mock('@/cfd/modals/DxtradePasswordModal', () => {
const DxtradePasswordModal = () => <div>DxtradePasswordModal</div>;
DxtradePasswordModal.displayName = 'DxtradePasswordModal';
return { DxtradePasswordModal };
});

describe('Modals', () => {
it('should render all modals', () => {
render(<Modals />);
Expand All @@ -67,5 +73,6 @@ describe('Modals', () => {
expect(screen.getByText('RegulationModal')).toBeInTheDocument();
expect(screen.getByText('JurisdictionModal')).toBeInTheDocument();
expect(screen.getByText('TradeModal')).toBeInTheDocument();
expect(screen.getByText('DxtradePasswordModal')).toBeInTheDocument();
});
});
Loading