Skip to content

test(demo): add unit tests for core formatters - #121

Open
Ugarba202 wants to merge 1 commit into
bitcoindevkit:mainfrom
Ugarba202:test/core-formatters
Open

test(demo): add unit tests for core formatters#121
Ugarba202 wants to merge 1 commit into
bitcoindevkit:mainfrom
Ugarba202:test/core-formatters

Conversation

@Ugarba202

Copy link
Copy Markdown
Contributor

Summary

Add comprehensive unit tests for the formatting utilities in the BDK Demo app to ensure balances, addresses, and timestamps display correctly to the user.

Scope

This PR only adds:

  • bdk_demo/test/core/utils/formatters_test.dart

Validation

  • confirmed flutter test passes locally for all cases.
  • confirmed formatTimestamp is tested dynamically against DateTime.now() to prevent timezone/year flakiness.

@Johnosezele

Copy link
Copy Markdown
Collaborator

This branch still includes older commits that aren’t part of this change. Pls rebase onto latest main (or open a fresh branch from main and cherry pick only the formatter test commit) so the PR only shows the unit test work.

Also, these are mostly happy path checks. A couple of edge cases would make the suite more useful than broader happy path coverage alone.

Going forward, please open an issue first when you can so we can align on the use case before a PR lands. That helps keep scope clear and avoids rework.

@Ugarba202

Copy link
Copy Markdown
Contributor Author

This branch still includes older commits that aren’t part of this change. Pls rebase onto latest main (or open a fresh branch from main and cherry pick only the formatter test commit) so the PR only shows the unit test work.

Also, these are mostly happy path checks. A couple of edge cases would make the suite more useful than broader happy path coverage alone.

Going forward, please open an issue first when you can so we can align on the use case before a PR lands. That helps keep scope clear and avoids rework.

Thanks for the review and guidance. I'll get this onto a fresh branch from main so the history is clean, and I'll add some edge-case tests like zero/negative balances and empty strings.

@Ugarba202
Ugarba202 force-pushed the test/core-formatters branch from d55a270 to 5adad8a Compare August 5, 2026 21:33
@Ugarba202

Copy link
Copy Markdown
Contributor Author

I have force-pushed a rebased branch with a clean history and added all the edge case tests requested.
I have also noted on opening an issue first going, forward i will definitely do that for my next contribution! @Johnosezele

@Ugarba202
Ugarba202 force-pushed the test/core-formatters branch from 5adad8a to 5a6cc93 Compare August 5, 2026 21:58
@Ugarba202
Ugarba202 force-pushed the test/core-formatters branch from 5a6cc93 to d0e91a2 Compare August 5, 2026 22:37
@Johnosezele

Copy link
Copy Markdown
Collaborator

ACK d0e91a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants