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

requireSameDimensions property is not working #1557

Closed
rrojas-prmnt opened this issue Mar 4, 2024 · 1 comment · Fixed by #1558
Closed

requireSameDimensions property is not working #1557

rrojas-prmnt opened this issue Mar 4, 2024 · 1 comment · Fixed by #1558

Comments

@rrojas-prmnt
Copy link

rrojas-prmnt commented Mar 4, 2024

According to the documentation, we can set the 'requireSameDimensions' property to 'false' if we do not want to trigger a failed test when the dimensions are not equal. However, after debugging, I discovered that the 'requireSameDimensions' property will never receive a value of 'false' because it is being ignored in this condition.

return scenario?.requireSameDimensions || config?.requireSameDimensions || config?.defaultMisMatchThreshold || true;

it will always fall into the next property and if these are also a falsy value, will always default to true. Which makes this function not working fine.

I think it should be:

return scenario?.requireSameDimensions ?? config?.requireSameDimensions ?? config?.defaultMisMatchThreshold ?? true;
@rrojas-prmnt rrojas-prmnt changed the title requireSameDimensions property is not working requireSameDimensions property is not working Mar 4, 2024
dgrebb added a commit to dgrebb/BackstopJS that referenced this issue Mar 5, 2024
…ult `misMatchThreshold` and `requireSameDimensions` values (garris#1557)
@dgrebb
Copy link
Contributor

dgrebb commented Mar 5, 2024

Thanks for catching this @rrojas-prmnt; this is my mistake.

Fixed in #1558 along with misMatchThreshold, which was using the same—incorrect—pattern.

garris pushed a commit that referenced this issue Mar 5, 2024
…ult `misMatchThreshold` and `requireSameDimensions` values (#1557) (#1558)
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 a pull request may close this issue.

2 participants