Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import { shallow, mount } from 'enzyme';
import 'jest-styled-components';
import toJson from 'enzyme-to-json';
import { MemoryRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
import '../../../../../../i18n';
import { MandateTransactionView, options } from '../MandateTransactionView';
import Cancel from '../../../../../../components/Cancel';
const data = {
loading: true
};
const store = {};
const location = {
state: {
isBatch: true,
journeyName: 'batchSummary',
batchRefNo: 'OEA23981264D',
repairField: {
mandateDetailList: [
{
mandateRef: 'PIA08291',
mandateBankRef: 'PIA08291',
batchRefNo: 'PIUATSGEE2A08290',
transType: null,
valueDate: null,
debtorId: null,
recurrDDI: '2',
frequency: null,
creditAcctNo: '388100201316',
creditDetails: {
creditCurrency: 'MYR',
creditAcctName: '0033524 Title..',
creditBankCode: 'SCBLMYKXXXX',
createdDate: '2018-04-20T07:17:30Z',
ctryCode: 'MY'
},
creditCurrency: 'MYR',
creditAcctName: '0033524 Title..',
creditBankCode: 'SCBLMYKXXXX',
createdDate: '2018-04-20T07:17:30Z',
ctryCode: 'MY',
maxAmount: {
value: null,
currency: null
},
minAmount: {
value: null,
currency: null
},
debtorAmount: {
value: 200,
currency: 'MYR'
},
payer: {
payerName: 'Chethan',
payerStatus: null,
payerAccount: [
{
accountNo: '12345643',
bank: {
bankCode: 'AGOBMYKLXXX',
bankName: 'Agro Bank Malaysia'
}
}
]
}
}
]
}
},
pathname: 'collections/',
mandateRef: 'PIA08291'
};
const datalocation = {
state: {
isBatch: true
},
pathname: 'collections/mandate',
mandateRef: 'PIA08291'
};
const mandateDetailList = [
{
mandateRef: 'PIA08291',
mandateBankRef: 'PIA08291',
batchRefNo: 'PIUATSGEE2A08290',
transType: null,
valueDate: null,
debtorId: null,
recurrDDI: '2',
frequency: null
}
];
const receivedData = {
loading: false,
getMandateDetails: {
transactionSuccess: true,
collectionMandate: {
mandateHeader: {
batchRefNo: 'PIUATSGEE2A08290',
batchName: 'PIUATSGEE2A08290',
creditAcctNo: '388100201316',
creditCurrency: 'MYR',
creditAcctName: '0033524 Title..',
creditBankCode: 'SCBLMYKXXXX',
createdDate: '2018-04-20T07:17:30Z',
ctryCode: 'MY',
orgident: null,
docId: null,
versionNo: 1,
noOfMandates: '1',
subAction: ['DELETE', 'EDIT', 'PRINT'],
status: 'COMPLETED',
importRef: null,
manStatusLabel: 'COMPLETED'
},
mandateDetails: [
{
mandateRef: 'PIA08291',
mandateBankRef: 'PIA08291',
batchRefNo: 'PIUATSGEE2A08290',
transType: null,
valueDate: null,
debtorId: null,
recurrDDI: '2',
frequency: null,
subAction: ['PRINT', 'VIEW', 'EXPORT'],
payer: {
payerName: 'shruti',
payerStatus: null,
payerAccount: [
{
accountNo: '12345643',
bank: {
bankCode: 'AGOBMYKLXXX',
bankName: 'Agro Bank Malaysia'
}
}
]
},
startDate: '2018-04-19T18:30:00Z',
endDate: '2018-05-08T06:30:00Z',
maxAmount: null,
minAmount: null,
debtorAmount: {
value: 200,
currency: 'MYR'
},
mandateType: 'Fixed',
mandateStatus: 'COMPLETED'
}
]
}
},
getAddlInfoForMandate: {
commonRuleObjects: [
{
additionalFieldList: [
{
fieldName: 'transtype',
paymentMappingField: 'transType'
}
]
}
]
},
getWorkFlowState: {
transactionSuccess: true,
workFlowState: [
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 1,
entityName: 'DDI',
entityReferenceNumber: null,
state: 'INITIATED',
stateName: 'INITIATED',
showable: true,
applyRule: null,
status: 'CLOSED',
displayName: 'COMPLETED',
overlayDataFlag: 'S',
bankState: false
},
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 2,
entityName: null,
entityReferenceNumber: null,
state: 'APPROVED',
stateName: 'APPROVE',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'APPROVAL PENDING',
overlayDataFlag: 'C',
bankState: false
},
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 3,
entityName: null,
entityReferenceNumber: null,
state: 'RELEASED TO BANK',
stateName: 'RELEASE TO BANK',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RELEASE TO BANK',
overlayDataFlag: 'S',
bankState: false
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 4,
entityName: null,
entityReferenceNumber: null,
state: 'RECEIVED',
stateName: 'RECEIVED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RECEIVED BY BANK',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 5,
entityName: null,
entityReferenceNumber: null,
state: 'UNDER PROCESSING',
stateName: 'UNDER PROCESSING',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'UNDER PROCESSING',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 6,
entityName: null,
entityReferenceNumber: null,
state: 'PROCESSED',
stateName: 'PROCESSED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'PROCESSED',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 12,
entityName: null,
entityReferenceNumber: null,
state: 'RECEIVED',
stateName: 'RECEIVED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RECEIVED BY BANK',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 14,
entityName: null,
entityReferenceNumber: null,
state: 'UNDER PROCESSING',
stateName: 'UNDER PROCESSING',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'UNDER PROCESSING',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 18,
entityName: null,
entityReferenceNumber: null,
state: 'PROCESSED',
stateName: 'PROCESSED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'PROCESSED',
overlayDataFlag: 'S',
bankState: true
}
]
}
};
const variableMandateData = {
loading: false,
getMandateDetails: {
transactionSuccess: true,
collectionMandate: {
mandateHeader: {
batchRefNo: 'PIUATSGEE2A08290',
batchName: 'PIUATSGEE2A08290',
creditAcctNo: '388100201316',
creditCurrency: 'MYR',
creditAcctName: '0033524 Title..',
creditBankCode: 'SCBLMYKXXXX',
createdDate: '2018-04-20T07:17:30Z',
ctryCode: 'MY',
orgident: null,
docId: null,
versionNo: 1,
noOfMandates: '1',
subAction: ['DELETE', 'EDIT', 'PRINT'],
status: 'COMPLETED',
importRef: null,
manStatusLabel: 'Draft'
},
mandateDetails: [
{
mandateRef: 'PIA08291',
mandateBankRef: 'PIA08291',
batchRefNo: 'PIUATSGEE2A08290',
transType: null,
valueDate: null,
debtorId: null,
recurrDDI: '2',
frequency: null,
payer: {
payerName: 'shruti',
payerStatus: null,
payerAccount: [
{
accountNo: '12345643',
bank: {
bankCode: 'AGOBMYKLXXX',
bankName: 'Agro Bank Malaysia'
}
}
]
},
startDate: '2018-04-19T18:30:00Z',
endDate: '2018-05-08T06:30:00Z',
maxAmount: {
value: 2000,
currency: 'MYR'
},
minAmount: {
value: 200,
currency: 'MYR'
},
debtorAmount: {
value: 200,
currency: 'MYR'
},
mandateType: 'V',
mandateStatus: 'COMPLETED',
subAction: ['DELETE', 'EDIT', 'PRINT']
}
]
}
},
getAddlInfoForMandate: {
commonRuleObjects: [
{
additionalFieldList: [
{
fieldName: 'transtype',
paymentMappingField: 'transType'
}
]
}
]
},
getWorkFlowState: {
transactionSuccess: true,
workFlowState: [
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 1,
entityName: 'DDI',
entityReferenceNumber: null,
state: 'INITIATED',
stateName: 'INITIATED',
showable: true,
applyRule: null,
status: 'CLOSED',
displayName: 'COMPLETED',
overlayDataFlag: 'S',
bankState: false
},
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 2,
entityName: null,
entityReferenceNumber: null,
state: 'APPROVED',
stateName: 'APPROVE',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'APPROVAL PENDING',
overlayDataFlag: 'C',
bankState: false
},
{
workFlowNo: null,
referenceNumber: '46298',
sequenceNumber: 3,
entityName: null,
entityReferenceNumber: null,
state: 'RELEASED TO BANK',
stateName: 'RELEASE TO BANK',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RELEASE TO BANK',
overlayDataFlag: 'S',
bankState: false
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 4,
entityName: null,
entityReferenceNumber: null,
state: 'RECEIVED',
stateName: 'RECEIVED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RECEIVED BY BANK',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 5,
entityName: null,
entityReferenceNumber: null,
state: 'UNDER PROCESSING',
stateName: 'UNDER PROCESSING',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'UNDER PROCESSING',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 6,
entityName: null,
entityReferenceNumber: null,
state: 'PROCESSED',
stateName: 'PROCESSED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'PROCESSED',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 12,
entityName: null,
entityReferenceNumber: null,
state: 'RECEIVED',
stateName: 'RECEIVED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'RECEIVED BY BANK',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 14,
entityName: null,
entityReferenceNumber: null,
state: 'UNDER PROCESSING',
stateName: 'UNDER PROCESSING',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'UNDER PROCESSING',
overlayDataFlag: 'S',
bankState: true
},
{
workFlowNo: null,
referenceNumber: null,
sequenceNumber: 18,
entityName: null,
entityReferenceNumber: null,
state: 'PROCESSED',
stateName: 'PROCESSED',
showable: true,
applyRule: null,
status: 'OPEN',
displayName: 'PROCESSED',
overlayDataFlag: 'S',
bankState: true
}
]
}
};
const details = {
location: {
state: {
mandateRef: 'PREMAND007',
batchRefNo: 'OEA23981264D'
}
}
};
const subaction = ['print', 'edit', 'delete', 'view', 'back', 'export'];
const mandateDetails = {
fetchPolicy: 'network-only',
variables: {
GetAuditTrailGqlRequest: {
referenceNumber: 'OEA23981264D'
},
getMandateDetailsRqst: {
mandateRef: 'PREMAND007',
batchRef: 'OEA23981264D',
userRole: 'O'
},
searchRulesForMandateBatchRqst: {
collectionMandate: {
mandateHeader: {
ctryCode: 'SG',
realTimeFlag: 'N'
}
}
}
}
};
const client = {
query: jest.fn(
() =>
new Promise((resolve) => {
resolve();
})
)
};
const userPreferences = {
DATE_FORMAT: 'DD/MM/YYYY',
TIMEZONE: 'Asia/Singapore'
};
const mountComponent = () => {
const mandateView = mount(
<Provider store={store}>
<MemoryRouter>
<MandateTransactionView
userPreferences={userPreferences}
data={data}
location={location}
client={client}
/>
</MemoryRouter>
</Provider>
);
const mandateTransaction = mandateView.find(MandateTransactionView);
mandateTransaction.instance().componentWillReceiveProps({
data: receivedData,
repairField: mandateDetailList,
location
});
return mandateTransaction;
};
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team