[WIP] Amazon refactor to lib (#8403)

* Moved amazon tests to folder

* Abstracted amazon payment code and added initial test

* Abstracted cancel and subscribe logic to amazon payment lib

* Added arg checks to checkout

* Added constants. Added more subscription test

* Added with arg checks to cancel

* Fixed linting issues

* Added integration tests for amazon subscribe cancel

* Added integration test for amazon checkout

* Added integration test for amazon subscribe

* Added coupon unit test

* Fixed lint

* Fixed minor test issue and changed header expectations

* Fixed line endings
This commit is contained in:
Keith Holliday
2017-01-19 08:30:30 -07:00
committed by GitHub
parent 080ffae4e1
commit ffa561473c
14 changed files with 1061 additions and 378 deletions

View File

@@ -0,0 +1,20 @@
import {
generateUser,
} from '../../../../../helpers/api-integration/v3';
describe('payments - amazon - #createOrderReferenceId', () => {
let endpoint = '/amazon/createOrderReferenceId';
let user;
beforeEach(async () => {
user = await generateUser();
});
it('verifies billingAgreementId', async () => {
await expect(user.post(endpoint)).to.eventually.be.rejected.and.eql({
code: 400,
error: 'BadRequest',
message: 'Missing req.body.billingAgreementId',
});
});
});