import 'package:flutter_test/flutter_test.dart';
import 'package:submanager/services/subscription_url_matcher.dart';

void main() {
  TestWidgetsFlutterBinding.ensureInitialized();

  test('extractDomain parses host correctly', () async {
    await SubscriptionUrlMatcher.initialize();
    final domain =
        SubscriptionUrlMatcher.extractDomain('https://www.netflix.com/kr');
    expect(domain, 'netflix');
  });

  test('findMatchingUrl finds known service', () async {
    await SubscriptionUrlMatcher.initialize();
    final url = SubscriptionUrlMatcher.findMatchingUrl('넷플릭스');
    expect(url, isNotNull);
  });
}
