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

[aform, atable] update test coverage for Stonecrop packages #117

Merged
merged 13 commits into from
Jun 3, 2024

Conversation

Alchez
Copy link
Collaborator

@Alchez Alchez commented Apr 22, 2024

Closes #108.


Todo:

  • ATable components
    • AExpansionRow
    • ARow

@Alchez Alchez requested a review from agritheory April 22, 2024 12:29
@Alchez
Copy link
Collaborator Author

Alchez commented Apr 23, 2024

@agritheory This PR switches the Vitest reporter from v8 to istanbul.

For building the coverage report, Vitest defaults to the v8 reporter. Unfortunately, v8's AST considers things like style tags inside Vue files as something that requires testing as well, which means our coverage reports will always have some in-built inaccuracies.

On the other hand, the istanbul reporter has much finer control over what counts as coverage, and it seems to report general coverage better as well. Additionally, the docs over at v8 says that they're trying to integrate the reporter's coverage information into istanbul as well.

@Alchez Alchez force-pushed the fix-test-coverage branch from 83dcaa6 to 2e8753c Compare April 23, 2024 07:18
@Alchez Alchez changed the title [aform, atable] update test coverage for AForm components [aform, atable] update test coverage for Stonecrop packages Apr 24, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

Coverage Report for ./atable

Status Category Percentage Covered / Total
🟢 Lines 73.44% (🎯 70%) 130 / 177
🟢 Statements 73.07% (🎯 70%) 133 / 182
🟢 Functions 78.12% (🎯 70%) 25 / 32
🔴 Branches 47.79% (🎯 70%) 65 / 136
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
atable/src/components/ACell.vue 94.64% 56.75% 100% 94.64% 64, 104-107, 158
atable/src/components/ARow.vue 55.17% 47.82% 60% 55.17% 49, 54, 60-68, 61-65, 62, 64, 67, 80, 84, 86-91, 87-90, 93-98, 12
atable/src/components/ATable.vue 88.46% 50% 100% 91.66% 156-158, 157, 157
Unchanged Files
atable/src/components/AExpansionRow.vue 0% 0% 0% 0% 23, 36-38, 40-42, 41, 44-63, 45-51, 47-49, 53-55, 54, 57-62, 1, 3
atable/src/components/ATableHeader.vue 100% 50% 100% 100%
atable/src/components/ATableModal.vue 75% 100% 0% 75% 21
atable/src/components/index.ts 70.45% 50% 88.88% 71.42% 47-49, 48, 61, 104-116, 105-113, 106-112, 108-111, 110, 114-116, 115
Generated in workflow #225

Copy link
Contributor

github-actions bot commented May 6, 2024

Coverage Report for ./aform

Status Category Percentage Covered / Total
🟢 Lines 90.35% (🎯 70%) 206 / 228
🟢 Statements 90.47% (🎯 70%) 209 / 231
🟢 Functions 87.5% (🎯 70%) 42 / 48
🟢 Branches 74.44% (🎯 70%) 67 / 90
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
aform/src/components/form/ADate.vue 85.71% 50% 100% 85.71% 42
aform/src/components/form/ADatePicker.vue 96.61% 90% 92.85% 96.49% 65, 27
aform/src/components/form/ADropdown.vue 91.83% 76.92% 84.61% 91.83% 55, 84-85, 93
aform/src/components/form/AFieldset.vue 90% 100% 50% 90% 8
aform/src/components/form/ATextInput.vue 100% 100% 100% 100%
aform/src/components/utilities/Login.vue 88.88% 81.81% 100% 88.88% 82-84
aform/src/directives/mask.ts 84.09% 59.09% 100% 83.72% 32-33, 40, 49, 64, 97, 102
Unchanged Files
aform/src/components/AForm.vue 90% 40% 85.71% 90% 41-43, 42
aform/src/components/base/CollapseButton.vue 100% 100% 100% 100%
aform/src/components/form/ACheckbox.vue 100% 100% 100% 100%
aform/src/components/form/AComboBox.vue 0% 100% 0% 0% 2-1, 7-3
aform/src/components/form/ANumericInput.vue 100% 100% 100% 100%
Generated in workflow #225

@Alchez Alchez force-pushed the fix-test-coverage branch from 1f4e3b2 to ba323c5 Compare May 8, 2024 06:55
@Alchez
Copy link
Collaborator Author

Alchez commented May 8, 2024

@agritheory, the aform application code was pretty useful to test with Vitest since it's all isolated components with unique functions that can be tested headlessly.

However, I'm writing atable tests and I'm wondering if those are better suited to be written in a non-headless, browser framework Cypress or WebdriverIO. This is mostly because the components are coupled and there's a lot of visual assertions to be possibly made on the components based on the usage options (and Istanbul/v8 are erratic with coverage on child components).

What do you think?

@agritheory agritheory marked this pull request as ready for review May 31, 2024 13:51
@Alchez Alchez force-pushed the fix-test-coverage branch from 033702c to b236193 Compare June 3, 2024 11:10
@Alchez Alchez merged commit dd188cc into development Jun 3, 2024
5 of 6 checks passed
@Alchez Alchez deleted the fix-test-coverage branch June 3, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[project] Bring test coverage to minimum thresholds (>70%)
2 participants