forked from magento/graphql-ce
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAGETWO-87154: [EngCom Team] Batch 14. Forwardports to 2.3-develop #1299
- Merge Pull Request magento-engcom/magento2ce#1299 from magento-engcom-team/magento2:batch-14-forwardport-2.3-develop - Merged commits: 1. 99e3a76 2. 4cfc07e 3. ea616e0 4. be55217 5. 41c52fb 6. 7f42a67 7. 1090c8b 8. c80b5ca 9. 8077af7 10. 38e34a8 11. c13ad85 12. 9e7bf93 13. 10a6288 14. abf31d2 15. 898a470 16. c99c3a7 17. 4537e78 18. 0bad56f 19. fd2418e 20. 946e9e1
- Loading branch information
Showing
18 changed files
with
221 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
...ine/tests/app/code/Magento/CheckoutAgreements/frontend/js/model/place-order-mixin.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
define([ | ||
'squire' | ||
], function (Squire) { | ||
'use strict'; | ||
|
||
var injector = new Squire(), | ||
mocks = { | ||
'Magento_Checkout/js/action/place-order': jasmine.createSpy('placeOrderAction'), | ||
'Magento_CheckoutAgreements/js/model/agreements-assigner': jasmine.createSpy('agreementsAssigner') | ||
}, | ||
defaultContext = require.s.contexts._, | ||
mixin, | ||
placeOrderAction; | ||
|
||
beforeEach(function (done) { | ||
window.checkoutConfig = { | ||
checkoutAgreements: { | ||
isEnabled: true | ||
} | ||
}; | ||
injector.mock(mocks); | ||
injector.require([ | ||
'Magento_CheckoutAgreements/js/model/place-order-mixin', | ||
'Magento_Checkout/js/action/place-order' | ||
], function (Mixin, placeOrder) { | ||
mixin = Mixin; | ||
placeOrderAction = placeOrder; | ||
done(); | ||
}); | ||
}); | ||
|
||
describe('Magento_CheckoutAgreements/js/model/place-order-mixin', function () { | ||
it('mixin is applied to Magento_Checkout/js/action/place-order', function () { | ||
var placeOrderMixins = defaultContext.config.config.mixins['Magento_Checkout/js/action/place-order']; | ||
|
||
expect(placeOrderMixins['Magento_CheckoutAgreements/js/model/place-order-mixin']).toBe(true); | ||
}); | ||
|
||
it('Magento_CheckoutAgreements/js/model/agreements-assigner is called', function () { | ||
var messageContainer = jasmine.createSpy('messageContainer'), | ||
paymentData = {}; | ||
|
||
mixin(placeOrderAction)(paymentData, messageContainer); | ||
expect(mocks['Magento_CheckoutAgreements/js/model/agreements-assigner']) | ||
.toHaveBeenCalledWith(paymentData); | ||
expect(mocks['Magento_Checkout/js/action/place-order']) | ||
.toHaveBeenCalledWith(paymentData, messageContainer); | ||
}); | ||
}); | ||
}); |
56 changes: 56 additions & 0 deletions
56
...p/code/Magento/CheckoutAgreements/frontend/js/model/set-payment-information-mixin.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
define([ | ||
'squire' | ||
], function (Squire) { | ||
'use strict'; | ||
|
||
var injector = new Squire(), | ||
mocks = { | ||
'Magento_Checkout/js/action/set-payment-information': jasmine.createSpy('placeOrderAction'), | ||
'Magento_CheckoutAgreements/js/model/agreements-assigner': jasmine.createSpy('agreementsAssigner') | ||
}, | ||
defaultContext = require.s.contexts._, | ||
mixin, | ||
placeOrderAction; | ||
|
||
beforeEach(function (done) { | ||
window.checkoutConfig = { | ||
checkoutAgreements: { | ||
isEnabled: true | ||
} | ||
}; | ||
injector.mock(mocks); | ||
injector.require([ | ||
'Magento_CheckoutAgreements/js/model/set-payment-information-mixin', | ||
'Magento_Checkout/js/action/set-payment-information' | ||
], function (Mixin, setPaymentInformation) { | ||
mixin = Mixin; | ||
placeOrderAction = setPaymentInformation; | ||
done(); | ||
}); | ||
}); | ||
|
||
describe('Magento_CheckoutAgreements/js/model/set-payment-information-mixin', function () { | ||
it('mixin is applied to Magento_Checkout/js/action/set-payment-information', function () { | ||
var placeOrderMixins = defaultContext | ||
.config.config.mixins['Magento_Checkout/js/action/set-payment-information']; | ||
|
||
expect(placeOrderMixins['Magento_CheckoutAgreements/js/model/set-payment-information-mixin']).toBe(true); | ||
}); | ||
|
||
it('Magento_CheckoutAgreements/js/model/agreements-assigner is called', function () { | ||
var messageContainer = jasmine.createSpy('messageContainer'), | ||
paymentData = {}; | ||
|
||
mixin(placeOrderAction)(messageContainer, paymentData); | ||
expect(mocks['Magento_CheckoutAgreements/js/model/agreements-assigner']) | ||
.toHaveBeenCalledWith(paymentData); | ||
expect(mocks['Magento_Checkout/js/action/set-payment-information']) | ||
.toHaveBeenCalledWith(messageContainer, paymentData); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.