Follow-up from "Resolve "User can create on-call rotation with negative length""
The following discussion from !110210 (merged) should be addressed:
-
@f_caplette started a discussion: (+2 comments) Question I wonder if we could assert that the error message is shown in the UI instead of asserting that the validationState is
false
🤔 That way we could avoid implementation details and focus on asserting the UI, which would be closer to the UX. Is this applicable here?
Changing shallowMount
to extendedShallowMount
, so I can use .getByText()
, didn't help and I was getting an error ErrorWrapper { selector: 'byText' }
I guess (still only my 3rd month of using Vue) that is because the tests for form validation are in the outer component spec (ee/spec/frontend/oncall_schedule/rotations/components/add_edit_rotation_modal_spec.js
). I'm thinking about an issue for refactoring, to move validation tests to ee/spec/frontend/oncall_schedule/rotations/components/add_edit_rotation_form_spec.js
and change assertions to validation messages.