1.0 shell: one window with a party strip; protocol 9 profile + avatars by hash
The shell (lib/src/shell/) replaces the Home and session screens:
- Party strip: profile, Library / Schedule / Settings tabs, Join and
Host cards (hosting no longer takes media), status-ring avatar stack
with the member list, chat & activity panel, Leave.
- The real session player is mounted once and shown full, as a
draggable corner-snapping mini player, or fullscreen (window_manager,
party and toasts overlaid); the Video is never mounted twice.
- Profile popover with inline rename, colour and a crop picker (256 px
PNG), pushed live to the session; avatar toasts; waiting pill.
- Motion kit (fastEaseInToSlowEaseOut, fade-through, popovers,
mouse-drag/wheel horizontal scrolling).
- Library = the existing picker for now (restyled next round); Schedule
= the new SchedulePage; Settings = left nav over the existing panels.
Protocol 9 (packages/core, packages/server, sync client):
- {"t":"profile"} renames / changes the picture mid-session ("rename",
"avatar" feed actions); names are cleaned the same way at hello.
- state.members carry avatarHash; pictures are served once from
/a/<sid>/<token>/<hash> (PNG/JPEG/WebP/GIF by magic bytes only) and
cached by hash in the app (AvatarCache).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f790470935
commit
d29c12e4f0
62 files changed
+5777
-3572
No files matched your search
@@ -0,0 +1,59 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:sync_relay_core/core.dart';
|
||||
import 'package:sync_relay_server/server.dart';
|
||||
import 'package:watch_together/src/sync/avatar_cache.dart';
|
||||
import 'package:watch_together/src/sync/sync_client.dart';
|
||||
|
||||
Future<void> _poll(FutureOr<bool> Function() cond, String what) async {
|
||||
final deadline = DateTime.now().add(const Duration(seconds: 10));
|
||||
while (DateTime.now().isBefore(deadline)) {
|
||||
if (await cond()) return;
|
||||
await Future.delayed(const Duration(milliseconds: 50));
|
||||
}
|
||||
fail('timed out waiting for $what');
|
||||
}
|
||||
|
||||
void main() {
|
||||
test('pictures arrive by hash over /a/; profile renames and swaps them', () async {
|
||||
final server = SyncServer(const AppConfig(port: 0, secret: 's', name: 'avatars'));
|
||||
await server.start();
|
||||
final client = SyncClient();
|
||||
final cache = AvatarCache(client);
|
||||
var notified = 0;
|
||||
cache.addListener(() => notified++);
|
||||
final first = Uint8List.fromList([0x89, 0x50, 0x4E, 0x47, ...List<int>.generate(196, (i) => i % 256)]);
|
||||
final second = Uint8List.fromList([0xFF, 0xD8, 0xFF, ...List<int>.generate(197, (i) => 255 - i % 256)]);
|
||||
try {
|
||||
await client.connect(
|
||||
wsUri: Uri.parse('ws://127.0.0.1:${server.boundPort}/sync'),
|
||||
secret: 's',
|
||||
name: 'alice',
|
||||
avatar: base64Encode(first),
|
||||
);
|
||||
final hash = avatarHashOf(first);
|
||||
expect(client.lastState!.members.single.avatarHash, hash);
|
||||
await _poll(() => cache.bytesFor(hash) != null, 'first picture');
|
||||
expect(cache.bytesFor(hash), first);
|
||||
expect(notified, 1);
|
||||
|
||||
client.sendProfile(name: 'bob', avatar: base64Encode(second));
|
||||
await _poll(() => client.lastState?.members.single.name == 'bob', 'rename');
|
||||
final next = client.lastState!.members.single.avatarHash;
|
||||
expect(next, avatarHashOf(second));
|
||||
await _poll(() => cache.bytesFor(next) != null, 'second picture');
|
||||
expect(cache.bytesFor(hash), first, reason: 'earlier pictures stay cached');
|
||||
|
||||
client.sendProfile(avatar: '');
|
||||
await _poll(() => client.lastState?.members.single.avatarHash == '', 'picture removed');
|
||||
expect(cache.bytesFor(''), isNull);
|
||||
} finally {
|
||||
cache.dispose();
|
||||
await client.dispose();
|
||||
await server.stop();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -2,11 +2,11 @@ import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:watch_together/src/schedule/ui/schedule_page.dart';
|
||||
import 'package:sync_relay_core/core.dart';
|
||||
import 'package:watch_together/src/screens/home/health_probe.dart';
|
||||
import 'package:watch_together/src/screens/home/home_screen.dart';
|
||||
import 'package:watch_together/src/screens/home/media_picker.dart';
|
||||
import 'package:watch_together/src/screens/home/ui.dart';
|
||||
import 'package:watch_together/src/shell/app_shell.dart';
|
||||
import 'package:watch_together/src/state/session_state.dart';
|
||||
import 'package:watch_together/src/state/settings.dart';
|
||||
import 'package:watch_together/src/update/update_controller.dart';
|
||||
@@ -107,64 +107,87 @@ void main() {
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: ThemeData.dark(),
|
||||
home: Scaffold(
|
||||
body: HomeShell(
|
||||
updates: UpdateController(currentVersion: '0.0.0-dev'),
|
||||
autoUpdateCheck: false,
|
||||
healthGet: health ?? fakeHealth(const {}),
|
||||
),
|
||||
home: AppShell(
|
||||
updates: UpdateController(currentVersion: '0.0.0-dev'),
|
||||
autoUpdateCheck: false,
|
||||
windowControls: false,
|
||||
healthGet: health ?? fakeHealth(const {}),
|
||||
),
|
||||
));
|
||||
await tester.pump();
|
||||
}
|
||||
|
||||
setUp(() => SessionState.instance.recents.value = const []);
|
||||
|
||||
testWidgets('tabs and page buttons switch the body', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 900));
|
||||
expect(find.byKey(const ValueKey('join-row')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('host-picker')), findsNothing);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
Future<void> openCard(WidgetTester tester, String key) async {
|
||||
await tester.tap(find.byKey(ValueKey(key)));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('host-picker')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('join-row')), findsNothing);
|
||||
expect(find.text('No password — anyone can join'), findsOneWidget);
|
||||
await tester.tap(find.byTooltip('Settings'));
|
||||
}
|
||||
|
||||
setUp(() {
|
||||
SessionState.instance.recents.value = const [];
|
||||
SessionState.instance.route.value = AppRoute.home;
|
||||
});
|
||||
|
||||
testWidgets('tabs and settings pages switch the body', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 900));
|
||||
expect(find.byKey(const ValueKey('swap-panel')), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-schedule')));
|
||||
// The schedule shows a spinner while it loads: pump frames, not settle.
|
||||
for (var i = 0; i < 30; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
}
|
||||
expect(find.byKey(const ValueKey('swap-panel')), findsNothing);
|
||||
expect(find.byType(SchedulePage), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-settings')));
|
||||
for (var i = 0; i < 30; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Name, picture and colour: click your avatar in the top left'), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('settings-player')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Hardware decoding'), findsOneWidget);
|
||||
expect(find.text('Check automatically on start'), findsOneWidget);
|
||||
expect(find.text('Toggle ready'), findsOneWidget);
|
||||
await tester.tap(find.byTooltip('Integrations'));
|
||||
await tester.tap(find.byKey(const ValueKey('settings-updates')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Jellyfin'), findsOneWidget);
|
||||
await tester.tap(find.byTooltip('About'));
|
||||
expect(find.text('Check automatically on start'), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('settings-shortcuts')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Toggle ready'), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('settings-integrations')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Play the next episode automatically'), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('settings-about')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Dev build — update checks are off'), findsOneWidget);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-join')));
|
||||
await tester.tap(find.byKey(const ValueKey('tab-library')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('join-row')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('swap-panel')), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('Enter in the join row submits; errors show under it', (tester) async {
|
||||
testWidgets('Enter in the join card submits; errors show under it', (tester) async {
|
||||
SessionState.instance.lastForm.name = '';
|
||||
await pumpShell(tester, const Size(1280, 720));
|
||||
await openCard(tester, 'strip-join');
|
||||
await tester.enterText(find.byKey(const ValueKey('join-address')), 'friend.example');
|
||||
await tester.testTextInput.receiveAction(TextInputAction.done);
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.textContaining('display name', findRichText: true), findsOneWidget);
|
||||
// The button submits too, and typing in the address clears the error.
|
||||
await tester.enterText(find.byKey(const ValueKey('join-address')), 'friend.example2');
|
||||
await tester.pump();
|
||||
expect(find.textContaining('display name', findRichText: true), findsNothing);
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Join'));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Join').last);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.textContaining('display name', findRichText: true), findsOneWidget);
|
||||
// A click outside closes the card; the error is still there on reopen.
|
||||
await tester.tapAt(const Offset(20, 700));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('join-address')), findsNothing);
|
||||
await openCard(tester, 'strip-join');
|
||||
expect(find.textContaining('display name', findRichText: true), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('recent tiles show live status from /health', (tester) async {
|
||||
testWidgets('recent rows show live status from /health', (tester) async {
|
||||
SessionState.instance.recents.value = [
|
||||
join('alpha.example', '8080'),
|
||||
join('beta.example', '9000', 'pw'),
|
||||
@@ -181,54 +204,34 @@ void main() {
|
||||
},
|
||||
'gamma.example': {'ok': true, 'name': '', 'proto': -1, 'viewers': 0},
|
||||
}));
|
||||
await tester.pump();
|
||||
Finder inTile(String key, Finder f) =>
|
||||
await openCard(tester, 'strip-join');
|
||||
Finder inRow(String key, Finder f) =>
|
||||
find.descendant(of: find.byKey(ValueKey('recent-$key')), matching: f);
|
||||
expect(inTile('alpha.example:8080', find.text('Movie night')), findsOneWidget);
|
||||
expect(inTile('alpha.example:8080', find.text('● online · 3 watching')), findsOneWidget);
|
||||
expect(inTile('alpha.example:8080', find.text('needs update')), findsNothing);
|
||||
expect(inTile('beta.example:9000', find.text('○ offline')), findsOneWidget);
|
||||
expect(inTile('beta.example:9000', find.text('beta.example')), findsOneWidget);
|
||||
expect(inTile('gamma.example:7000', find.text('needs update')), findsOneWidget);
|
||||
// Hosted entries live on the Host tab, not in the join grid.
|
||||
expect(inRow('alpha.example:8080', find.text('Movie night')), findsOneWidget);
|
||||
expect(inRow('alpha.example:8080', find.text('● online · 3 watching')), findsOneWidget);
|
||||
expect(inRow('alpha.example:8080', find.text('needs update')), findsNothing);
|
||||
expect(inRow('beta.example:9000', find.text('○ offline')), findsOneWidget);
|
||||
expect(inRow('beta.example:9000', find.text('beta.example')), findsOneWidget);
|
||||
expect(inRow('gamma.example:7000', find.text('needs update')), findsOneWidget);
|
||||
// Hosted entries live on the Host card, not in the join list.
|
||||
expect(find.byKey(const ValueKey('recent-host:8181')), findsNothing);
|
||||
// Tiles share a row on a wide window.
|
||||
final a = tester.getRect(find.byKey(const ValueKey('recent-alpha.example:8080')));
|
||||
final b = tester.getRect(find.byKey(const ValueKey('recent-beta.example:9000')));
|
||||
expect(a.top, b.top);
|
||||
// x forgets.
|
||||
await tester.tap(inTile('beta.example:9000', find.byTooltip('Forget')));
|
||||
await tester.tap(inRow('beta.example:9000', find.byTooltip('Forget')));
|
||||
await tester.pump();
|
||||
expect(find.byKey(const ValueKey('recent-beta.example:9000')), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('no recents shows the empty state', (tester) async {
|
||||
testWidgets('no recents: the join card is just the form', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 720));
|
||||
expect(find.byKey(const ValueKey('recents-empty')), findsOneWidget);
|
||||
await openCard(tester, 'strip-join');
|
||||
expect(find.text('Recent'), findsNothing);
|
||||
expect(find.byKey(const ValueKey('join-row')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('wide windows: grid fills the width, fields stay compact', (tester) async {
|
||||
SessionState.instance.recents.value = [
|
||||
for (var i = 0; i < 6; i++) join('10.0.0.$i', '8080'),
|
||||
];
|
||||
await pumpShell(tester, const Size(3440, 1440));
|
||||
final first = tester.getRect(find.byKey(const ValueKey('recent-10.0.0.0:8080')));
|
||||
final last = tester.getRect(find.byKey(const ValueKey('recent-10.0.0.5:8080')));
|
||||
expect(first.top, last.top);
|
||||
expect(tester.getSize(find.byKey(const ValueKey('join-address'))).width, 280);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(tester.getSize(find.byKey(const ValueKey('host-column'))).width, 340);
|
||||
final file = find.descendant(
|
||||
of: find.byKey(const ValueKey('media-file')), matching: find.byType(TextField));
|
||||
expect(tester.getSize(file).width, lessThanOrEqualTo(kFieldMaxWidth));
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('media picker segments switch the input', (tester) async {
|
||||
testWidgets('library: picker segments switch the input; Integrations opens Settings', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 900));
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
await tester.tap(find.text('File'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('media-file')), findsOneWidget);
|
||||
expect(find.text('Browse'), findsOneWidget);
|
||||
@@ -236,6 +239,8 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('media-link')), findsOneWidget);
|
||||
expect(find.text('Paste'), findsOneWidget);
|
||||
// Offline nothing goes up.
|
||||
expect(find.text('Join or host to watch together'), findsOneWidget);
|
||||
await tester.tap(find.text('Jellyfin'));
|
||||
await tester.pumpAndSettle();
|
||||
// No linked server: sign-in right in the picker.
|
||||
@@ -246,44 +251,29 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('host column sits right when wide, below when narrow', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 900));
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
await tester.pumpAndSettle();
|
||||
var picker = tester.getRect(find.byKey(const ValueKey('host-picker')));
|
||||
var column = tester.getRect(find.byKey(const ValueKey('host-column')));
|
||||
expect(picker.right, lessThan(column.left));
|
||||
expect(picker.top, column.top);
|
||||
|
||||
await pumpShell(tester, const Size(640, 1000));
|
||||
picker = tester.getRect(find.byKey(const ValueKey('host-picker')));
|
||||
column = tester.getRect(find.byKey(const ValueKey('host-column')));
|
||||
expect(picker.bottom, lessThan(column.top));
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('host without a name errors in the server column', (tester) async {
|
||||
testWidgets('host without a name errors in the host card', (tester) async {
|
||||
SessionState.instance.lastForm.name = '';
|
||||
SessionState.instance.recents.value = [const RecentServer(hosted: true, host: '', port: '8181', secret: 's')];
|
||||
await pumpShell(tester, const Size(1280, 900));
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
await openCard(tester, 'strip-host');
|
||||
expect(find.text('No password — anyone can join'), findsOneWidget);
|
||||
expect(find.text('You pick what to watch afterwards, in the library.'), findsOneWidget);
|
||||
// A hosted port refills the fields.
|
||||
await tester.tap(find.byKey(const ValueKey('recent-host:8181')));
|
||||
await tester.pump();
|
||||
expect(find.text('No password — anyone can join'), findsNothing);
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Host').last);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.widgetWithText(FilledButton, 'Host'));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey('host-column')),
|
||||
matching: find.textContaining('display name', findRichText: true),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.textContaining('display name', findRichText: true), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('narrow window: bar, join row and host tab fit', (tester) async {
|
||||
testWidgets('narrow window: strip, cards and library fit', (tester) async {
|
||||
await pumpShell(tester, const Size(480, 800));
|
||||
expect(tester.takeException(), isNull);
|
||||
await openCard(tester, 'strip-join');
|
||||
expect(find.byKey(const ValueKey('join-row')), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-host')));
|
||||
await tester.tapAt(const Offset(5, 790));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Jellyfin'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -7,7 +7,6 @@ import 'package:sync_relay_core/core.dart';
|
||||
import 'package:watch_together/src/jellyfin/accounts.dart';
|
||||
import 'package:watch_together/src/jellyfin/format.dart';
|
||||
import 'package:watch_together/src/jellyfin/sign_in.dart';
|
||||
import 'package:watch_together/src/screens/home/host_tab.dart' show mediaSummary;
|
||||
import 'package:watch_together/src/screens/home/media_picker.dart';
|
||||
|
||||
/// Captured Jellyfin 10.11 answers shared with packages/core's client tests.
|
||||
@@ -327,9 +326,8 @@ void main() {
|
||||
expect(back, m);
|
||||
expect(back.runtime, const Duration(minutes: 23));
|
||||
expect(back.subtitle, 'Black Summoner · S1E6');
|
||||
expect(mediaSummary(m), 'Playing: Rice and Thieves and Heroes — Black Summoner · S1E6');
|
||||
expect(mediaSummary(const FileMedia('/a/b/movie.mkv')), 'Playing: movie.mkv');
|
||||
expect(mediaSummary(null), 'No media selected (optional).');
|
||||
expect(m.label, 'Rice and Thieves and Heroes — Black Summoner · S1E6');
|
||||
expect(const FileMedia('/a/b/movie.mkv').label, 'movie.mkv');
|
||||
expect(JellyfinMedia.fromJson({'serverId': 1}), isNull);
|
||||
});
|
||||
|
||||
|
||||
@@ -5,10 +5,8 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:watch_together/src/jellyfin/accounts.dart';
|
||||
import 'package:watch_together/src/jellyfin/accounts_panel.dart';
|
||||
import 'package:watch_together/src/jellyfin/browser.dart';
|
||||
import 'package:watch_together/src/screens/home/connect_flow.dart';
|
||||
import 'package:watch_together/src/screens/home/host_tab.dart';
|
||||
import 'package:watch_together/src/screens/home/media_picker.dart';
|
||||
import 'package:watch_together/src/state/session_state.dart';
|
||||
import 'package:watch_together/src/shell/library_tab.dart';
|
||||
|
||||
import 'jellyfin_accounts_test.dart'
|
||||
show FakeJellyfin, arifuretaId, fixtureServerId, linkedAccounts, season2Id;
|
||||
@@ -270,7 +268,7 @@ void main() {
|
||||
expect(find.byType(JellyfinBrowser), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Host tab: browser beside the server column, enlarged with a host bar, stacked when narrow',
|
||||
testWidgets('Library tab: the last pick comes back; offline it only browses',
|
||||
(tester) async {
|
||||
await setSize(tester, const Size(1800, 1000));
|
||||
final (accounts, _) = await linkedAccounts();
|
||||
@@ -281,32 +279,41 @@ void main() {
|
||||
title: 'Rice and Thieves and Heroes',
|
||||
subtitle: 'Black Summoner · S1E6');
|
||||
await accounts.rememberPick(pick);
|
||||
final fields = HostFields(ConnectForm(), jellyfin: accounts);
|
||||
final flow = ConnectFlow();
|
||||
addTearDown(() {
|
||||
fields.dispose();
|
||||
flow.dispose();
|
||||
});
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: ThemeData.dark(), home: Scaffold(body: HostTab(flow: flow, fields: fields))));
|
||||
final c = MediaPickerController();
|
||||
addTearDown(c.dispose);
|
||||
await restoreLastPick(c, accounts, () => true);
|
||||
final put = <PickedMedia>[];
|
||||
Future<void> pump({required bool online}) => tester.pumpWidget(MaterialApp(
|
||||
theme: ThemeData.dark(),
|
||||
home: Scaffold(
|
||||
body: LibraryTab(
|
||||
controller: c,
|
||||
accounts: accounts,
|
||||
online: online,
|
||||
isHost: false,
|
||||
onPutUp: (m) async {
|
||||
put.add(m);
|
||||
return null;
|
||||
},
|
||||
),
|
||||
)));
|
||||
await pump(online: false);
|
||||
await settle(tester);
|
||||
// The saved pick comes back on the Jellyfin source.
|
||||
expect(fields.media.selection, pick);
|
||||
expect(c.selection, pick);
|
||||
expect(find.byType(JellyfinBrowser), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('host-column')), findsOneWidget);
|
||||
expect(find.text('Playing: Rice and Thieves and Heroes — Black Summoner · S1E6'), findsOneWidget);
|
||||
expect(find.text('Join or host to watch together'), findsOneWidget);
|
||||
final go = find.byKey(const ValueKey('swap-go'));
|
||||
expect(tester.widget<ButtonStyleButton>(go).onPressed, isNull);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('jf-expand')));
|
||||
await settle(tester, 2);
|
||||
expect(find.byKey(const ValueKey('host-column')), findsNothing);
|
||||
expect(find.byKey(const ValueKey('host-bar')), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
|
||||
await tester.tap(find.byKey(const ValueKey('jf-expand')));
|
||||
await settle(tester, 2);
|
||||
await pump(online: true);
|
||||
await settle(tester);
|
||||
expect(find.text('Put up: Rice and Thieves and Heroes — Black Summoner · S1E6'), findsOneWidget);
|
||||
await tester.tap(go);
|
||||
await settle(tester);
|
||||
expect(put, [pick]);
|
||||
tester.view.physicalSize = const Size(800, 900);
|
||||
await settle(tester, 2);
|
||||
expect(find.byKey(const ValueKey('host-picker')), findsOneWidget);
|
||||
expect(find.byType(JellyfinBrowser), findsOneWidget);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
@@ -9,12 +9,12 @@ import 'package:watch_together/src/jellyfin/browse_scope.dart';
|
||||
import 'package:watch_together/src/jellyfin/progress.dart';
|
||||
import 'package:watch_together/src/jellyfin/session_media.dart';
|
||||
import 'package:watch_together/src/jellyfin/track_prefs.dart';
|
||||
import 'package:watch_together/src/screens/home/host_tab.dart' show hostJellyfinMedia;
|
||||
import 'package:watch_together/src/screens/home/media_picker.dart';
|
||||
import 'package:watch_together/src/screens/session/jellyfin_widgets.dart';
|
||||
import 'package:watch_together/src/screens/session/swap_panel.dart';
|
||||
import 'package:watch_together/src/screens/session_screen.dart' show viaHostOf;
|
||||
import 'package:watch_together/src/session/session_coordinator.dart' show AutoAdvance;
|
||||
import 'package:watch_together/src/shell/library_tab.dart' show putUpJellyfinMedia;
|
||||
import 'package:watch_together/src/shell/party_strip.dart' show viaHostOf;
|
||||
|
||||
import 'jellyfin_accounts_test.dart';
|
||||
import 'jellyfin_browser_test.dart' show app, setSize, settle;
|
||||
@@ -125,16 +125,16 @@ void main() {
|
||||
title: 'Rice and Thieves and Heroes',
|
||||
subtitle: 'Black Summoner · S1E6',
|
||||
runtime: Duration(minutes: 23));
|
||||
final media = hostJellyfinMedia(accounts, pick);
|
||||
final media = putUpJellyfinMedia(accounts, pick);
|
||||
expect(media.url, isNull);
|
||||
expect(media.jellyfin!.itemId, episodeId);
|
||||
expect(media.jellyfin!.subtitle, 'Black Summoner · S1E6');
|
||||
expect(media.jellyfin!.runtimeSecs, 23 * 60);
|
||||
expect(jsonEncode(SwapIntent(media: media).toJson()), isNot(contains('TEST_ACCESS_TOKEN')));
|
||||
expect(() => hostJellyfinMedia(accounts, const JellyfinMedia(serverId: 'gone', baseUrl: 'x', itemId: 'i', title: 't')),
|
||||
expect(() => putUpJellyfinMedia(accounts, const JellyfinMedia(serverId: 'gone', baseUrl: 'x', itemId: 'i', title: 't')),
|
||||
throwsFormatException);
|
||||
accounts.markExpired(fixtureServerId);
|
||||
expect(() => hostJellyfinMedia(accounts, pick), throwsFormatException);
|
||||
expect(() => putUpJellyfinMedia(accounts, pick), throwsFormatException);
|
||||
});
|
||||
|
||||
test('a pasted Jellyfin link becomes a ref (ServerId from /System/Info/Public, no api_key)',
|
||||
@@ -532,7 +532,7 @@ void main() {
|
||||
swapped.add(m);
|
||||
return null;
|
||||
},
|
||||
onClose: () => closed++,
|
||||
onDone: () => closed++,
|
||||
)));
|
||||
await settle(tester);
|
||||
// A guest's file goes through the server's relay.
|
||||
@@ -553,7 +553,7 @@ void main() {
|
||||
expect(find.byKey(const ValueKey('media-jellyfin')), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(app(SwapPanel(
|
||||
controller: c, accounts: accounts, isHost: true, onSwap: (_) async => 'x', onClose: () {})));
|
||||
controller: c, accounts: accounts, isHost: true, onSwap: (_) async => 'x')));
|
||||
await settle(tester);
|
||||
expect(find.text('File'), findsOneWidget);
|
||||
await tester.tap(find.text('File'));
|
||||
@@ -580,7 +580,6 @@ void main() {
|
||||
isHost: false,
|
||||
jellyfinStart: BrowseStart.seriesOf(fixtureServerId, ep),
|
||||
onSwap: (_) async => null,
|
||||
onClose: () {},
|
||||
)));
|
||||
await settle(tester, 10);
|
||||
expect(tester.widget<ChoiceChip>(find.byKey(const ValueKey('season-$season2Id'))).selected,
|
||||
|
||||
@@ -0,0 +1,339 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:sync_relay_core/core.dart';
|
||||
import 'package:watch_together/src/screens/home/profile.dart';
|
||||
import 'package:watch_together/src/shell/app_shell.dart';
|
||||
import 'package:watch_together/src/shell/avatar.dart';
|
||||
import 'package:watch_together/src/shell/motion.dart';
|
||||
import 'package:watch_together/src/shell/party_strip.dart';
|
||||
import 'package:watch_together/src/shell/profile_card.dart';
|
||||
import 'package:watch_together/src/shell/session_player.dart';
|
||||
import 'package:watch_together/src/shell/settings_tab.dart' show SettingsTab;
|
||||
import 'package:watch_together/src/shell/toasts.dart';
|
||||
import 'package:watch_together/src/session/session_coordinator.dart' show ToastItem;
|
||||
import 'package:watch_together/src/state/session_state.dart';
|
||||
import 'package:watch_together/src/update/update_controller.dart';
|
||||
|
||||
/// Stands in for media_kit's `Video` (which hangs flutter_test) and
|
||||
/// counts how often one is created.
|
||||
class FakeVideo extends StatefulWidget {
|
||||
static int created = 0;
|
||||
const FakeVideo({super.key});
|
||||
|
||||
@override
|
||||
State<FakeVideo> createState() => _FakeVideoState();
|
||||
}
|
||||
|
||||
class _FakeVideoState extends State<FakeVideo> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
FakeVideo.created++;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => const ColoredBox(color: Colors.black);
|
||||
}
|
||||
|
||||
MemberView member(String id, String name, {bool ready = false, bool stale = false}) =>
|
||||
MemberView(id: id, name: name, ready: ready, inSet: ready, buffered: 30, stale: stale);
|
||||
|
||||
void main() {
|
||||
final session = SessionState.instance;
|
||||
final coord = session.coordinator;
|
||||
|
||||
void online(List<MemberView> members, {bool media = true}) {
|
||||
coord.serverState.value = StateBroadcast(
|
||||
eventId: 1,
|
||||
transport: 'held',
|
||||
position: 0,
|
||||
serverTime: DateTime.now().toUtc(),
|
||||
mediaId: media ? 1 : 0,
|
||||
media: media ? {'name': 'Movie.mkv', 'size': 1, 'duration': 0} : null,
|
||||
members: members,
|
||||
);
|
||||
session.route.value = AppRoute.session;
|
||||
}
|
||||
|
||||
setUp(() {
|
||||
FakeVideo.created = 0;
|
||||
session.recents.value = const [];
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
session.route.value = AppRoute.home;
|
||||
coord.serverState.value = null;
|
||||
coord.playback.alive.value = false;
|
||||
coord.toasts.value = [];
|
||||
});
|
||||
|
||||
Future<void> pumpShell(WidgetTester tester, Size size) async {
|
||||
tester.view.physicalSize = size;
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: ThemeData.dark(),
|
||||
home: AppShell(
|
||||
updates: UpdateController(currentVersion: '0.0.0-dev'),
|
||||
autoUpdateCheck: false,
|
||||
windowControls: false,
|
||||
videoBuilder: (context, controls) => const FakeVideo(),
|
||||
),
|
||||
));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
final party = [
|
||||
member('a', 'Alex', ready: true),
|
||||
member('b', 'Bob'),
|
||||
member('c', 'Cleo', ready: true),
|
||||
member('d', 'Dan'),
|
||||
member('e', 'Eve', stale: true),
|
||||
member('f', 'Finn'),
|
||||
];
|
||||
|
||||
group('party strip', () {
|
||||
testWidgets('offline: Join and Host, no party', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
expect(find.byKey(const ValueKey('strip-join')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('strip-host')), findsOneWidget);
|
||||
expect(find.text('Offline'), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('party-avatars')), findsNothing);
|
||||
expect(find.byKey(const ValueKey('strip-leave')), findsNothing);
|
||||
expect(tester.getSize(find.byType(PartyStrip)).height, partyStripHeight);
|
||||
});
|
||||
|
||||
testWidgets('online: avatars, server and readiness, chat, Leave', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
online(party, media: false);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const ValueKey('strip-join')), findsNothing);
|
||||
expect(find.byKey(const ValueKey('strip-leave')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('strip-chat')), findsOneWidget);
|
||||
expect(find.text('ready 2/6'), findsOneWidget);
|
||||
final stack = find.byKey(const ValueKey('party-avatars'));
|
||||
// Five shown, the sixth as "+1"; ready ones first.
|
||||
expect(find.descendant(of: stack, matching: find.byType(StatusAvatar)), findsNWidgets(5));
|
||||
expect(find.descendant(of: stack, matching: find.text('+1')), findsOneWidget);
|
||||
final alex = tester.getTopLeft(find.descendant(of: stack, matching: find.byTooltip('Alex')));
|
||||
final bob = tester.getTopLeft(find.descendant(of: stack, matching: find.byTooltip('Bob')));
|
||||
expect(alex.dx, lessThan(bob.dx));
|
||||
// Leave asks first.
|
||||
await tester.tap(find.byKey(const ValueKey('strip-leave')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Leave server?'), findsOneWidget);
|
||||
await tester.tap(find.text('Cancel'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(session.route.value, AppRoute.session);
|
||||
});
|
||||
|
||||
testWidgets('compact below 1100 px: 3 avatars, no server text', (tester) async {
|
||||
await pumpShell(tester, const Size(1000, 800));
|
||||
online(party, media: false);
|
||||
await tester.pumpAndSettle();
|
||||
final stack = find.byKey(const ValueKey('party-avatars'));
|
||||
expect(find.descendant(of: stack, matching: find.byType(StatusAvatar)), findsNWidgets(3));
|
||||
expect(find.descendant(of: stack, matching: find.text('+3')), findsOneWidget);
|
||||
expect(find.byKey(const ValueKey('server-label')), findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('tabs: the underline moves to the selected one', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
double underline(String tab) => tester
|
||||
.getSize(find.descendant(of: find.byKey(ValueKey('tab-$tab')), matching: find.byType(AnimatedContainer)))
|
||||
.width;
|
||||
expect(underline('library'), 22);
|
||||
expect(underline('settings'), 0);
|
||||
await tester.tap(find.byKey(const ValueKey('tab-settings')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(underline('library'), 0);
|
||||
expect(underline('settings'), 22);
|
||||
});
|
||||
});
|
||||
|
||||
group('popovers', () {
|
||||
testWidgets('members card opens from the avatars and closes outside', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
online(party, media: false);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const ValueKey('avatar-stack')));
|
||||
await tester.pumpAndSettle();
|
||||
final card = find.byKey(const ValueKey('members-card'));
|
||||
expect(card, findsOneWidget);
|
||||
for (final m in party) {
|
||||
expect(find.descendant(of: card, matching: find.text(m.name)), findsOneWidget);
|
||||
}
|
||||
expect(find.descendant(of: card, matching: find.text('reconnecting…')), findsOneWidget);
|
||||
// The kick menu asks before kicking.
|
||||
await tester.tap(find.descendant(of: find.byKey(const ValueKey('member-b')), matching: find.byTooltip('More')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.text('Kick'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Remove Bob?'), findsOneWidget);
|
||||
await tester.tap(find.text('Cancel'));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tapAt(const Offset(40, 700));
|
||||
await tester.pumpAndSettle();
|
||||
expect(card, findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('profile card opens from your avatar; its links open Settings', (tester) async {
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
await tester.tap(find.byKey(const ValueKey('strip-profile')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ProfileCard), findsOneWidget);
|
||||
expect(find.text('offline'), findsOneWidget);
|
||||
await tester.tap(find.text('About'));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ProfileCard), findsNothing);
|
||||
expect(find.text('Dev build — update checks are off'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('showPopover fades and scales in, Esc closes it', (tester) async {
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Builder(
|
||||
builder: (context) => Center(
|
||||
child: TextButton(
|
||||
onPressed: () => showPopover<void>(context, at: Alignment.topRight, child: const Text('card')),
|
||||
child: const Text('open'),
|
||||
),
|
||||
),
|
||||
),
|
||||
));
|
||||
await tester.tap(find.text('open'));
|
||||
await tester.pump();
|
||||
await tester.pump(easeTime ~/ 2);
|
||||
final fade = tester.widget<FadeTransition>(
|
||||
find.ancestor(of: find.text('card'), matching: find.byType(FadeTransition)).first);
|
||||
expect(fade.opacity.value, inExclusiveRange(0.0, 1.0));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('card'), findsOneWidget);
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('card'), findsNothing);
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('profile rename goes to the server through the hook', (tester) async {
|
||||
final pushed = <String?>[];
|
||||
final p = Profile.instance;
|
||||
final before = p.push;
|
||||
p.push = ({String? name, String? avatar}) => pushed.add(name);
|
||||
addTearDown(() => p.push = before);
|
||||
session.lastForm.name = 'Old';
|
||||
p.name.value = 'Old';
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
home: Scaffold(body: Center(child: ProfileCard(onOpenSettings: (_) {}))),
|
||||
));
|
||||
await tester.enterText(find.byKey(const ValueKey('profile-name')), 'Neo');
|
||||
await tester.pump();
|
||||
expect(p.name.value, 'Neo');
|
||||
expect(session.lastForm.name, 'Neo');
|
||||
// Typing settles before it is sent, once.
|
||||
expect(pushed, isEmpty);
|
||||
await tester.pump(const Duration(milliseconds: 700));
|
||||
expect(pushed, ['Neo']);
|
||||
});
|
||||
|
||||
testWidgets('player: mini and full share one video, never two', (tester) async {
|
||||
coord.playback.alive.value = true;
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
online(party);
|
||||
await tester.pumpAndSettle();
|
||||
final videos = find.byType(FakeVideo);
|
||||
AppShellState shell() => tester.state<AppShellState>(find.byType(AppShell));
|
||||
// Joined with something up: it opens full.
|
||||
expect(shell().mode, PlayerMode.full);
|
||||
expect(videos, findsOneWidget);
|
||||
expect(tester.getSize(videos), tester.getSize(find.byKey(const ValueKey('body'))));
|
||||
|
||||
Future<void> stepThrough() async {
|
||||
for (var i = 0; i < 30; i++) {
|
||||
await tester.pump(const Duration(milliseconds: 16));
|
||||
expect(videos, findsOneWidget);
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
expect(videos, findsOneWidget);
|
||||
}
|
||||
|
||||
// A tab sends it to the mini player.
|
||||
await tester.tap(find.byKey(const ValueKey('tab-settings')));
|
||||
await stepThrough();
|
||||
expect(shell().mode, PlayerMode.mini);
|
||||
expect(tester.getSize(videos), AppShellState.miniSize);
|
||||
expect(find.byType(SettingsTab), findsOneWidget);
|
||||
// Double-click on the mini: full again.
|
||||
final mini = tester.getCenter(videos);
|
||||
await tester.tapAt(mini);
|
||||
await tester.tapAt(mini);
|
||||
await stepThrough();
|
||||
expect(shell().mode, PlayerMode.full);
|
||||
// F: fullscreen hides the strip; Esc leaves it.
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.keyF);
|
||||
await stepThrough();
|
||||
expect(shell().fullscreen, isTrue);
|
||||
expect(find.byType(PartyStrip), findsNothing);
|
||||
// Player keys are debounced on the wall clock.
|
||||
await tester.runAsync(() => Future<void>.delayed(const Duration(milliseconds: 400)));
|
||||
await tester.sendKeyEvent(LogicalKeyboardKey.escape);
|
||||
await stepThrough();
|
||||
expect(shell().fullscreen, isFalse);
|
||||
expect(find.byType(PartyStrip), findsOneWidget);
|
||||
// Never rebuilt from scratch on the way.
|
||||
expect(FakeVideo.created, 1);
|
||||
// Offline: no player at all.
|
||||
session.route.value = AppRoute.home;
|
||||
await tester.pumpAndSettle();
|
||||
expect(videos, findsNothing);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('waiting pill: who is not ready, or you', (tester) async {
|
||||
coord.playback.alive.value = true;
|
||||
await pumpShell(tester, const Size(1280, 800));
|
||||
online([member('a', 'Alex', ready: true), member('b', 'Bob'), member('c', 'Cleo')]);
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Waiting for Bob, Cleo'), findsOneWidget);
|
||||
});
|
||||
|
||||
test('toasts: feed toasts carry the actor, the rest are the app\'s', () {
|
||||
AvatarInfo who(String n) => AvatarInfo(name: n, color: Colors.teal);
|
||||
final at = DateTime.now();
|
||||
final names = ['Bob', 'Bob Jr'];
|
||||
final chat = shellToastFor(ToastItem(id: 1, text: 'Bob Jr: hi there', at: at), names, who);
|
||||
expect(chat.who!.name, 'Bob Jr');
|
||||
expect(chat.text, 'hi there');
|
||||
expect(chat.chat, isTrue);
|
||||
final joined = shellToastFor(ToastItem(id: 2, text: 'Bob joined', at: at), names, who);
|
||||
expect(joined.who!.name, 'Bob');
|
||||
expect(joined.text, 'joined');
|
||||
expect(joined.icon, Icons.login);
|
||||
final app = shellToastFor(ToastItem(id: 3, text: 'Video froze — reloaded', at: at), names, who);
|
||||
expect(app.who, isNull);
|
||||
});
|
||||
|
||||
testWidgets('toasts slide in with an avatar and leave after their time', (tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(home: Scaffold(body: PartyToasts(life: Duration(seconds: 1)))));
|
||||
coord.toasts.value = [ToastItem(id: 1, text: 'Video froze — reloaded', at: DateTime.now())];
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(find.text('Video froze — reloaded'), findsOneWidget);
|
||||
await tester.pump(const Duration(seconds: 1));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('Video froze — reloaded'), findsNothing);
|
||||
});
|
||||
|
||||
testWidgets('status avatar fills its box at any size', (tester) async {
|
||||
await tester.pumpWidget(const MaterialApp(
|
||||
home: Center(
|
||||
child: StatusAvatar(info: AvatarInfo(name: 'Zed', color: Colors.teal, ready: true), size: 88),
|
||||
),
|
||||
));
|
||||
final circle = tester.getSize(find.byType(CircleAvatar));
|
||||
// Ring and gap (2 x 4 px each side at this size) inside the 88 px box.
|
||||
expect(circle.width, 88 - 4 * 4);
|
||||
expect(find.text('Z'), findsOneWidget);
|
||||
});
|
||||
}
|
||||
@@ -11,9 +11,9 @@ import 'package:watch_together/src/controls/uosc/timeline.dart';
|
||||
import 'package:watch_together/src/jellyfin/track_prefs.dart';
|
||||
import 'package:watch_together/src/playback/media_marks.dart';
|
||||
import 'package:watch_together/src/playback/playback_controller.dart' show RenderMode;
|
||||
import 'package:watch_together/src/screens/home/settings_page.dart';
|
||||
import 'package:watch_together/src/screens/session/player_controls.dart' show TrackPick;
|
||||
import 'package:watch_together/src/shaders/shader_presets.dart';
|
||||
import 'package:watch_together/src/shell/settings_tab.dart';
|
||||
import 'package:watch_together/src/state/settings.dart';
|
||||
import 'package:watch_together/src/update/update_controller.dart';
|
||||
|
||||
@@ -456,7 +456,13 @@ void main() {
|
||||
addTearDown(tester.view.reset);
|
||||
await tester.pumpWidget(MaterialApp(
|
||||
theme: ThemeData.dark(),
|
||||
home: Scaffold(body: SettingsPage(updates: UpdateController(currentVersion: '0.0.0-dev'))),
|
||||
home: Scaffold(
|
||||
body: SettingsTab(
|
||||
section: SettingsSection.player,
|
||||
onSection: (_) {},
|
||||
updates: UpdateController(currentVersion: '0.0.0-dev'),
|
||||
),
|
||||
),
|
||||
));
|
||||
final toggle = find.byKey(const ValueKey('mpv-controls'));
|
||||
expect(find.text('Experimental: mpv-style controls'), findsOneWidget);
|
||||
|
||||
Reference in new issue
Block a user