MCPcopy Create free account
hub / github.com/Automattic/mongoose / assertDocumentStructure

Function assertDocumentStructure

test/model.updateOne.test.js:3493–3517  ·  view source on GitHub ↗
(payment)

Source from the content-addressed store, hash-verified

3491 }
3492
3493 function assertDocumentStructure(payment) {
3494 assert.equal(payment.paymentFor, 'order');
3495 assert.equal(payment.externalServiceResponse.id, '1');
3496 assert.equal(payment.externalServiceResponse.resultDetails.clearingInstituteName, 'Our local bank');
3497 assert.deepEqual(
3498 payment.externalServiceResponse.resultDetails.authorizationResponse,
3499 { stan: '123456' }
3500 );
3501 assert.deepEqual(
3502 payment.externalServiceResponse.resultDetails.transaction,
3503 {
3504 receipt: 'I am a transaction receipt',
3505 authorizationCode: 'ABCDEF',
3506 acquirer: { settlementDate: 'February 2021' }
3507 }
3508 );
3509 assert.deepEqual(
3510 payment.externalServiceResponse.resultDetails.sourceOfFunds,
3511 { provided: { card: { issuer: 'Big bank corporation' } } }
3512 );
3513 assert.deepEqual(
3514 payment.externalServiceResponse.resultDetails.nonExistentField,
3515 undefined
3516 );
3517 }
3518 });
3519 it('should throw when matchedCount === 0 and using orFail() on the query gh-11620', async function() {
3520 const schema = new mongoose.Schema({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected