Skip to content

test: add calculator widget device tests#944

Open
ovitrif wants to merge 2 commits into
test/ai-dev-tests-suite-setupfrom
test/calculator-widget-tests
Open

test: add calculator widget device tests#944
ovitrif wants to merge 2 commits into
test/ai-dev-tests-suite-setupfrom
test/calculator-widget-tests

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 16, 2026

Related: #950

Stacked on #943.

Description

  • Adds calculator widget device UI coverage rebuilt on top of feat: calculator v61 redesign #942.
  • Covers BTC input to fiat conversion and fiat input to BTC conversion.
  • Leaves calculator unit coverage in feat: calculator v61 redesign #942, where the view model and formatting/number-pad logic tests were added.
  • Verifies persisted calculator widget state using deterministic USD rate, store state, and locale setup.
  • Uses the DeviceIntegration lane from test: add android test lanes #943 and adds the DeviceUiIntegration lane for calculator device UI coverage.
  • Removes the stale OS-widget updater dependency now that feat: calculator v61 redesign #942 keeps the calculator OS widget out of scope.

Preview

N/A

QA Notes

Manual Tests

N/A

Automated Checks

  • Local: ./gradlew compileDevDebugKotlin testDevDebugUnitTest compileDevDebugAndroidTestKotlin detekt
  • Local dry run: ./gradlew connectedDevDebugDeviceUiIntegrationAndroidTest -m
  • Device run before the annotation rename: ./gradlew connectedDevDebugDeviceUiIntegrationAndroidTest ran 2 tests on Pixel 10 Pro - 16.

@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch 4 times, most recently from 6058f50 to 4c965a8 Compare May 16, 2026 13:37
@ovitrif ovitrif mentioned this pull request May 16, 2026
35 tasks
@ovitrif ovitrif self-assigned this May 16, 2026
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 4c965a8 to 60fe272 Compare May 16, 2026 17:55
@ovitrif ovitrif marked this pull request as ready for review May 16, 2026 18:33
@ovitrif ovitrif changed the title test: add calculator device tests test: add calculator widget device tests May 17, 2026
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch 2 times, most recently from c167ac7 to e8f05e7 Compare May 18, 2026 01:25
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 60fe272 to 6607f90 Compare May 18, 2026 01:29
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from e8f05e7 to d4e542d Compare May 18, 2026 01:37
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 6607f90 to 566af19 Compare May 18, 2026 01:38
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 566af193b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from d4e542d to 3fa8959 Compare May 18, 2026 08:04
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 566af19 to 836a65f Compare May 18, 2026 08:09
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 3fa8959 to 3c440c9 Compare May 18, 2026 08:14
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 836a65f to 61cc72c Compare May 18, 2026 08:15
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 3c440c9 to 966c034 Compare May 18, 2026 10:29
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 61cc72c to 2637a68 Compare May 18, 2026 10:35
@ovitrif ovitrif mentioned this pull request May 18, 2026
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 2637a68 to b45eeb4 Compare May 18, 2026 13:34
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 966c034 to 8f0dd84 Compare May 18, 2026 13:34
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from b45eeb4 to 78253c8 Compare May 18, 2026 15:24
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 8f0dd84 to 74056bd Compare May 18, 2026 15:24
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 78253c8 to 8f16bbc Compare May 18, 2026 15:29
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 74056bd to 3b82d78 Compare May 18, 2026 15:29
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 3b82d78 to 618af1b Compare May 18, 2026 15:36
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch 3 times, most recently from 806a2d2 to 24d16bd Compare May 18, 2026 15:44
@ovitrif ovitrif force-pushed the test/ai-dev-tests-suite-setup branch from 20b2b81 to 0bafb28 Compare May 18, 2026 20:47
@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 24d16bd to 91404e0 Compare May 18, 2026 20:49
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91404e0952

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +204 to +207
return CalculatorViewModel(
widgetsRepo = widgetsRepo,
currencyRepo = currencyRepo,
) as T
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Align test with current CalculatorViewModel constructor

This test creates CalculatorViewModel with both widgetsRepo and currencyRepo, but the production class in this commit only accepts widgetsRepo (see app/src/main/java/to/bitkit/ui/screens/widgets/calculator/CalculatorViewModel.kt constructor) and the test later calls members that are not on that API. In this state, Android test sources do not compile, so compileDevDebugAndroidTestKotlin/device UI lanes are blocked until the test is rebased to the actual calculator view-model interface.

Useful? React with 👍 / 👎.

@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from 91404e0 to ac291f1 Compare May 18, 2026 22:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac291f1b75

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +216 to +218
CalculatorCard(
calculatorViewModel = viewModel,
modifier = Modifier.fillMaxWidth()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Pass the required calculator card dependencies

On this PR's base, CalculatorCard still requires a CurrencyViewModel and showWidgetTitle in addition to the calculator view model, but this test only supplies calculatorViewModel and modifier. That makes compileDevDebugAndroidTestKotlin fail before the new DeviceUiIntegration lane can run, even after fixing the separate CalculatorViewModel constructor/API mismatch already noted in the existing review.

Useful? React with 👍 / 👎.

@ovitrif ovitrif force-pushed the test/calculator-widget-tests branch from ac291f1 to b8e579b Compare May 19, 2026 16:49
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b8e579bade

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +256 to +260
composeTestRule.onNodeWithTag(tag)
.assertIsDisplayed()
.performClick()
composeTestRule.waitUntil(timeoutMillis = TIMEOUT_MS) {
composeTestRule.onAllNodesWithTag(NUMBER_PAD_TAG).fetchSemanticsNodes().isNotEmpty()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Target existing semantics nodes in calculator UI test

The interaction helper assumes UI elements that do not exist in this commit: selectInput clicks CalculatorBtcInput/CalculatorFiatInput and then waits for CalculatorNumberPad, but CalculatorCard renders plain CalculatorInput fields and does not attach those test tags or a calculator number pad (checked app/src/main/java/to/bitkit/ui/screens/widgets/calculator/components/CalculatorCard.kt). In this state both new tests fail in selectInput (or later pressKeys) before validating conversion logic, so the new Device UI lane cannot provide the intended coverage.

Useful? React with 👍 / 👎.

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.

1 participant