fix: autofocus jellyfin server url

This commit is contained in:
edde746
2026-05-06 13:19:01 +02:00
parent 3b18b44cd2
commit ebec3ad20c
2 changed files with 11 additions and 0 deletions
@@ -341,6 +341,7 @@ class _AddJellyfinScreenState extends State<AddJellyfinScreen> with AsyncFormSta
const SizedBox(height: 16),
FocusableTextFormField(
controller: _urlController,
autofocus: true,
keyboardType: TextInputType.url,
autocorrect: false,
enableSuggestions: false,
@@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:plezy/profiles/profile.dart';
import 'package:plezy/screens/settings/add_jellyfin_screen.dart';
@@ -11,6 +12,15 @@ Profile _profile(String id) => Profile(
);
void main() {
testWidgets('autofocuses the server URL field', (tester) async {
await tester.pumpWidget(const MaterialApp(home: AddJellyfinScreen()));
await tester.pump();
final field = tester.widget<TextField>(find.byType(TextField));
expect(field.autofocus, isTrue);
});
group('Jellyfin profile binding decisions', () {
test('creates a local profile only on true first-run with no profiles', () {
expect(shouldCreateLocalJellyfinProfile(targetProfile: null, activeProfile: null, hasProfiles: false), isTrue);