Skip to content

Commit

Permalink
Merge pull request #104 from thisyahlen-deriv/thisyahlen/querykey-for…
Browse files Browse the repository at this point in the history
…-ctrader-derivx

chore: add querykey to ctrader and derivx
  • Loading branch information
thisyahlen-deriv authored Apr 17, 2024
2 parents 4f63254 + fac7676 commit a0eb08d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
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();
});
});

0 comments on commit a0eb08d

Please sign in to comment.