From 9ceda47810b08e71d51462ecbb3380395c94b59a Mon Sep 17 00:00:00 2001 From: Pablo Molina Date: Wed, 28 Mar 2018 14:49:26 +0200 Subject: [PATCH 1/6] :white_check_mark: Fix duplicate classname for different events (confirm|delete) --- src/components/savedAccounts/savedAccounts.js | 2 +- test/integration/accountSwitch.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/savedAccounts/savedAccounts.js b/src/components/savedAccounts/savedAccounts.js index 36524d63a9..5a7eb72b6e 100644 --- a/src/components/savedAccounts/savedAccounts.js +++ b/src/components/savedAccounts/savedAccounts.js @@ -168,7 +168,7 @@ class SavedAccounts extends React.Component { null } { this.state.editing ? - { step('Then I should see 3 instances of "saved account card"', () => helper.shouldSeeCountInstancesOf(3, '.saved-account-card')); step('When I click "edit button"', () => helper.clickOnElement('button.edit-button')); step('When I click "remove button"', () => helper.clickOnElement('button.remove-button')); - step('When I click "remove button"', () => helper.clickOnElement('button.remove-button')); + step('When I click "confirm button"', () => helper.clickOnElement('button.confirm-button')); step('Then I should see 2 instances of "saved account card"', () => helper.shouldSeeCountInstancesOf(2, '.saved-account-card')); }); @@ -105,7 +105,7 @@ describe('@integration: Account switch', () => { step('Then I should see 3 instances of "saved account card"', () => helper.shouldSeeCountInstancesOf(3, '.saved-account-card')); step('When I click "edit button"', () => helper.clickOnElement('button.edit-button')); step('When I click "remove button"', () => helper.clickOnElement('button.remove-button')); - step('When I click "remove button"', () => helper.clickOnElement('button.remove-button')); + step('When I click "confirm button"', () => helper.clickOnElement('button.confirm-button')); step('Then I should see 2 instances of "saved account card"', () => helper.shouldSeeCountInstancesOf(2, '.saved-account-card')); }); From d98594d4e8cbf8e65cc6bffce8b6bfff8b387111 Mon Sep 17 00:00:00 2001 From: Pablo Molina Date: Wed, 28 Mar 2018 18:09:09 +0200 Subject: [PATCH 2/6] :white_check_mark: fix saved accounts test --- src/components/savedAccounts/savedAccounts.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/savedAccounts/savedAccounts.test.js b/src/components/savedAccounts/savedAccounts.test.js index 91f4be5d18..b6ed5d4818 100644 --- a/src/components/savedAccounts/savedAccounts.test.js +++ b/src/components/savedAccounts/savedAccounts.test.js @@ -89,7 +89,7 @@ describe('SavedAccounts', () => { it('should call props.accountRemoved on the second "remove button" click', () => { wrapper.find('button.edit-button').simulate('click'); wrapper.find('button.remove-button').at(1).simulate('click'); - wrapper.find('button.remove-button').at(1).simulate('click'); + wrapper.find('button.confirm-button').at(1).simulate('click'); expect(props.accountRemoved).to.have.been.calledWith(savedAccounts[1]); }); From d85fc4bdb32ebbb6cabf7bd57b4a3e26735d5133 Mon Sep 17 00:00:00 2001 From: Pablo Molina Date: Wed, 28 Mar 2018 18:14:16 +0200 Subject: [PATCH 3/6] :recycle: fix after merge --- src/components/savedAccounts/accountCard.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/savedAccounts/accountCard.js b/src/components/savedAccounts/accountCard.js index 8377f0e7ca..3521206d50 100644 --- a/src/components/savedAccounts/accountCard.js +++ b/src/components/savedAccounts/accountCard.js @@ -49,7 +49,7 @@ const AccountCard = ({ account, t, isEditing, handleRemove, isSecureAppears, null } { isEditing ? - Date: Wed, 28 Mar 2018 18:27:28 +0200 Subject: [PATCH 4/6] :white_check_mark: Fix savedAccounts test --- src/components/savedAccounts/savedAccounts.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/savedAccounts/savedAccounts.test.js b/src/components/savedAccounts/savedAccounts.test.js index b6ed5d4818..f7efd57b5d 100644 --- a/src/components/savedAccounts/savedAccounts.test.js +++ b/src/components/savedAccounts/savedAccounts.test.js @@ -89,7 +89,7 @@ describe('SavedAccounts', () => { it('should call props.accountRemoved on the second "remove button" click', () => { wrapper.find('button.edit-button').simulate('click'); wrapper.find('button.remove-button').at(1).simulate('click'); - wrapper.find('button.confirm-button').at(1).simulate('click'); + wrapper.find('button.confirm-button').at(0).simulate('click'); expect(props.accountRemoved).to.have.been.calledWith(savedAccounts[1]); }); From 5e22d2ad5b4d28f8ec43abdbee5c9ec799b29d63 Mon Sep 17 00:00:00 2001 From: Pablo Molina Date: Thu, 29 Mar 2018 09:18:05 +0200 Subject: [PATCH 5/6] :white_check_mark: fix e2e, use confirm button --- test/e2e/savedAccounts.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e/savedAccounts.feature b/test/e2e/savedAccounts.feature index 57e80a75f4..cea8055cf4 100644 --- a/test/e2e/savedAccounts.feature +++ b/test/e2e/savedAccounts.feature @@ -42,7 +42,7 @@ Feature: Saved Accounts And I should see 2 instances of "saved account card" And I click "edit button" And I click "remove button" - And I click "remove button" + And I click "confirm button" And I click "edit button" Then I should see 1 instances of "saved account card" From 4dc0a950c694a36297783c1506258d5bd0b53a43 Mon Sep 17 00:00:00 2001 From: Vit Stanislav Date: Thu, 29 Mar 2018 14:45:46 +0200 Subject: [PATCH 6/6] :recycle: Use chai-enzyme in one more integration step definition --- test/utils/genericStepDefinition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/genericStepDefinition.js b/test/utils/genericStepDefinition.js index a897600dfb..42db4e5305 100644 --- a/test/utils/genericStepDefinition.js +++ b/test/utils/genericStepDefinition.js @@ -87,6 +87,6 @@ export default class GenericStepDefinition { * @param {String} selector - Valid css selector */ shouldSeeCountInstancesOf(count, selector) { - expect(this.wrapper.find(selector)).to.have.lengthOf(count); + expect(this.wrapper).to.have.exactly(count).descendants(selector); } }