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

[PUI] Test for errors in console #7114

Merged
merged 17 commits into from
Apr 25, 2024

Conversation

matmair
Copy link
Contributor

@matmair matmair commented Apr 23, 2024

This PR adds a fixture to the base test to ensures that not errors are raised on the console.

It also fixes a few common errors:

  • missing keys
  • duplicate keys
  • unstable keys (re-renders)
  • wrong nesting of objects (a td directly within a table)

A few errors are ignored for reporting:

  • errors that start with ERR: - those are mainly fetching actions, which are taken at the start of a user sessions and might still be unauthenticated
  • chrome internal errors
  • API calls to the barcode API - which is called with failing commands in the tests

@matmair matmair added CI CI / unit testing ecosystem Platform UI Related to the React based User Interface labels Apr 23, 2024
@matmair matmair added this to the 0.15.0 milestone Apr 23, 2024
@matmair matmair self-assigned this Apr 23, 2024
Copy link

netlify bot commented Apr 23, 2024

Deploy Preview for inventree-web-pui-preview ready!

Name Link
🔨 Latest commit 96a5bd2
🔍 Latest deploy log https://app.netlify.com/sites/inventree-web-pui-preview/deploys/66294724c1d9100008201594
😎 Deploy Preview https://deploy-preview-7114--inventree-web-pui-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (no change from production)
Accessibility: 86 (no change from production)
Best Practices: 100 (no change from production)
SEO: 70 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 30.00000% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 83.81%. Comparing base (5f54aef) to head (96a5bd2).

Files Patch % Lines
src/frontend/src/states/ApiState.tsx 0.00% 2 Missing ⚠️
src/frontend/src/states/SettingsState.tsx 0.00% 2 Missing ⚠️
src/frontend/src/states/UserState.tsx 0.00% 2 Missing ⚠️
src/frontend/src/states/StatusState.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7114      +/-   ##
==========================================
+ Coverage   83.44%   83.81%   +0.36%     
==========================================
  Files        1039     1039              
  Lines       45731    45732       +1     
  Branches     1279     1279              
==========================================
+ Hits        38162    38328     +166     
+ Misses       7285     7111     -174     
- Partials      284      293       +9     
Flag Coverage Δ
pui 61.41% <30.00%> (+2.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@matmair matmair marked this pull request as ready for review April 24, 2024 05:39
@matmair
Copy link
Contributor Author

matmair commented Apr 25, 2024

@SchrodingersGat this is ready for review; the non-covered code from the patch would require a lengthy new test suite so I would like to cover this at a later point

@SchrodingersGat
Copy link
Member

Thanks @matmair this is a great addition to the testing framework

@SchrodingersGat SchrodingersGat merged commit b5b0ff2 into inventree:master Apr 25, 2024
26 of 27 checks passed
@SchrodingersGat SchrodingersGat deleted the pui-test-for-errors branch April 25, 2024 09:26
@matmair
Copy link
Contributor Author

matmair commented Apr 26, 2024

@SchrodingersGat trying to get PUI testing baseline build out as hard as I can ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI CI / unit testing ecosystem Platform UI Related to the React based User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants