提交 Nontonki 短剧原型,准备推送到远程仓库。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
b1f6ce4bf9
148 files changed
+11175
No files matched your search
@@ -0,0 +1,26 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:nontonki/core/data/repositories/catalog_repository.dart';
|
||||
import 'package:nontonki/core/data/services/playback_queue.dart';
|
||||
|
||||
void main() {
|
||||
test(
|
||||
'home feed advances between dramas, series player between episodes',
|
||||
() async {
|
||||
final dramas = await DemoCatalogRepository().fetchDramas();
|
||||
final home = PlaybackQueue.home(dramas);
|
||||
expect(home.length, 3);
|
||||
expect(home.entryAt(0).drama.id, dramas[0].id);
|
||||
expect(home.entryAt(1).drama.id, dramas[1].id);
|
||||
expect(home.entryAt(1).episode.number, 1);
|
||||
expect(home.nextIndex(0), 1);
|
||||
expect(home.nextIndex(2), isNull);
|
||||
|
||||
final series = PlaybackQueue.series(dramas[0]);
|
||||
expect(series.length, 3);
|
||||
expect(series.entryAt(0).drama.id, series.entryAt(1).drama.id);
|
||||
expect(series.entryAt(1).episode.number, 2);
|
||||
expect(series.nextIndex(0), 1);
|
||||
expect(series.nextIndex(2), isNull);
|
||||
},
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user