TBD54566975 / didpay

Mobile app that provides a way for individuals to interact with PFIs via tbDEX
Apache License 2.0
6 stars 6 forks source link

Create UI tests for `CurrencyDropdown` widget #287

Closed ethan-tbd closed 1 month ago

ethan-tbd commented 2 months ago
mohitrajsinha commented 1 month ago

.take

github-actions[bot] commented 1 month ago

Thanks for taking this issue! Let us know if you have any questions!

mohitrajsinha commented 1 month ago

Hey @ethan-tbd , I’ve created a few tests, but I’m running into an issue with the second one—it keeps failing. Do you have any suggestions on how I might resolve this?

Here’s the commit link with the code: Commit 149c5b22e57b481c21d66da96c90c3ad6f6f5591

Thanks for any insights you can provide!

blackgirlbytes commented 1 month ago

Hey @mohitrajsinha maybe it would help if you open a PR? That way ethan or me could check it out and suggest changes to help you get your test working!

ethan-tbd commented 1 month ago

@mohitrajsinha there are two problems that are contributing to the failing test case:

  1. follow the structure of the existing test suite by using WidgetHelpers.testableWidget() (this will take care of the localized string errors)
  2. if you take a look at ModalSelectCurrency, you will see that if offeringsMap in PaymentAmountState is null, then an empty container is rendered. in your setUp function, make sure to initialize offeringsMap (hint: look at the TestData class).
ethan-tbd commented 1 month ago

@mohitrajsinha also some nits:

  1. make sure the name of the test file ends in _test
  2. instead of using find.byKey(), you can just use find.text('USD') since you are setting the testCurrency value to USD
mohitrajsinha commented 1 month ago

Yeah ,it was great to work on this issue. It was my first time working on a flutter tests.

Thanks for your suggestions.