fix test with platform specific check
What changed, and why it matters
This is a tiny change to a single automated test file. It makes the test expect different behavior on Linux versus other platforms when setting up a PIN, because Linux does not support the same biometric checks. There is no change to the actual wallet app code that users interact with, so this does not create or fix a security vulnerability.
No security action needed. Treat as a normal test-maintenance commit.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies test/screen_tests/onboarding/create_pin_view_screen_test.dart. It imports dart:io, removes an unused prefs import, and changes one assertion from expecting biometrics.calls == 0 unconditionally to expecting 0 on Linux and 1 on other platforms. This aligns the test with platform-specific biometric availability and is purely a test-suite fix.
Changed components
test/screen_tests/onboarding/create_pin_view_screen_test.dartInspect captured patch +3 / −2
diff --git a/test/screen_tests/onboarding/create_pin_view_screen_test.dart b/test/screen_tests/onboarding/create_pin_view_screen_test.dart
index 455d347..9029e84 100644
--- a/test/screen_tests/onboarding/create_pin_view_screen_test.dart
+++ b/test/screen_tests/onboarding/create_pin_view_screen_test.dart
@@ -1,3 +1,5 @@
+import 'dart:io';
+
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_test/flutter_test.dart';
@@ -10,7 +12,6 @@ import 'package:stackwallet/providers/global/prefs_provider.dart';
import 'package:stackwallet/themes/stack_colors.dart';
import 'package:stackwallet/themes/theme_service.dart';
import 'package:stackwallet/utilities/biometrics.dart';
-import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/widgets/custom_pin_put/pin_keyboard.dart';
import '../../sample_data/theme_json.dart';
@@ -132,7 +133,7 @@ void main() {
expect(await platformOverrides.secureStorage.read(key: kPinKey), '1234');
expect(platformOverrides.secureStorage.writes, 1);
- expect(biometrics.calls, 0);
+ expect(biometrics.calls, Platform.isLinux ? 0 : 1);
verify(prefs.useBiometrics = false).called(1);
verify(prefs.hasPin = true).called(1);
Why this scored 13/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.