{"id":16589954,"url":"https://github.com/rlch/form_validation_assignment","last_synced_at":"2025-08-03T16:32:28.245Z","repository":{"id":131913577,"uuid":"436820140","full_name":"rlch/form_validation_assignment","owner":"rlch","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-10T03:25:48.000Z","size":180,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-16T22:47:05.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rlch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-10T02:03:32.000Z","updated_at":"2022-01-10T03:25:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"cbde798d-d785-4633-a85d-a23ff5c5d5d4","html_url":"https://github.com/rlch/form_validation_assignment","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fform_validation_assignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fform_validation_assignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fform_validation_assignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rlch%2Fform_validation_assignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rlch","download_url":"https://codeload.github.com/rlch/form_validation_assignment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242208310,"owners_count":20089718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T23:10:31.826Z","updated_at":"2025-03-06T12:25:44.085Z","avatar_url":"https://github.com/rlch.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tutero QA Assignment\n\n## About\n\nThe first part of this assignment is a testing challenge, where you will write unit tests, widget tests and integration test(s) to demonstrate your knowledge of testing with the Flutter driver.\n\n## Criteria\n\nYou will be judged off your choice of granularity and exhaustiveness of your tests, as well as the quality and efficiency of the code you write. \n\n## Notes\n\nYour tests should account for both web and mobile/desktop platforms. Make sure you study the code-base and account for cases where functionality might be platform-dependent.\n\n- Avoid handling dependency injection with `get_it`; your performance will be based off code written in the `test/` directory.\n\n\n## Example\n\n### 1. Find logic to test\n\nUpon building the app, we see a circular progress indicator. We investigate the source of this widget, to find the following logic:\n\n```dart\nCenter(\n  child: FutureBuilder\u003cList\u003cString\u003e\u003e(\n      future: widget.stateRepository.getStates(),\n      builder: (context, stateSnap) {\n      ...\n        if (!stateSnap.hasData) {\n          return const CircularProgressIndicator();\n        }\n      ...\n```\n\nThis implies that whenever we're loading information from the `getStates()` method from the `StateRepository`, the app should be in a loading state. Therefore, we can write a __widget test__ to account for this edge case:\n\n```dart\n@GenerateMocks([StateRepository])\nvoid main() {\n  testWidgets('FormPage in loading state only when getState() unresolved', (tester) async {\n    final stateRepository = MockStateRepository();\n\n    when(stateRepository.getStates()).thenAnswer(\n      (_) =\u003e Future.delayed(\n        const Duration(seconds: 5),\n        () =\u003e ['test state'],\n      ),\n    );\n\n    await tester.pumpWidget(\n      FormPage(\n        title: '',\n        minInterests: 0,\n        stateRepository: stateRepository,\n      ),\n    );\n\n    await tester.pump(const Duration(seconds: 3));\n\n    expect(find.byType(CircularProgressIndicator), findsOneWidget);\n\n    await tester.pump(const Duration(seconds: 3));\n    expect(find.byType(CircularProgressIndicator), findsNothing);\n  });\n}\n```\n\nYou may build off this example and the `MockStateRepository` generated in `test/`.\n\nGood luck! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fform_validation_assignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frlch%2Fform_validation_assignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frlch%2Fform_validation_assignment/lists"}