You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1011 B
31 lines
1011 B
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:voitrans/modules/meeting/controllers/meeting_record_controller.dart';
|
|
|
|
void main() {
|
|
group('MeetingRecordController.sanitizeRecordingFileStem', () {
|
|
test('removes path separators from localized titles', () {
|
|
final safe = MeetingRecordController.sanitizeRecordingFileStem(
|
|
'Audio/Video Recording',
|
|
);
|
|
expect(safe.contains('/'), isFalse);
|
|
expect(safe.contains('\\'), isFalse);
|
|
expect(safe, isNotEmpty);
|
|
});
|
|
|
|
test('works for other locales that contain "/"', () {
|
|
final safe = MeetingRecordController.sanitizeRecordingFileStem(
|
|
'تسجيل صوت/فيديو',
|
|
);
|
|
expect(safe.contains('/'), isFalse);
|
|
expect(safe, isNotEmpty);
|
|
});
|
|
|
|
test('falls back when sanitized result is empty', () {
|
|
final safe = MeetingRecordController.sanitizeRecordingFileStem(
|
|
'///',
|
|
fallback: 'fallback',
|
|
);
|
|
expect(safe, 'fallback');
|
|
});
|
|
});
|
|
}
|
|
|