Files
SpotiFLAC-Mobile/test/activity_attachment_test.dart
T
zarzet 37e21b5712 feat(branding): rename app and native backend to Mornye
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases.

Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
2026-10-20 12:00:44 +07:00

32 lines
990 B
Dart

import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mornye/services/activity_attachment.dart';
void main() {
testWidgets('startup waits until an Activity reports its lifecycle', (
tester,
) async {
final binding = tester.binding;
binding.handleAppLifecycleStateChanged(AppLifecycleState.detached);
var attached = false;
final waiting = waitForActivityAttachment(
binding,
).then((_) => attached = true);
await tester.pump();
expect(attached, isFalse);
binding.handleAppLifecycleStateChanged(AppLifecycleState.resumed);
await waiting;
expect(attached, isTrue);
});
testWidgets('an attached Activity does not delay startup', (tester) async {
tester.binding.handleAppLifecycleStateChanged(AppLifecycleState.resumed);
var attached = false;
await waitForActivityAttachment(
tester.binding,
).then((_) => attached = true);
expect(attached, isTrue);
});
}