-
Notifications
You must be signed in to change notification settings - Fork 987
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
No ability to enter/paste assets exceeds the users's balance #18526 #18599
Changes from all commits
a911fc5
58889ad
cd7832e
3a2ad0d
b81e265
ffe2400
12a975b
b01cb21
cc23a08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,6 +57,7 @@ | |
(h/is-truthy (h/get-by-text "0")) | ||
(h/is-truthy (h/get-by-text "ETH")) | ||
(h/is-truthy (h/get-by-text "$0.00")) | ||
(h/is-truthy (h/get-by-label-text :container)) | ||
(h/is-disabled (h/get-by-label-text :button-one))) | ||
|
||
(h/test "Fill token input and confirm" | ||
|
@@ -77,6 +78,7 @@ | |
(-> (h/wait-for #(h/get-by-text "$1234.50")) | ||
(.then (fn [] | ||
(h/is-truthy (h/get-by-label-text :button-one)) | ||
(h/is-truthy (h/get-by-label-text :container)) | ||
(h/fire-event :press (h/get-by-label-text :button-one)) | ||
(h/was-called on-confirm)))))) | ||
|
||
|
@@ -99,61 +101,33 @@ | |
(-> (h/wait-for #(h/get-by-text "$1234.50")) | ||
(.then (fn [] | ||
(h/is-truthy (h/get-by-label-text :button-one)) | ||
(h/is-truthy (h/get-by-label-text :container)) | ||
(h/fire-event :press (h/get-by-label-text :button-one)) | ||
(h/was-called on-confirm)))))) | ||
|
||
(h/test "Try to fill more than limit" | ||
(h/setup-subs sub-mocks) | ||
(h/render [input-amount/view | ||
{:crypto-decimals 10 | ||
:limit-crypto 286}]) | ||
{:crypto-decimals 1 | ||
:limit-crypto 1}]) | ||
|
||
(h/fire-event :press (h/query-by-label-text :keyboard-key-2)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-9)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
|
||
(-> (h/wait-for #(h/is-truthy (h/get-by-text "$290.00"))) | ||
(.then (fn [] | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-backspace)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-8)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
(h/wait-for #(h/get-by-text "$2850.00")))))) | ||
(h/is-truthy (h/get-by-label-text :container-error))) | ||
|
||
(h/test "Try to fill more than limit" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this test should still work but the check should be updated 👍 . There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same thing here |
||
(h/test "Switch from crypto to fiat and check limit" | ||
(h/setup-subs sub-mocks) | ||
(h/render [input-amount/view | ||
{:crypto-decimals 10 | ||
:limit-crypto 286 | ||
{:crypto-decimals 1 | ||
:limit-crypto 1 | ||
:on-confirm #()}]) | ||
|
||
(h/fire-event :press (h/query-by-label-text :keyboard-key-2)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-9)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
|
||
(-> (h/wait-for #(h/get-by-text "$290.00")) | ||
(.then (fn [] | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-backspace)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-8)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
(h/wait-for #(h/get-by-text "$2850.00")))))) | ||
|
||
(h/test "Switch from crypto to fiat and check limit" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this seems like a valid test case still There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, when the input was more than the limit and a switch was happening, the input was changing to the limit. Now, nothing should happen except for the style changing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
(h/setup-subs sub-mocks) | ||
(h/render [input-amount/view | ||
{:crypto-decimals 2 | ||
:limit-crypto 250 | ||
:on-confirm #()}]) | ||
(h/is-truthy (h/get-by-label-text :container-error)) | ||
(h/fire-event :press (h/query-by-label-text :reorder)) | ||
|
||
(h/fire-event :press (h/query-by-label-text :keyboard-key-2)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-0)) | ||
(-> (h/wait-for #(h/get-by-text "$200.00")) | ||
(.then (fn [] | ||
(h/fire-event :press (h/query-by-label-text :reorder)) | ||
(h/wait-for #(h/get-by-text "2.00 ETH")))) | ||
(.then (fn [] | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
(h/wait-for #(h/get-by-text "20.50 ETH")))) | ||
(-> (h/wait-for #(h/get-by-text "Max: 1000.00 USD")) | ||
(.then (fn [] | ||
(h/fire-event :press (h/query-by-label-text :keyboard-key-5)) | ||
(h/wait-for #(h/get-by-text "20.50 ETH"))))))) | ||
(h/wait-for #(h/is-truthy (h/get-by-label-text :container)))))))) |
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.
why are we deleting all these tests? 🤔
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.
Because the tests were covering the input of more than limit which were reset to the limit. Now, when entering more than limit, nothing should happen except for changing the style.