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

add model-based test for data entry #949

Merged
merged 10 commits into from
Feb 6, 2025

Conversation

jschuurk-kr
Copy link
Contributor

Scope

  • add model-based test for data entry
  • make the test check that the events and states in the machine match the events and states in the test

Questions

It would be nice to only check once that the events and states in the machine match the events and states in the test. However, the events and states in the test require the Playwright fixtures page, pollingStation, election. So I don't think there's a way to do this. If you know of a solution, please share!

I made the model-based tests part of the e2e tests. So this PR adds 3 x 23 tests to the e2e tests. Part of issue #898 Change PollingStation.test.tsx to Playwright tests is to check the coverage of the e2e tests, because I think there currently is some overlap between the existing e2e tests, the model-based tests in this PR, and the tests in PollingStation.test.tsx.

@jschuurk-kr jschuurk-kr added the tests Issues or pull requests that relate to tests label Feb 3, 2025
@jschuurk-kr jschuurk-kr self-assigned this Feb 3, 2025
@jschuurk-kr jschuurk-kr requested a review from a team as a code owner February 3, 2025 12:31
@jschuurk-kr jschuurk-kr linked an issue Feb 3, 2025 that may be closed by this pull request
4 tasks
Copy link

codecov bot commented Feb 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.80%. Comparing base (8946e1b) to head (7be330f).
Report is 4 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #949   +/-   ##
=======================================
  Coverage   89.80%   89.80%           
=======================================
  Files         238      238           
  Lines       12561    12561           
  Branches     1281     1281           
=======================================
  Hits        11281    11281           
  Misses       1191     1191           
  Partials       89       89           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Feb 3, 2025

Sigrid maintainability feedback

💭️ You did not change any files that are measured by Sigrid


View this system in Sigrid

cikzh
cikzh previously approved these changes Feb 4, 2025
Copy link
Contributor

@cikzh cikzh left a comment

Choose a reason for hiding this comment

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

Looks good! I understand what's going on and I verified that the tests are actually run. I've sampled some tests through the Playwright UI to see that the tests are sane.
I'm experiencing some flakiness testing locally, but I'm convinced that this is unrelated to this PR

@jschuurk-kr
Copy link
Contributor Author

On Wednesday 5 Feb after standup @oliver3 and I will discuss if there's a way to check only once there's code for all events and steps in the state machine.

@praseodym
Copy link
Contributor

@jschuurk-kr this branch has a merge conflict, could you resolve that? lgtm otherwise

@jschuurk-kr jschuurk-kr added this pull request to the merge queue Feb 6, 2025
Merged via the queue into main with commit 5bf85b1 Feb 6, 2025
21 checks passed
@jschuurk-kr jschuurk-kr deleted the 933-add-model-based-test-for-data-entry branch February 6, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Issues or pull requests that relate to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add model-based test for data entry
5 participants