-
Notifications
You must be signed in to change notification settings - Fork 178
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
MWPW-152455 added handling of "no placeholders" case for parsePlaceholders() #3007
Conversation
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## stage #3007 +/- ##
=======================================
Coverage 96.34% 96.34%
=======================================
Files 243 243
Lines 55284 55286 +2
=======================================
+ Hits 53261 53263 +2
Misses 2023 2023 ☔ View full report in Codecov by Sentry. |
@@ -655,17 +655,19 @@ function parsePlaceholders(placeholders, config, selectedVariantName = '') { | |||
'value', | |||
'other', | |||
]; | |||
const [val] = Object.entries(placeholders[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was breaking here, where it was trying to deconstruct an array that was found by find
function. But when nothing was found const [val]
would break because undefined is treated like an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like this breaks a commerce nala placeholder test, otherwise lgtm!
Resolves: MWPW-152455
QA Instructions: The before link has an error message the after link does not:
MEP Error parsing manifests: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))
Test URLs:
Psi-check: https://mwpw-152455--milo--adobecom.hlx.page/?martech=off