MemoryLogOutput extended LogOutput but was never wired as a Logger output (storage happens in the printer); DeletionNotifier/WatchStateNotifier's forServer/forItem filtered streams and WatchStateEvent.mediaType had no production consumers (tests now filter .stream directly); context.hiddenLibraries/profileSettings and toPlexUrl had zero call sites; MonoTokens.splashFactory was never read; OptimizedMediaImage's enableTranscoding/cacheKey chains, FocusableMediaCard.width/height/forceGridMode, TvBrowseRail's constant-zero gap functions, and media_image_helper's scaleFactor were never varied by any caller. The sha1 LRU stays (rebuild-hot artwork URLs); TvRailTrailing.none and the mono-theme copyWith stay live (lerp delegates to copyWith). Also carries the MusicPlayContext.id argument drops in the music screens and remaining sweep test updates.
27 lines
939 B
Dart
27 lines
939 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:plezy/utils/plex_url_helper.dart';
|
|
|
|
void main() {
|
|
group('withPlexToken', () {
|
|
test('appends with ? when no existing query', () {
|
|
expect('/library/metadata/1'.withPlexToken('abc'), '/library/metadata/1?X-Plex-Token=abc');
|
|
});
|
|
|
|
test('appends with & when query already present', () {
|
|
expect('/library/metadata/1?type=1'.withPlexToken('abc'), '/library/metadata/1?type=1&X-Plex-Token=abc');
|
|
});
|
|
|
|
test('returns original URL when token is null', () {
|
|
expect('/library/metadata/1'.withPlexToken(null), '/library/metadata/1');
|
|
});
|
|
|
|
test('returns original URL when token is empty', () {
|
|
expect('/library/metadata/1'.withPlexToken(''), '/library/metadata/1');
|
|
});
|
|
|
|
test('treats trailing ? (no params yet) as already having query', () {
|
|
expect('/path?'.withPlexToken('tk'), '/path?&X-Plex-Token=tk');
|
|
});
|
|
});
|
|
}
|