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

Function assertDocumentStructure

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

Source from the content-addressed store, hash-verified

3289 }
3290
3291 function assertDocumentStructure(payment) {
3292 assert.equal(payment.paymentFor, 'order');
3293 assert.equal(payment.externalServiceResponse.id, '1');
3294 assert.equal(payment.externalServiceResponse.resultDetails.clearingInstituteName, 'Our local bank');
3295 assert.deepEqual(
3296 payment.externalServiceResponse.resultDetails.authorizationResponse,
3297 { stan: '123456' }
3298 );
3299 assert.deepEqual(
3300 payment.externalServiceResponse.resultDetails.transaction,
3301 {
3302 receipt: 'I am a transaction receipt',
3303 authorizationCode: 'ABCDEF',
3304 acquirer: { settlementDate: 'February 2021' }
3305 }
3306 );
3307 assert.deepEqual(
3308 payment.externalServiceResponse.resultDetails.sourceOfFunds,
3309 { provided: { card: { issuer: 'Big bank corporation' } } }
3310 );
3311 assert.deepEqual(
3312 payment.externalServiceResponse.resultDetails.nonExistentField,
3313 undefined
3314 );
3315 }
3316 });
3317 it('should throw when matchedCount === 0 and using orFail() on the query gh-11620', async function() {
3318 const schema = new mongoose.Schema({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected