Fix feed tag search and prepare 2.0.1+22
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import 'dart:ffi' show Abi;
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
@@ -15,6 +16,7 @@ import 'package:gel_rule_app/core/cache/cache_service.dart';
|
||||
import 'package:gel_rule_app/core/database/app_database.dart';
|
||||
import 'package:gel_rule_app/core/database/database_service.dart';
|
||||
import 'package:gel_rule_app/core/utils/result.dart';
|
||||
import 'package:isar/isar.dart';
|
||||
|
||||
void main() {
|
||||
late Directory directory;
|
||||
@@ -24,6 +26,14 @@ void main() {
|
||||
late File copiedIsarDll;
|
||||
|
||||
setUpAll(() async {
|
||||
if (Platform.isLinux) {
|
||||
await Isar.initializeIsarCore(
|
||||
libraries: {
|
||||
Abi.linuxX64:
|
||||
'${Directory.current.path}/third_party/isar_flutter_libs/linux/libisar.so',
|
||||
},
|
||||
);
|
||||
}
|
||||
copiedIsarDll =
|
||||
File('${Directory.current.path}${Platform.pathSeparator}isar.dll');
|
||||
if (Platform.isWindows && !copiedIsarDll.existsSync()) {
|
||||
|
||||
@@ -57,6 +57,48 @@ void main() {
|
||||
expect(changed, 'video');
|
||||
});
|
||||
|
||||
testWidgets('clear button removes all committed tags', (tester) async {
|
||||
String? changed;
|
||||
await tester.pumpWidget(_Harness(
|
||||
child: TagInputSearchBar(
|
||||
initialValue: 'touhou video',
|
||||
onSubmitted: (_) {},
|
||||
onChanged: (value) {
|
||||
changed = value;
|
||||
},
|
||||
),
|
||||
));
|
||||
|
||||
await tester.tap(find.byTooltip('Clear'));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('touhou'), findsNothing);
|
||||
expect(find.text('video'), findsNothing);
|
||||
expect(changed, '');
|
||||
});
|
||||
|
||||
testWidgets('external initial value replaces committed tags', (tester) async {
|
||||
await tester.pumpWidget(_Harness(
|
||||
child: TagInputSearchBar(
|
||||
initialValue: 'old_tag',
|
||||
onSubmitted: (_) {},
|
||||
),
|
||||
));
|
||||
|
||||
expect(find.text('old_tag'), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(_Harness(
|
||||
child: TagInputSearchBar(
|
||||
initialValue: 'new_tag',
|
||||
onSubmitted: (_) {},
|
||||
),
|
||||
));
|
||||
await tester.pump();
|
||||
|
||||
expect(find.text('old_tag'), findsNothing);
|
||||
expect(find.text('new_tag'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('suggestion appends active tag as a chip', (tester) async {
|
||||
String? applied;
|
||||
await tester.pumpWidget(_Harness(
|
||||
|
||||
Reference in New Issue
Block a user