feat(flutter): 接入互动评论点赞举报
This commit is contained in:
1 parent
45f5f25640
commit
d361034226
39 files changed
+3298
-462
No files matched your search
@@ -2,6 +2,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/core/data/models/drama.dart';
|
||||
import 'package:fruitshorts/core/formatting/localized_content.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_en.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_id.dart';
|
||||
import 'package:fruitshorts/l10n/app_localizations_zh.dart';
|
||||
|
||||
Drama _drama({required String id, String title = 'raw', String synopsis = 'raw'}) =>
|
||||
@@ -16,6 +17,7 @@ Drama _drama({required String id, String title = 'raw', String synopsis = 'raw'}
|
||||
void main() {
|
||||
final en = AppLocalizationsEn();
|
||||
final zh = AppLocalizationsZh();
|
||||
final id = AppLocalizationsId();
|
||||
|
||||
test('should_map_each_seeded_drama_to_its_own_localized_copy_when_looked_up', () {
|
||||
final signal = _drama(id: 'the-signal-demo');
|
||||
@@ -93,4 +95,21 @@ void main() {
|
||||
}
|
||||
expect(localizedEpisodeTitle(zh, 12), zh.episodeLabel(12));
|
||||
});
|
||||
|
||||
test('should_build_share_copy_from_localized_title_synopsis_and_footer', () {
|
||||
final signal = _drama(id: 'the-signal-demo');
|
||||
final copies = {
|
||||
for (final l10n in [en, zh, id])
|
||||
'${localizedDramaTitle(l10n, signal)}\n'
|
||||
'${localizedDramaSynopsis(l10n, signal)}\n'
|
||||
'${l10n.shareFooter}',
|
||||
};
|
||||
|
||||
expect(copies, hasLength(3));
|
||||
for (final copy in copies) {
|
||||
expect(copy, contains('FruitShorts'));
|
||||
expect(copy.split('\n'), hasLength(3));
|
||||
expect(copy.split('\n').every((line) => line.isNotEmpty), isTrue);
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user