Test that selectedIdEditStateProvider has initial value of null

This commit is contained in:
Sixtus Agbo
2024-03-12 04:07:09 +01:00
parent f71bf00dc3
commit a057281a6f

View File

@ -2,6 +2,7 @@ import 'dart:io';
import 'package:apidash/providers/providers.dart';
import 'package:apidash/screens/dashboard.dart';
import 'package:apidash/screens/home_page/collection_pane.dart';
import 'package:apidash/screens/home_page/home_page.dart';
import 'package:apidash/screens/intro_page.dart';
import 'package:apidash/screens/settings_page.dart';
@ -211,4 +212,23 @@ void main() {
expect(isDisposed, true);
});
});
group("Testing selectedIdEditStateProvider", () {
testWidgets(
'selectedIdEditStateProvider should have an initial value of null',
(tester) async {
await tester.pumpWidget(
const ProviderScope(
child: MaterialApp(
home: CollectionPane(),
),
),
);
// Verify that the initial value is null
final collectionPane = tester.element(find.byType(CollectionPane));
final container = ProviderScope.containerOf(collectionPane);
expect(container.read(selectedIdEditStateProvider), null);
});
});
}