Skip to content

Commit

Permalink
chore: ts for poo test
Browse files Browse the repository at this point in the history
  • Loading branch information
“yauheni-kryzhyk-deriv” committed Sep 27, 2023
1 parent 2be7d15 commit 4f85a16
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { ProofOfOwnership } from '../proof-of-ownership.jsx';
import test_data from './test-data';
import { GetAccountStatus } from '@deriv/api-types';
import { StoreProvider, mockStore } from '@deriv/stores';
import { ProofOfOwnership } from '../proof-of-ownership';
import test_data from './test-data';

type TRequests = DeepRequired<GetAccountStatus>['authentication']['ownership']['requests'];
type TStatus = DeepRequired<GetAccountStatus>['authentication']['ownership']['status'];

describe('proof-of-ownership.jsx', () => {
let ownership_temp;
let ownership_temp: typeof test_data;

beforeAll(() => {
ownership_temp = test_data;
});
Expand All @@ -16,7 +21,7 @@ describe('proof-of-ownership.jsx', () => {
</StoreProvider>
);
};
let store = mockStore();
let store = mockStore({});
it('should render no poo required status page', () => {
store = mockStore({
client: {
Expand Down Expand Up @@ -94,7 +99,10 @@ describe('proof-of-ownership.jsx', () => {
client: {
account_status: {
authentication: {
ownership: { requests: ownership_temp.requests, status: ownership_temp.status },
ownership: {
requests: ownership_temp.requests as TRequests,
status: ownership_temp.status as TStatus,
},
needs_verification: ['ownership'],
},
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
export default {
requests: [
{
id: '1',
creation_time: '123',
id: 1,
payment_method: 'beyonic',
documents_required: 1,
},
{
id: '2',
creation_time: '234',
id: 2,
payment_method: 'boleto (d24 voucher)',
documents_required: 1,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { withRouter } from 'react-router-dom';
import { GetAccountStatus } from '@deriv/api-types';
import { Loading } from '@deriv/components';
import { observer, useStore } from '@deriv/stores';
import ProofOfOwnershipForm from './proof-of-ownership-form.jsx';
import ProofOfOwnershipForm from './proof-of-ownership-form';
import { POONotRequired, POOVerified, POORejetced, POOSubmitted } from 'Components/poo/statuses';
import { POO_STATUSES } from 'Constants/poo-identifier';
import getPaymentMethodsConfig from '../../../Configs/payment-method-config';
Expand Down

0 comments on commit 4f85a16

Please sign in to comment.