feat(apps): 重构 UI 架构为 presentation 层并新增 l10n 国际化支持
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:social_app/shared/utils/phone_display_formatter.dart';
|
||||
|
||||
void main() {
|
||||
group('formatPhoneForDisplay', () {
|
||||
test('formats +86 numbers as local masked style', () {
|
||||
final formatted = formatPhoneForDisplay('+8613812345678');
|
||||
|
||||
expect(formatted, '138****5678');
|
||||
});
|
||||
|
||||
test('keeps international country code while masking middle part', () {
|
||||
final formatted = formatPhoneForDisplay('+14155552671');
|
||||
|
||||
expect(formatted, '+1 ****2671');
|
||||
});
|
||||
|
||||
test('normalizes separators before formatting', () {
|
||||
final formatted = formatPhoneForDisplay('(+86) 138-1234-5678');
|
||||
|
||||
expect(formatted, '138****5678');
|
||||
});
|
||||
|
||||
test('prefers longer country code in fallback detection', () {
|
||||
final formatted = formatPhoneForDisplay('+33612345678');
|
||||
|
||||
expect(formatted, '+33 ****5678');
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:social_app/shared/utils/tool_name_localizer.dart';
|
||||
|
||||
void main() {
|
||||
group('localizeToolName', () {
|
||||
test('translates dot style tool names', () {
|
||||
expect(localizeToolName('memory.write'), '写入记忆');
|
||||
expect(localizeToolName('calendar.read'), '读取日程');
|
||||
});
|
||||
|
||||
test('translates snake style aliases', () {
|
||||
expect(localizeToolName('memory_write'), '写入记忆');
|
||||
expect(localizeToolName('calendar_read'), '读取日程');
|
||||
});
|
||||
|
||||
test('returns raw name for unknown tool', () {
|
||||
expect(localizeToolName('unknown.tool'), 'unknown.tool');
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user