Files
jinzhi/test/features/web/web_page_test.dart
T
2026-08-24 19:07:31 +08:00

15 lines
477 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:jinzhi_flutter_app/features/web/presentation/web_page.dart';
void main() {
test('accepts only http and https URLs with a host', () {
expect(
parseSafeWebUri('https://h5.example.com/page')?.host,
'h5.example.com',
);
expect(parseSafeWebUri('mailto:test@example.com'), isNull);
expect(parseSafeWebUri('javascript:alert(1)'), isNull);
expect(parseSafeWebUri(''), isNull);
});
}