talawa icon indicating copy to clipboard operation
talawa copied to clipboard

Unittests for widget organization_list.dart

Open palisadoes opened this issue 2 years ago • 36 comments

  • Please coordinate issue assignment and PR reviews with the contributors listed in this issue https://github.com/PalisadoesFoundation/talawa/issues/359

We will need unittests done for all methods, classes and functions found in this file.

Any widgets referenced in this file must also have unittests done

organization_list.dart 

This file can be found in the lib/widgets directory

Parent Issue:

  • https://github.com/PalisadoesFoundation/talawa/issues/1125

PR Acceptance Criteria

  • When complete this file must show 100% coverage when merged into the code base.
  • The current code coverage for the file can be found here
  • The PR will show a report for the code coverage for the file you have added. You can use that as a guide
  • No functionality must be removed to achieve this goal

palisadoes avatar Apr 02 '22 17:04 palisadoes

Hi can I work on this one?

vedantkulkarni avatar Sep 07 '22 13:09 vedantkulkarni

Can you assign this issue to me @palisadoes ?? As no activity from vedant

Ayush0Chaudhary avatar Dec 31 '22 03:12 Ayush0Chaudhary

@palisadoes can you assign this issue to me??

peanutbutter003 avatar Feb 07 '23 19:02 peanutbutter003

Unassigned due to inactivity.

noman2002 avatar Feb 21 '23 18:02 noman2002

This issue did not get any activity in the past 10 days and will be closed in 365 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Mar 09 '23 00:03 github-actions[bot]

Can you assign this to me

nidhin29 avatar Nov 23 '23 13:11 nidhin29

As mentioned in Slack, this week contributor @aashimawadhwa is handling all new issue assignments and seeking reviewers for PRs. Please work with them to coordinate these activities.

palisadoes avatar Nov 23 '23 15:11 palisadoes

@aashimawadhwa ma'am can you assign this to me

nidhin29 avatar Nov 23 '23 15:11 nidhin29

No response

nidhin29 avatar Nov 24 '23 07:11 nidhin29

assigned to you @nidhin29

aashimawadhwa avatar Nov 24 '23 07:11 aashimawadhwa

Sorry I am not able to do it

nidhin29 avatar Nov 27 '23 13:11 nidhin29

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Dec 31 '23 00:12 github-actions[bot]

@aashimawadhwa Kindly assign this issue to me

gpkonarde avatar Jan 10 '24 07:01 gpkonarde

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Jan 25 '24 00:01 github-actions[bot]

Can I work on this issue @Cioppolo14?

Manik2708 avatar Jan 25 '24 18:01 Manik2708

Actually I would be requiring sample data of Organization which also have Users as members and admins for this test. So should I create it by myself or there would be something from API side?

Manik2708 avatar Jan 30 '24 19:01 Manik2708

@Manik2708 for testing purpose we use hard-coded mock data. Nothing comes from API.

Azad99-9 avatar Jan 30 '24 20:01 Azad99-9

@Manik2708 for testing purpose we use hard-coded mock data. Nothing comes from API.

No I was thinking to create reusable sample data because creating mock organization and user takes time. So it will save time for developers!

Manik2708 avatar Jan 30 '24 20:01 Manik2708

Will it come from API side?

Azad99-9 avatar Jan 30 '24 20:01 Azad99-9

That's what I am asking!

Manik2708 avatar Jan 31 '24 03:01 Manik2708

I suggest you to ask mentors.

Azad99-9 avatar Jan 31 '24 06:01 Azad99-9

@noman2002 @Ayush0Chaudhary @literalEval I am suffering from a problem when testing the Query Hook Widget, the mock query is not getting called inside this widget when following the same approach as in fetch_plugin_list_test.dart, I am getting nothing on searching for writing tests including this widget. Can I get reason for using this widget in this file and not invoking the query directly? As this Query widget is used only in this file!

Manik2708 avatar Feb 02 '24 10:02 Manik2708

This issue did not get any activity in the past 10 days and will be closed in 180 days if no update occurs. Please check if the develop branch has fixed it and report again or close the issue.

github-actions[bot] avatar Feb 17 '24 00:02 github-actions[bot]

I was trying for this from last two weeks, but was not able to mock the behaviour of Query widget.There is a reason for this and so, I have raised an issue regarding this in GraphQL, @literalEval @noman2002 please see this issue and see if it can be fixed, as I am not able to get it's solution.

Manik2708 avatar Feb 17 '24 05:02 Manik2708

Hey @Manik2708 is the mock for Query widget generated ?

literalEval avatar Feb 20 '24 17:02 literalEval

No, please refer to the issue https://github.com/zino-hofmann/graphql-flutter/issues/1408 There is a problem in sending mock query. Let me explain my approach, please see if something wrong.

  1. There is a test written related to GraphQL query, plugins/fetch_,plugins_list.dart. I am following the same approach.
  2. Mocking of client is successful but sending a query is failing. result.data is always coming null.
  3. I went to the API reference of this Query widget, it's a widget which is extending HookWidget
  4. The method which is being used for fetching query in this widget is not wrapped in any class, hence I am not able to mock it. This method is directly declared and implemented in the file. I searched a lot on Google and Stack Overflow but found nothing. Hence I raised an issue in the package, so that I could find a way of mocking it or they could fix it if it's a bug!

Manik2708 avatar Feb 21 '24 11:02 Manik2708

I think this is why most of assignees were not able to complete this issue. I maybe wrong. Please verify my approach! Thanks.

Manik2708 avatar Feb 21 '24 11:02 Manik2708

@Manik2708 Thank you for letting us know the exact problem, your approach is fine. Let's figure out some alternates for this.

noman2002 avatar Feb 23 '24 07:02 noman2002

I searched a bit for the solution, found that we can create our own HookWidget. Reference to Flutter Hooks: https://pub.dev/packages/flutter_hooks. Reference from graphql_flutter explaining the use of hooks: https://pub.dev/packages/graphql_flutter#query

Manik2708 avatar Feb 23 '24 12:02 Manik2708

Till then unassigning myself.

Manik2708 avatar Feb 26 '24 08:02 Manik2708