You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the following test fails, despite the fact that unicorn is considered a valid string by the implementation of UsernameInput (not shown).
test('true when username is valid and not busy', () {
const state =RegistrationState(
username:UsernameInput.pure(value:'unicorn'),
isCheckingUsername:false,
status:RegistrationStatus.editing,
);
expect(state.canSubmit, true);
});
The reason for the failure is because the value of Formz.validate([username]) is FormzStatus.pure, rather than FormzStatus.valid.
I believe FormzInput shoulds have a separate field which tracks the field's purity. Additionally, it may be suitable to have a displayError property which is null when the field is pure, as UI's commonly disregard errors on unmodified (but incorrect) fields.
Formz currently (and incorrectly) conflates purity with validity.
Imagine a class which contains a username input field (which is un remarkable implementation of a
FormzInput
).Currently, the following test fails, despite the fact that
unicorn
is considered a valid string by the implementation ofUsernameInput
(not shown).The reason for the failure is because the value of
Formz.validate([username])
isFormzStatus.pure
, rather thanFormzStatus.valid
.I believe FormzInput shoulds have a separate field which tracks the field's purity. Additionally, it may be suitable to have a
displayError
property which is null when the field is pure, as UI's commonly disregard errors on unmodified (but incorrect) fields.The text was updated successfully, but these errors were encountered: