We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
It seems like Percy is not being able to handle currency formatting correctly from 1.19.2 onwards, the issue is still occurring in 1.24.0.
1.19.2
1.24.0
Screenshots from Percy build:
Before 1.19.2:
After 1.19.2:
@percy/cli
We are currently using @percy/cypress with the cy.percySnapshot command for our visual tests.
@percy/cypress
cy.percySnapshot
Method responsible for formatting the currency:
export const formatCurrency = ( value: number | string = 0, currency: Currency = CURRENCIES.COP.VALUE ) => { const currencyFormatOptions = { currency, style: 'currency' } const parsedValue = parseFloat(value.toString()) if (isNaN(parsedValue)) throw 'Value must be a valid number' const currencyValue = parsedValue.toLocaleString( CURRENCIES[currency].LOCALE, currencyFormatOptions ) const regex = /([\d,.]+)/ const unit = currencyValue.replace(regex, '') const amount = currencyValue.match(regex)?.[0] const amountPosition = currencyValue.match(regex)?.index return { currencyValue, splitCurrency: { ...(!amountPosition && { amount }), unit, ...(amountPosition && { amount }) } }
The text was updated successfully, but these errors were encountered:
Can you share full end to end reproducible example?
Sorry, something went wrong.
Hey @samarsault, sure 😃
You can use this repo to reproduce the issue. On the README file you have the instructions on how to do it.
This issue is stale because it has been open for more than 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.
The issue is fixed in versions 1.24.2 onwards. Please update to latest release of percy/cli.
No branches or pull requests
The problem
It seems like Percy is not being able to handle currency formatting correctly from
1.19.2
onwards, the issue is still occurring in1.24.0
.Screenshots from Percy build:
Before
![Captura de pantalla 2023-05-03 a la(s) 11 11 19](https://user-images.githubusercontent.com/96124963/235941439-daad18fe-11be-441f-b6be-c50869b2a6a2.png)
1.19.2
:After
![Captura de pantalla 2023-05-03 a la(s) 11 11 27](https://user-images.githubusercontent.com/96124963/235941490-7c8c7e20-f432-4355-8dd9-99d4d4fbc7d0.png)
1.19.2
:Environment
@percy/cli
version: 1.19.2 (still happening in 1.24.0)Details
We are currently using
@percy/cypress
with thecy.percySnapshot
command for our visual tests.Code to reproduce issue
Method responsible for formatting the currency:
The text was updated successfully, but these errors were encountered: