-
Notifications
You must be signed in to change notification settings - Fork 296
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(input-stepper): add parseNumber and formatNumber to format the va… #2312
Conversation
…lue based on locale
🦋 Changeset detectedLatest commit: 602f29e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Looks good to me.
Just a few questions / possible typo but nothing blocking.
@@ -49,6 +50,50 @@ describe('<lion-input-stepper>', () => { | |||
}); | |||
}); | |||
|
|||
describe('Formatter', () => { | |||
it('uses formatAmount for formatting', async () => { |
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.
Did you mean formatNumber?
expect(el.formatter).to.equal(formatNumber); | ||
}); | ||
|
||
it('formatAmount uses locale provided in formatOptions', async () => { |
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.
formatNumber?
@@ -71,7 +116,7 @@ describe('<lion-input-stepper>', () => { | |||
expect(el.value).to.equal(''); | |||
el.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' })); | |||
await el.updateComplete; | |||
expect(el.value).to.equal('-1'); | |||
expect(el.value).to.equal('−1'); |
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.
What is this change about?
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.
Its changing - to the official −, so "minus one" is correctly pronounced by screen readers.
packages/ui/components/input-stepper/test/lion-input-stepper.test.js
Outdated
Show resolved
Hide resolved
packages/ui/components/input-stepper/test/lion-input-stepper.test.js
Outdated
Show resolved
Hide resolved
ing-bank#2312) * fix(input-stepper): add parseNumber and formatNumber to format the value based on locale * Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js * Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js
ing-bank#2312) * fix(input-stepper): add parseNumber and formatNumber to format the value based on locale * Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js * Update packages/ui/components/input-stepper/test/lion-input-stepper.test.js
…lue based on locale
What I did