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

Component Tests for RoarDataTable #856

Merged
merged 14 commits into from
Oct 9, 2024
Merged

Conversation

ksmontville
Copy link
Collaborator

@ksmontville ksmontville commented Oct 7, 2024

Proposed changes

This PR introduces component tests for RoarDataTable.vue component. It creates randomized mock input data which is used to test the various filtering functions of the component.

This PR also refactors the filterbar slot of RoarDataTable.vue into its own component FilterBar.vue. This component uses a new composable function useFilteredTableData.js which handles the filtering logic.

There are also some small changes to the Cypress directory structure.

Overall, this PR helps to simplify the ScoreReports.vue component and makes the filtering tests for RoarDataTable.vue more resilient.

MAJOR CHANGES:

  1. More resilient filtering component tests, using randomly generated data fixtures which accurately mock production score report data
  2. Refactor filterbar slot into its own component
  3. Simplify filtering logic within score reports
  4. Minor changes to Cypress directory structure

Types of changes

What types of changes does this pull request introduce?

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactoring (non-breaking change that does not add functionality but makes code cleaner or more efficient)
  • Documentation Update
  • Tests (new or updated tests)
  • Style (changes to code styling)
  • CI (continuous integration changes)
  • Repository Maintenance
  • Other (please describe below)

Checklist

  • I have read the guidelines for contributing.
  • The changes in this PR are as small as they can be. They represent one and only one fix or enhancement.
  • Linting checks pass with my changes.
  • Any existing unit tests pass with my changes.
  • Any existing end-to-end tests pass with my changes.
  • I have added tests that prove my fix is effective or that my feature works.
  • If this PR fixes an existing issue, I have added a unit or end-to-end test that will detect if this issue reoccurs.
  • I have added JSDoc comments as appropriate.
  • I have added the necessary documentation to the roar-docs repository.
  • I have shared this PR on the roar-pr-reviews channel (if I have access)
  • I have linked relevant issues (if any)

Justification of missing checklist items

Further comments

@ksmontville ksmontville requested a review from a team as a code owner October 7, 2024 19:35
Copy link

github-actions bot commented Oct 7, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 0.98% 73 / 7431
🔵 Statements 0.9% 74 / 8165
🔵 Functions 0.77% 14 / 1812
🔵 Branches 0.44% 20 / 4454
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/components/RoarDataTable.vue 0% 0% 0% 0% 691, 602-607, 605-606, 609, 626-627, 629-633, 630-632, 631, 631, 634-635, 637-653, 655-674, 658-672, 660-669, 671, 673, 676-678, 677, 680, 682-688, 683-686, 684-685, 687, 690, 694-700, 695-696, 698-699, 701, 705-714, 716-748, 717-746, 721-723, 722, 725-727, 730-732, 731, 735-738, 736-737, 740-745, 741-744, 747, 750-751, 753-756, 754, 758-772, 759-769, 771, 776-782, 779-781, 780, 783, 786-799, 801-814, 816-821, 823-834, 836-847, 849-880, 865-878, 874-877, 876, 879, 882-887, 885-886, 886, 889-894, 892-893, 893, 896-901, 899-900, 900, 903-907, 905-906, 906, 909-913, 911-912, 912, 915-919, 917-918, 918, 922-924, 923-924, 927-929, 928, 928, 931, 931-938, 933, 933-937, 935-936, 940-941, 943-946, 944-945, 948, 1, 6, 8, 20, 22, 34, 36, 66-67, 120-122, 124, 138-140, 142, 156-158, 160, 174, 176, 180, 194, 196, 198, 212, 214, 216, 294, 308, 314, 325, 335, 346, 387, 406, 416, 426, 436, 446, 548-550, 55, 62, 1-75, 1-76, 123, 141, 159, 179, 197, 215, 1-265, 1-273, 1-280, 1-288, 1-293, 1-299, 1-353, 527
src/components/slots/FilterBar.vue 0% 0% 0% 0% 48, 63-64, 66-69, 67-68, 71-73, 72, 2, 11, 23, 26-27, 39, 1-14, 1-30
src/composables/useFilteredTableData.js 0% 0% 0% 0% 6-9, 8, 12, 15-27, 16, 18-20, 19, 19, 21-23, 22, 22, 26, 31-35, 32, 34, 37
src/pages/ScoreReport.vue 0% 0% 0% 0% 336, 294, 296, 298, 313, 315-320, 316-318, 317, 319, 322-326, 328-330, 329, 332, 334, 337, 337, 339-388, 340-342, 345-348, 347, 351, 353-372, 354-355, 355, 358-359, 361-364, 363, 366-368, 367, 369-371, 370, 375-378, 377, 379-385, 387, 390-399, 401-406, 402-405, 408, 411-417, 413, 418, 418-419, 419-420, 420, 422-428, 424, 430-436, 432, 439-445, 441, 447-456, 448-455, 449-452, 450-451, 454, 458-467, 459-466, 460-463, 461-462, 465, 469, 469, 476-482, 478, 486-517, 487-516, 488-516, 490-516, 492-516, 494-516, 499-505, 504, 506-516, 508-513, 510, 512, 514-516, 515, 518, 521-565, 533-536, 538-552, 543-549, 544-545, 547-548, 551, 554, 554-555, 555, 557-564, 570-821, 571-820, 572, 575, 577, 579-785, 581, 583-587, 586, 589-591, 593, 595-615, 617-778, 621-628, 625, 627, 629-633, 630, 632, 635-642, 636-642, 639, 641, 644-646, 645, 649, 652-661, 663-669, 664-669, 666-669, 668, 671, 674-685, 687-721, 688-721, 697-698, 700-721, 709, 711-720, 722-740, 723-733, 731, 734, 736-739, 741-754, 742-746, 746-747, 747-748, 748-753, 757-771, 773-777, 774, 776, 781-782, 784, 788-813, 789-792, 791, 794-797, 796, 799-809, 801-806, 805, 807-809, 808, 811-812, 815-817, 816, 819, 824-825, 829-834, 830, 832, 836, 838-843, 845-915, 846-907, 847-855, 854, 856-858, 857, 859-905, 860-881, 862-881, 866-881, 871-881, 874, 876-877, 879-880, 882-904, 883-901, 885-898, 886-888, 887, 889-894, 890, 892, 892-893, 896, 896-897, 900, 903, 906, 908-914, 917-989, 918-981, 919-928, 927, 929-931, 930, 932-979, 933-954, 935-954, 939-954, 944-954, 947, 949-950, 952-953, 956-978, 957-975, 959-972, 960-962, 961, 963-968, 964, 966, 966-967, 970, 970-971, 974, 977, 980, 982-988, 992-993, 996, 998-1036, 999-1005, 1007-1013, 1009-1012, 1010-1011, 1015, 1015, 1017-1018, 1020-1021, 1021, 1023-1034, 1024-1034, 1031-1034, 1033, 1035, 1040-1229, 1041, 1041-1066, 1056-1065, 1067-1076, 1067-1075, 1077-1090, 1077-1089, 1079-1086, 1088, 1091-1093, 1091-1092, 1095, 1097-1108, 1098-1107, 1110-1118, 1111-1117, 1120-1126, 1121-1125, 1122, 1124, 1128-1134, 1137-1143, 1138-1142, 1139-1141, 1140, 1146-1151, 1154-1158, 1155-1157, 1156, 1160-1227, 1162, 1165-1193, 1166-1193, 1173-1193, 1180, 1182-1192, 1183-1192, 1185-1192, 1187-1192, 1189, 1191, 1195, 1197-1207, 1204, 1206, 1209-1226, 1221-1223, 1222, 1224, 1228, 1231-1235, 1232-1234, 1233, 1233-1234, 1237-1248, 1238-1239, 1239-1240, 1240, 1242-1244, 1243, 1246-1247, 1250-1254, 1251-1253, 1252, 1257-1263, 1258-1259, 1259, 1261-1262, 1265-1267, 1266, 1266, 1269-1274, 1270-1273, 1273, 2-3, 5, 8, 11-12, 14-15, 20-21, 26, 28, 1, 55, 58-59, 61, 70-71, 74, 88-89, 95, 101, 108, 116, 136, 149, 155, 161, 167, 183, 234-235, 1-30, 1-139
Generated in workflow #590 for commit 00db06d by the Vitest Coverage Report Action

Copy link

cypress bot commented Oct 7, 2024

roar-dashboard-e2e    Run #7902

Run Properties:  status check passed Passed #7902  •  git commit 00db06d5df: E2E Tests for PR 856 "Component Tests for RoarDataTable" from commit "00db06d5df...
Project roar-dashboard-e2e
Run status status check passed Passed #7902
Run duration 03m 32s
Commit git commit 00db06d5df: E2E Tests for PR 856 "Component Tests for RoarDataTable" from commit "00db06d5df...
Committer Kyle
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 32

Copy link

github-actions bot commented Oct 7, 2024

Visit the preview URL for this PR (updated for commit 00db06d):

https://roar-staging--pr856-score-report-filteri-6ev85wqy.web.app

(expires Mon, 14 Oct 2024 21:47:01 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2631e9c58fd0104ecbfddd72a62245ddac467460

Copy link
Contributor

@Emily-ejag Emily-ejag left a comment

Choose a reason for hiding this comment

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

Amazing :)

@richford richford merged commit 5d08489 into main Oct 9, 2024
22 checks passed
@richford richford deleted the score-report-filtering-tests branch October 9, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants