There are three problems that might be confusing (because I ran up against it):
Current problem statement:
You will be supplied with streams of two different input-fields, each with their own validation function which takes a value as input and returns whether the value is valid or not.
What you should return is three observables which indicate whether the value observed is valid or not and an observable which indicates whether the field as a whole is valid.
Field A and C is required. Field B is optional, but if it has a value it must be valid.
Minor Typo
The problem statement says we are supplied with streams of two different input fields, but there are actually three that we deal with. I am guessing that this is a typo.
toProperty()
is required
The problem statement only specifies that we return observables indicating the validity of the form and fields. Although it may be clear to the experienced user that form validation results should be in the form of properties, I initially tried to submit the answer without converting the eventStreams to properties and got a cryptic error instead.
Consider adding a phrase in the problem statement to explain that the result should be a property because of the nature of the application. Or alternatively, add an extra test case to confirm that this is the case.
Initial value to toProperty()
is required
This is a little bit unintuitive because the problem statement does not say anything about initial values. In fact, at the time, I didn't even know that the toProperty()
method could take an initial value as parameter.
If you submit the answer without specifying an initial value for the toProperty()
method, you still get all the green checkmarks from the tests, but it won't actually verify the answer.