/** * @fileOverview End-to-end testing of the get all ATPs related to a payable RTP */ 'use strict'; const helper = require('../../utils/test/e2e-helper'); let app; // Standard errored values const TOO_LONG = '0000000000000000000000001'; const TOO_SHORT = '0123'; const BAD_UUID = '00000000000000000000000Z'; const VALID_UUID = '000000000000000000000000'; // Valid test data describe('E2E: get All ATPs', () => { /** * Load the dev API router to handle `/dev/*` routes */ before(() => { app = new helper.DevValidatorApp(); }); it('with a valid objectID', () => { app.setRequestPath('/dev/v0/payables/rtps/' + VALID_UUID + '/atps'); return app.getAndValidate(502); }); it('objectID with an invalid pattern', () => { app.setRequestPath('/dev/v0/payables/rtps/' + BAD_UUID + '/atps'); return app.getAndValidate(400, undefined, helper.errors.failedPattern('objectID')); }); it('objectID is too short', () => { app.setRequestPath('/dev/v0/payables/rtps/' + TOO_SHORT + '/atps'); return app.getAndValidate(400, undefined, helper.errors.minLength('objectID')); }); it('objectID is too long', () => { app.setRequestPath('/dev/v0/payables/rtps/' + TOO_LONG + '/atps'); return app.getAndValidate(400, undefined, helper.errors.maxLength('objectID')); }); });