为什么:a) 应用对外名称要统一成 FruitShorts(产品名,nontonki 是原型代号); b) 首发市场是印尼,界面必须有印尼语;c) 归档要求"新增 id-ID 与改名合并生成一次 l10n,别分两次"。 改名: - pubspec name: nontonki → fruitshorts(Dart 包名),description 同步;28 个文件的 package: 导入前缀替换 - Android android:label、iOS CFBundleDisplayName/CFBundleName → FruitShorts - 图标资源 assets/icon/nontonki.png → fruitshorts.png(含 pubspec 两处引用) - README 同步(补印尼语说明,顺带修掉写错的模块名 reelshort-app-api → fruitshorts-app-api) 文案: - 三份 arb 的 appName → FruitShorts、brandMark → FRUITSHORTS、shareFooter → FruitShorts(不留 demo 标记) - 新增 lib/l10n/app_id.arb:174 个值键与 en/zh 完全一致,按印尼语习惯翻译(Coin→Koin、Episode→Episode) - 一次性 flutter gen-l10n 生成 app_localizations_id.dart;id 自动进入 supportedLocales,默认 locale 未改 - 新增 test/config/l10n_id_test.dart:钉住 id 文案、supportedLocales 含 id、品牌文案无 demo 标记、占位符渲染 不动:applicationId / bundle id(lumadrama 遗留,等裁定)、目录名、业务逻辑与页面结构、语言选择页(仍只有 en/zh) 门禁:dart analyze lib test 零告警;flutter test 159 全过(基线 155 + 新增 4);残留扫描 0 命中; 三份 arb 键集一致(174/174/174);真机(iPhone iOS 26.6.1)构建安装启动成功,devicectl 列出显示名 FruitShorts
77 lines
2.2 KiB
Dart
77 lines
2.2 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:fruitshorts/core/data/models/drama.dart';
|
|
import 'package:fruitshorts/core/data/services/playback_queue.dart';
|
|
|
|
void main() {
|
|
test('should_advance_between_dramas_on_home_and_between_episodes_in_series_when_queue_is_built', () {
|
|
final dramas = [_drama('a', 3), _drama('b', 2), _drama('c', 4)];
|
|
|
|
final home = PlaybackQueue.home(dramas);
|
|
expect(home.length, 3);
|
|
expect(home.entryAt(0).drama.id, 'a');
|
|
expect(home.entryAt(1).drama.id, 'b');
|
|
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);
|
|
});
|
|
|
|
test('should_leave_dramas_out_when_they_have_no_episodes', () {
|
|
final home = PlaybackQueue.home([
|
|
_drama('a', 2),
|
|
Drama(
|
|
id: 'empty',
|
|
title: '没有剧集',
|
|
synopsis: '',
|
|
posterUrl: '/files/empty.jpg',
|
|
),
|
|
]);
|
|
expect(home.length, 1);
|
|
expect(home.entryAt(0).drama.id, 'a');
|
|
});
|
|
|
|
test('should_play_preview_episode_when_list_card_has_one', () {
|
|
final home = PlaybackQueue.home([
|
|
Drama.fromCardJson(const {
|
|
'id': 5,
|
|
'title': '闪婚后',
|
|
'cover': '/files/cover.jpg',
|
|
'totalEpisodes': 77,
|
|
'preview': {
|
|
'id': 9,
|
|
'number': 1,
|
|
'title': '第 1 集',
|
|
'isFree': true,
|
|
'playUrl': '/files/episode/9.mp4',
|
|
},
|
|
}),
|
|
]);
|
|
|
|
expect(home.length, 1);
|
|
expect(home.entryAt(0).episode.videoUrl, '/files/episode/9.mp4');
|
|
});
|
|
}
|
|
|
|
Drama _drama(String id, int episodeCount) => Drama(
|
|
id: id,
|
|
title: 'Drama $id',
|
|
synopsis: '简介 $id',
|
|
posterUrl: '/files/$id.jpg',
|
|
episodes: [
|
|
for (var index = 1; index <= episodeCount; index++)
|
|
Episode(
|
|
id: '$id-$index',
|
|
number: index,
|
|
title: '第 $index 集',
|
|
isFree: true,
|
|
videoUrl: 'https://example.test/$id-$index.mp4',
|
|
),
|
|
],
|
|
);
|