Skip to content

Commit

Permalink
Ako/ Fix Trackjs Custom Invalid Token issue (#8985)
Browse files Browse the repository at this point in the history
* fix: separate conditions for virtual and no verification code statuses

* test: test the case that there's no verification

* ci: update project check on PR

* chore: empty commit to trigger the ci

* test: reset to old test cases

* test: cover no_verification code case

* ci: revert codecov config

* fix: prevent sending withdraw request on deposit store

* fix: remove aliases

* test: if the active container is deposit and not on crypto

* chore: remove wrong import

* test: add test cases for no verif code and virtual account

* ci: revert account_platform_icon

* test: update verification code

* chore: remove unneccesary changes

* test: to not call cashier deposit when we are on crypto

* test: try the test with withdraw active_container
  • Loading branch information
ali-hosseini-deriv authored Jun 27, 2023
1 parent b9c14fd commit 06343ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions packages/cashier/src/stores/__tests__/deposit-store.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,22 @@ describe('DepositStore', () => {
expect(checkIframeLoaded).not.toHaveBeenCalled();
expect(setLoading).toHaveBeenCalledWith(false);
});
it('should call cashier deposit if the active_container is deposit and not on crypto', async () => {
const { checkIframeLoaded } = deposit_store.root_store.modules.cashier.iframe;

deposit_store.root_store.modules.cashier.iframe.is_session_timeout = true;

await deposit_store.onMountDeposit();
expect(checkIframeLoaded).toHaveBeenCalled();
expect(deposit_store.WS.authorized.cashier).toHaveBeenCalled();
});
it('should not call cashier deposit if the active_container is not deposit and on crypto', async () => {
const { checkIframeLoaded } = deposit_store.root_store.modules.cashier.iframe;
deposit_store.root_store.modules.cashier.general_store.active_container = 'withdraw';
deposit_store.root_store.modules.cashier.iframe.is_session_timeout = true;

await deposit_store.onMountDeposit();
expect(checkIframeLoaded).not.toHaveBeenCalled();
expect(deposit_store.WS.authorized.cashier).not.toHaveBeenCalled();
});
});
2 changes: 1 addition & 1 deletion packages/cashier/src/stores/deposit-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default class DepositStore {
return;
}

if (!is_crypto) {
if (!is_crypto && active_container === 'deposit') {
const response_cashier = await this.WS.authorized.cashier(active_container, {
verification_code: 'undefined',
});
Expand Down

1 comment on commit 06343ec

@vercel
Copy link

@vercel vercel bot commented on 06343ec Jun 27, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app.binary.sx
deriv-app-git-master.binary.sx

Please sign in to comment.