Skip to content

Commit ebe03c2

Browse files
committed
Merge remote-tracking branch 'magento-mpi/MC-21756' into MPI-PR-2019-10-18
2 parents 171853b + aff179a commit ebe03c2

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

app/code/Magento/Checkout/view/frontend/web/js/view/form/element/email.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ define([
185185
* @returns {Boolean} - initial visibility state.
186186
*/
187187
resolveInitialPasswordVisibility: function () {
188+
if (checkoutData.getInputFieldEmailValue() !== '' && checkoutData.getCheckedEmailValue() === '') {
189+
return true;
190+
}
191+
188192
if (checkoutData.getInputFieldEmailValue() !== '') {
189193
return checkoutData.getInputFieldEmailValue() === checkoutData.getCheckedEmailValue();
190194
}

app/code/Magento/Persistent/Model/QuoteManager.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ public function convertCustomerCartToGuest()
121121
->setCustomerEmail(null)
122122
->setCustomerFirstname(null)
123123
->setCustomerLastname(null)
124-
->setCustomerGroupId(\Magento\Customer\Api\Data\GroupInterface::NOT_LOGGED_IN_ID)
125124
->setIsPersistent(false);
126125
$quote->getAddressesCollection()->walk('setCustomerAddressId', ['customerAddressId' => null]);
127126
$quote->getAddressesCollection()->walk('setCustomerId', ['customerId' => null]);

app/code/Magento/Persistent/Test/Unit/Model/QuoteManagerTest.php

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,28 @@ protected function setUp()
5555
{
5656
$this->persistentSessionMock = $this->createMock(\Magento\Persistent\Helper\Session::class);
5757
$this->sessionMock =
58-
$this->createPartialMock(\Magento\Persistent\Model\Session::class, [
58+
$this->createPartialMock(
59+
\Magento\Persistent\Model\Session::class,
60+
[
5961
'setLoadInactive',
6062
'setCustomerData',
6163
'clearQuote',
6264
'clearStorage',
6365
'getQuote',
6466
'removePersistentCookie',
6567
'__wakeup',
66-
]);
68+
]
69+
);
6770
$this->persistentDataMock = $this->createMock(\Magento\Persistent\Helper\Data::class);
6871
$this->checkoutSessionMock = $this->createMock(\Magento\Checkout\Model\Session::class);
6972

7073
$this->abstractCollectionMock =
7174
$this->createMock(\Magento\Eav\Model\Entity\Collection\AbstractCollection::class);
7275

7376
$this->quoteRepositoryMock = $this->createMock(\Magento\Quote\Api\CartRepositoryInterface::class);
74-
$this->quoteMock = $this->createPartialMock(\Magento\Quote\Model\Quote::class, [
77+
$this->quoteMock = $this->createPartialMock(
78+
\Magento\Quote\Model\Quote::class,
79+
[
7580
'getId',
7681
'getIsPersistent',
7782
'getPaymentsCollection',
@@ -90,7 +95,8 @@ protected function setUp()
9095
'getIsActive',
9196
'getCustomerId',
9297
'__wakeup'
93-
]);
98+
]
99+
);
94100

95101
$this->model = new QuoteManager(
96102
$this->persistentSessionMock,
@@ -258,21 +264,22 @@ public function testConvertCustomerCartToGuest()
258264
->method('setCustomerFirstname')->with(null)->willReturn($this->quoteMock);
259265
$this->quoteMock->expects($this->once())
260266
->method('setCustomerLastname')->with(null)->willReturn($this->quoteMock);
261-
$this->quoteMock->expects($this->once())->method('setCustomerGroupId')
262-
->with(\Magento\Customer\Model\GroupManagement::NOT_LOGGED_IN_ID)
267+
$this->quoteMock->expects($this->never())->method('setCustomerGroupId')
263268
->willReturn($this->quoteMock);
264269
$this->quoteMock->expects($this->once())
265270
->method('setIsPersistent')->with(false)->willReturn($this->quoteMock);
266271
$this->quoteMock->expects($this->exactly(3))
267272
->method('getAddressesCollection')->willReturn($this->abstractCollectionMock);
268-
$this->abstractCollectionMock->expects($this->exactly(3))->method('walk')->with($this->logicalOr(
269-
$this->equalTo('setCustomerAddressId'),
270-
$this->equalTo($addressArgs),
271-
$this->equalTo('setCustomerId'),
272-
$this->equalTo($customerIdArgs),
273-
$this->equalTo('setEmail'),
274-
$this->equalTo($emailArgs)
275-
));
273+
$this->abstractCollectionMock->expects($this->exactly(3))->method('walk')->with(
274+
$this->logicalOr(
275+
$this->equalTo('setCustomerAddressId'),
276+
$this->equalTo($addressArgs),
277+
$this->equalTo('setCustomerId'),
278+
$this->equalTo($customerIdArgs),
279+
$this->equalTo('setEmail'),
280+
$this->equalTo($emailArgs)
281+
)
282+
);
276283
$this->quoteMock->expects($this->once())->method('collectTotals')->willReturn($this->quoteMock);
277284
$this->persistentSessionMock->expects($this->once())
278285
->method('getSession')->willReturn($this->sessionMock);

0 commit comments

Comments
 (0)