Gitea CI / Check code and tests (push) Successful in 6m37s
Gitea CI / Build Windows x64 app (push) Successful in 3m18s
Gitea CI / Build Android APK (push) Successful in 3m47s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m7s
Gitea CI / Assemble and validate CI artifacts (push) Successful in 50s
Gitea CI / Gitea CI passed (push) Successful in 2s
Gitea Release / Prepare draft Release (push) Successful in 9s
Gitea Release / Upload Android to draft Release (push) Successful in 16s
Gitea Release / Upload Windows to draft Release (push) Successful in 22s
Gitea Release / Verify and publish Release (push) Successful in 14s
44 lines
1.3 KiB
Dart
44 lines
1.3 KiB
Dart
import 'package:cutdex/features/projects/project_switch_region.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
Widget region(String? pending) => Directionality(
|
|
textDirection: TextDirection.ltr,
|
|
child: ProjectSwitchRegion(
|
|
pendingProjectId: pending,
|
|
child: const Text('content'),
|
|
),
|
|
);
|
|
|
|
testWidgets('slow and superseded switches retain mounted content', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(region(null));
|
|
final content = tester.element(find.text('content'));
|
|
for (final target in ['A', 'B', null]) {
|
|
await tester.pumpWidget(region(target));
|
|
await tester.pump(const Duration(seconds: 5));
|
|
expect(tester.element(find.text('content')), same(content));
|
|
expect(
|
|
tester.widget<IgnorePointer>(find.byType(IgnorePointer)).ignoring,
|
|
target != null,
|
|
);
|
|
expect(
|
|
tester.widget<ExcludeFocus>(find.byType(ExcludeFocus)).excluding,
|
|
target != null,
|
|
);
|
|
expect(tester.takeException(), isNull);
|
|
}
|
|
});
|
|
|
|
testWidgets('disposing during preparation leaves no pending work', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(region('A'));
|
|
await tester.pumpWidget(const SizedBox());
|
|
await tester.pump(const Duration(seconds: 5));
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
}
|