Skip to content

Commit

Permalink
fix(customer): CHECKOUT-4739 Rename hasAccount to shouldEncourageSign…
Browse files Browse the repository at this point in the history
…In (#262)
  • Loading branch information
Luis Sanchez authored Apr 16, 2020
1 parent 134e5cd commit 26ceb63
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/app/customer/Customer.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,12 +248,12 @@ describe('Customer', () => {
expect(handleChangeViewType).toHaveBeenCalledWith(CustomerViewType.CancellableEnforcedLogin);
});

it('renders SuggestedLogin form if continue as guest returns truthy hasAccount', async () => {
it('renders SuggestedLogin form if continue as guest returns truthy shouldEncourageSignIn', async () => {
jest.spyOn(checkoutService.getState().data, 'getCustomer')
.mockReturnValue({
...getCustomer(),
isGuest: true,
hasAccount: true,
shouldEncourageSignIn: true,
} as any);

jest.spyOn(checkoutService, 'continueAsGuest')
Expand Down
4 changes: 2 additions & 2 deletions src/app/customer/Customer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ class Customer extends Component<CustomerProps & WithCheckoutCustomerProps> {
});

// todo: remove when SDK has been updated
const { hasAccount, isGuest } = data.getCustomer() as unknown as CustomerType & { hasAccount: boolean };
const { shouldEncourageSignIn, isGuest } = data.getCustomer() as unknown as CustomerType & { shouldEncourageSignIn: boolean };

if (hasAccount && isGuest) {
if (shouldEncourageSignIn && isGuest) {
return onChangeViewType(CustomerViewType.SuggestedLogin);
}

Expand Down

0 comments on commit 26ceb63

Please sign in to comment.