Skip to content

test: add calculator device coverage#934

Draft
ovitrif wants to merge 4 commits intomasterfrom
test/calculator-widget-device-tests
Draft

test: add calculator device coverage#934
ovitrif wants to merge 4 commits intomasterfrom
test/calculator-widget-device-tests

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 7, 2026

Fixes #937

Description

This PR:

  1. Moves calculator widget input/conversion behavior into the calculator view model so the card only renders state and forwards events.
  2. Adds unit coverage for calculator hydration, sanitizing, conversion, persistence, and currency refresh behavior.
  3. Adds a device UI integration test for the calculator card that types into BTC and fiat inputs, verifies rendered values, and verifies persisted widget state.
  4. Splits Android instrumentation tests into annotated lanes for Compose UI, device UI integration, device storage integration, and core service integration.

Preview

N/A

QA Notes

Manual Tests

  • 1. Widgets → Calculator Preview → enter BTC amount: fiat field updates and saved widget keeps both values.
  • 2. Widgets → Calculator Preview → enter fiat amount: BTC field updates and saved widget keeps both values.

Automated Tests

  • Unit tests added: cover calculator view model behavior in CalculatorViewModelTest.kt.
  • Android test added: covers calculator card device interaction and persistence in CalculatorCardIntegrationTest.kt.
  • Android test lanes added:
  • connectedDevDebugComposeAndroidTest
  • connectedDevDebugDeviceUiIntegrationAndroidTest
  • connectedDevDebugDeviceStorageIntegrationAndroidTest
  • connectedDevDebugCoreServiceIntegrationAndroidTest
  • connectedDevDebugDeviceIntegrationAndroidTest
Checks
  • Ran locally: ./gradlew compileDevDebugKotlin.
  • Ran locally: ./gradlew compileDevDebugAndroidTestKotlin.
  • Ran locally: ./gradlew testDevDebugUnitTest.
  • Ran locally: ./gradlew detekt --rerun-tasks.
  • Ran on Pixel 10 Pro:
ANDROID_SERIAL='$ID' ./gradlew connectedDevDebugDeviceUiIntegrationAndroidTest
ANDROID_SERIAL='$ID' ./gradlew connectedDevDebugDeviceStorageIntegrationAndroidTest
ANDROID_SERIAL='$ID' ./gradlew connectedDevDebugCoreServiceIntegrationAndroidTest
ANDROID_SERIAL='$ID' ./gradlew connectedDevDebugDeviceIntegrationAndroidTest

@ovitrif ovitrif self-assigned this May 7, 2026
@ovitrif ovitrif added this to the 2.3.0 milestone May 7, 2026
@ovitrif ovitrif linked an issue May 7, 2026 that may be closed by this pull request
Base automatically changed from fix/currency-widget-consistency-881 to master May 7, 2026 16:36
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.

Polish Calculator Widget Fiat Input

1 participant