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

chore: adding unit test to test getNodeFromPath failures #5134

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

nadr0
Copy link
Collaborator

@nadr0 nadr0 commented Jan 22, 2025

relates #4850

Issue

When Jess sketched the final lineTo with close which which was invoked in sceneEntities.ts the code appeared to fail when finding a node in the function getNodeFromPath which produces a toast error.

Implementation

There are tons of calls to getNodeFromPath which is the location that the error not an object comes from. Retracing her steps I could not manually reproduce this error by using the application.

I followed the block of code in sceneEntities.ts:787 which goes into the block of snapping logic to snap back to the original point and create a lineTo and close block.

I implemented a set of unit tests to see if I can create this failure

   ✓ Testing specific sketch getNodeFromPath workflow (3)
     ✓ should parse the code
     ✓ should find the location to add new lineTo
     ✓ it should find the location to add close

I mimic the same code flow to call the code mods that need to call getNodeFromPath and in this example with the same exact code I was unable to reproduce that same error.

Copy link

qa-wolf bot commented Jan 22, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link

vercel bot commented Jan 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
modeling-app ✅ Ready (Inspect) Visit Preview Jan 25, 2025 0:37am

@nadr0 nadr0 requested review from jessfraz and lf94 January 22, 2025 21:29
@nadr0 nadr0 changed the title chore: adding unit test to test the parsing of the code chore: adding unit test to test getNodeFromPath failures Jan 22, 2025
Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.14%. Comparing base (440704e) to head (d06a16a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5134   +/-   ##
=======================================
  Coverage   86.14%   86.14%           
=======================================
  Files          89       89           
  Lines       32489    32489           
=======================================
  Hits        27987    27987           
  Misses       4502     4502           
Flag Coverage Δ
wasm-lib 86.14% <ø> (ø)

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.

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.

1 participant