fix(tvos): hide unsupported playback options
This commit is contained in:
@@ -3,6 +3,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:plezy/models/hotkey_model.dart';
|
||||
import 'package:plezy/services/settings_service.dart';
|
||||
import 'package:plezy/services/trackers/tracker_constants.dart';
|
||||
import 'package:plezy/utils/platform_detector.dart';
|
||||
|
||||
import '../test_helpers/prefs.dart';
|
||||
|
||||
@@ -12,6 +13,10 @@ void main() {
|
||||
SettingsService.resetForTesting();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
TvDetectionService.debugSetAppleTVOverride(null);
|
||||
});
|
||||
|
||||
group('SettingsService.parseMpvConfigText', () {
|
||||
test('parses plain key=value lines', () {
|
||||
final out = SettingsService.parseMpvConfigText('hwdec=auto\nvolume=100');
|
||||
@@ -82,6 +87,26 @@ void main() {
|
||||
});
|
||||
});
|
||||
|
||||
group('SettingsService platform gates', () {
|
||||
test('forces external player off on Apple TV even when stored enabled', () async {
|
||||
final settings = await SettingsService.getInstance();
|
||||
await settings.write(SettingsService.useExternalPlayer, true);
|
||||
|
||||
TvDetectionService.debugSetAppleTVOverride(true);
|
||||
|
||||
expect(settings.read(SettingsService.useExternalPlayer), isFalse);
|
||||
});
|
||||
|
||||
test('forces auto PiP off on Apple TV even when stored enabled', () async {
|
||||
final settings = await SettingsService.getInstance();
|
||||
await settings.write(SettingsService.autoPip, true);
|
||||
|
||||
TvDetectionService.debugSetAppleTVOverride(true);
|
||||
|
||||
expect(settings.read(SettingsService.autoPip), isFalse);
|
||||
});
|
||||
});
|
||||
|
||||
group('SettingsService companion remote prefs', () {
|
||||
test('last manual host address trims whitespace and drops blanks', () async {
|
||||
final settings = await SettingsService.getInstance();
|
||||
|
||||
Reference in New Issue
Block a user