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

Update formfiller to support elements with type datetime #238

Merged
merged 6 commits into from
Sep 12, 2023

Conversation

kennsippell
Copy link
Member

@kennsippell
Copy link
Member Author

Hey @freddieptf Would you have a few minutes to review this?

@kennsippell
Copy link
Member Author

@freddieptf Ping


it('#234 - fill datetime expected input format', () => {
return expect(harness.fillForm('bug_234', ['2023-01-01']))
.to.be.rejectedWith('expect input in format');
Copy link
Contributor

Choose a reason for hiding this comment

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

This error message is just for the test and not what is actually thrown, yes?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the actual error throw. The assertion here confirms the substring is present.

expect(result.errors).to.be.empty;
});

it('#234 - fill datetime expected input format', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe this can be a bit more descriptive, like fill datetime expected correct input format so intent is clear at a glance

Copy link
Member Author

Choose a reason for hiding this comment

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

good idea. i've updated the names for all tests

});

it('#234 - datetime field is required', async () => {
const result = await harness.fillForm('bug_234', ['2023-01-01 x']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not fail with the input format error?

Copy link
Member Author

@kennsippell kennsippell Sep 7, 2023

Choose a reason for hiding this comment

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

Currently the form filler is pretty dumb: it just checks that there is a delimited input and it puts the first value in the first box + the second input in the second box.

I think this is probably a good design decision for a test tool. Ideally, test tools would be able to test whatever inputs a human can provide. If the form filler only filled vaild well-formed inputs in the proper format, then it is actually a less useful test tool.

This test is failing because the input is "fillable" but it is failing enketo's validation. I've updated the test name to reflect that.

Copy link
Contributor

Choose a reason for hiding this comment

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

oh i see, thanks for clearing that up

@kennsippell kennsippell merged commit 6a327de into master Sep 12, 2023
2 checks passed
@kennsippell kennsippell deleted the 234-datetime-field branch September 12, 2023 04:15
@medic-ci
Copy link

medic-ci commented Apr 9, 2024

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants