Files
999/test/external_symbols_repository_test.dart

27 lines
951 B
Dart

import 'package:flutter_test/flutter_test.dart';
import 'package:words999/services/external_symbols_repository.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
test('ExternalSymbolsRepository loads 2300+ symbols and supports search and illustrations', () async {
final repo = ExternalSymbolsRepository();
await repo.init();
expect(repo.isLoaded, isTrue);
expect(repo.totalCount, greaterThanOrEqualTo(1400));
// Test search
final results = repo.search('акант');
expect(results.isNotEmpty, isTrue);
expect(results.first.term.toLowerCase(), contains('акант'));
expect(results.first.sources.isNotEmpty, isTrue);
// Test with illustrations
final withImages = repo.search('', onlyWithImages: true);
expect(withImages.isNotEmpty, isTrue);
expect(withImages.first.hasIllustrations, isTrue);
expect(withImages.first.illustrations.first['file'], isNotEmpty);
});
}