Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IBAN conversion validation #588

Merged
merged 7 commits into from Aug 3, 2016
Merged

Fix IBAN conversion validation #588

merged 7 commits into from Aug 3, 2016

Conversation

gbirke
Copy link
Member

@gbirke gbirke commented Jul 26, 2016

@KaiNissen
Copy link
Contributor

This reintroduces phab:T140476, which should have been fixed by #568, but apparently wasn't.

The forms were sending empty fields to the server, sometimes even
incorrect fields (See https://phabricator.wikimedia.org/T141381). This
was introduced by #568,
which was not the correct fix for the issue.
@gbirke gbirke changed the title Add missing parameters for BankDataValidator Fix IBAN conversion validation Jul 28, 2016
@JeroenDeDauw
Copy link
Contributor

I supposed Kai's comment has been addressed since the commit is more recent now... +1 as I don't see anything obviously wrong, though then I don't understand the code well enough to catch a lot of things.

If this is something that was wrong and then not fully fixed and reintroduced, having a test for it seems real nice. Is that difficult to do nicely in this case?

@@ -97,6 +100,10 @@ var jQuery = require( 'jquery' ),
};
validationUrl = this.validationUrlForNonSepa;
}
// avoid sending incomplete data to the server
if ( _.find( data, isEmptyString ) !== undefined ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It took me a good number of seconds to fully interpret what this is doing, promoting me to create f6c2b02. As it is here, you need to deal with not relevant low level details such as the behaviour of the _.find function.

As I found out there, there is no need for such a general check, or for the local variables in this method. 646dcc9

PR: #591

JeroenDeDauw and others added 2 commits July 29, 2016 06:40
@gbirke
Copy link
Member Author

gbirke commented Jul 29, 2016

I think for testing this behavior, you really need a browser test, that simulates a user clicking in the interface.

@KaiNissen
Copy link
Contributor

There is one tiny bit missing: If I switch from direct debit to any other payment method, the bank data fields are empty and receive a green validity indicator in all cases (were valid before, were invalid before, were already empty).

Apart from the `OK` and `ERR` states we had `INCOMPLETE`. `Now they are
all bundled up in a value object.

For the bank data validation the state `NOT_APPLICABLE` was added to
avoid sending data to the server and changing the validation state when
a different payment method thank direct debit is selected.
@gbirke
Copy link
Member Author

gbirke commented Aug 1, 2016

Addressed comment from @KaiNissen

@JeroenDeDauw Could you merge this?

@JeroenDeDauw JeroenDeDauw merged commit eaff563 into master Aug 3, 2016
@JeroenDeDauw JeroenDeDauw deleted the fix-iban-check branch August 3, 2016 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants