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

fix(PrismicLink): do not warn about missing field properties if the Link field is empty #163

Merged
merged 1 commit into from
Jul 30, 2022

Conversation

angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Jul 30, 2022

Types of changes

  • Chore (a non-breaking change which is related to package maintenance)
  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This PR fixes a bug in <PrismicLink> where it logged a console warning about missing Link field properties when given an empty Link field value. Empty link values are valid and should not trigger the warning.

The issue was unknown because the test to check this exact case was written incorrectly (see the fix).

Fixes #161

Thanks to @ReeceM for uncovering the issue!

Checklist:

  • My change requires an update to the official documentation.
  • All TSDoc comments are up-to-date and new ones have been added where necessary.
  • All new and existing tests are passing.

🐈

@codecov-commenter
Copy link

Codecov Report

Merging #163 (6db944e) into master (5be1649) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #163      +/-   ##
==========================================
+ Coverage   91.61%   91.64%   +0.02%     
==========================================
  Files          18       18              
  Lines         334      335       +1     
  Branches       84       85       +1     
==========================================
+ Hits          306      307       +1     
  Misses          5        5              
  Partials       23       23              
Impacted Files Coverage Δ
src/PrismicLink.tsx 94.11% <100.00%> (+0.11%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5be1649...6db944e. Read the comment docs.

@github-actions
Copy link

size-limit report 📦

Path Size
dist/index.js 5.66 KB (+0.16% 🔺)
dist/index.cjs 7.19 KB (+0.13% 🔺)

@angeloashmore angeloashmore merged commit b138472 into master Jul 30, 2022
@angeloashmore angeloashmore deleted the aa/fix-prismiclink-warning-on-empty-field branch July 30, 2022 02:43
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.

PrismicLink: Missing Link Properties error message isn't helpful enough
2 participants