Offline Support
This commit is contained in:
@@ -1,27 +1,13 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:supabase_flutter/supabase_flutter.dart';
|
||||
import 'package:tasq/providers/realtime_controller.dart';
|
||||
import 'package:tasq/providers/stream_recovery.dart';
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// RealtimeController only accesses `_client.auth.onAuthStateChange` during
|
||||
// `_init()`, which wraps the subscription in a try-catch. We use a minimal
|
||||
// SupabaseClient pointed at localhost — the auth stream subscription will
|
||||
// either return an empty stream or throw (caught internally), so no network
|
||||
// activity occurs during tests.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
void main() {
|
||||
group('RealtimeController', () {
|
||||
late RealtimeController controller;
|
||||
|
||||
setUp(() {
|
||||
// SupabaseClient constructor does not connect eagerly; _init() catches
|
||||
// any exception thrown when accessing auth.onAuthStateChange.
|
||||
controller = RealtimeController(
|
||||
SupabaseClient('http://localhost', 'test-anon-key',
|
||||
authOptions: const AuthClientOptions(autoRefreshToken: false)),
|
||||
);
|
||||
controller = RealtimeController();
|
||||
});
|
||||
|
||||
tearDown(() {
|
||||
|
||||
Reference in New Issue
Block a user