Skip to content

Commit

Permalink
Fixing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Dante291 committed Nov 27, 2023
1 parent e7cb6d8 commit 8b19ccd
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion test/plugins/talawa_plugin_provider_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void main() {
'pluginCreatedBy': 'User A',
'pluginDesc': 'Description A',
'pluginInstallStatus': false,
'installedOrgs': ['org1'],
'installedOrgs': ['org2'],
},
],
);
Expand Down Expand Up @@ -134,6 +134,36 @@ void main() {

expect(find.text('Test Plugin'), findsOneWidget);
});
testWidgets(
'Widget displays child when not visible but plugin is already installed in that org',
(WidgetTester tester) async {
box.put(
'plugins',
[
{
'_id': '1',
'pluginName': 'Plugin 1',
'pluginCreatedBy': 'User A',
'pluginDesc': 'Description A',
'pluginInstallStatus': false,
'installedOrgs': ['org1'],
},
],
);

when(userConfig.currentOrg).thenReturn(org);
await tester.pumpWidget(
const MaterialApp(
home: TalawaPluginProvider(
visible: false,
pluginName: 'Plugin 1',
child: Text('Test Plugin'),
),
),
);

expect(find.text('Test Plugin'), findsOneWidget);
});
testWidgets(
'Widget displays child when visible but plugins are not installed',
(WidgetTester tester) async {
Expand Down

0 comments on commit 8b19ccd

Please sign in to comment.