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

KtFieldCurrency: write tests for cursor position behavior #594

Open
carsoli opened this issue Feb 16, 2022 · 0 comments
Open

KtFieldCurrency: write tests for cursor position behavior #594

carsoli opened this issue Feb 16, 2022 · 0 comments
Labels
package:kotti-ui @3yourmind/kotti-ui priority:2-low Should be fixed in the next year type:tests

Comments

@carsoli
Copy link
Contributor

carsoli commented Feb 16, 2022

Write component tests, listen on inputRef, and cursor position after user changes

make sure we satisfy what we expect in the cases below


Useful for Testing KtFieldCurrency

the cursor is represented as _

Cursor Position

Input Output Remarks
_12.34 5_12.34
1_2.34 15_2.34
12_.34 125_.34
12._34 125._34
12.3_4 123.5_4
12.34_ 123.45_

UI Insertion

Input Output Remarks
_12.34 512.34
1_2.34 152.34
12_.34 125.34
12._34 12.534 shift number left
12.3_4 12.354 shift number left
12.34_ 12.345 shift number left

UI Deletion with Backspace

Input Output Remarks
_12.34 12.34
1_2.34 2.34
12_.34 1.34
12._34 12_.34 reinsert dot
12.3_4 1.2_4
12.34_ 1.23_
1.23_ 0.12_ add leading zero

Editing(/Pasting)

Input Output Remarks
1 0.01 add leading zero
@FlorianWendelborn FlorianWendelborn added package:kotti-ui @3yourmind/kotti-ui priority:2-low Should be fixed in the next year type:tests labels Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:kotti-ui @3yourmind/kotti-ui priority:2-low Should be fixed in the next year type:tests
Projects
None yet
Development

No branches or pull requests

2 participants