-
Notifications
You must be signed in to change notification settings - Fork 0
feat(tests): add authenticated test attempt flow #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
558d7ae
feat(tests): add auth test attempt api contract and change existed dtβ¦
CowboyGH 0cfdd70
feat(tests): add new auth tests repository interface and separate it β¦
CowboyGH 1647b06
feat(data): add StartTestMapper
CowboyGH 0ac677e
refactor(data): extract test attempt result payload to separate file
CowboyGH 86cf38b
feat(data): implement AuthenticatedTestAttemptRepository
CowboyGH 25283fe
test(tests): add unit tests for AuthenticatedTestAttemptRepositoryImpβ¦
CowboyGH afea041
docs:(test-attempt-ui): update summary for TestAttemptCubit
CowboyGH c4c4019
feat(tests): add auth tests attempt page and route
CowboyGH cf6b1c0
docs: update CHANGELOG.md
CowboyGH fc127d1
docs(tests): update summary for SaveTestResultResponseDto field
CowboyGH 9cb4ba7
test(tests): add missing logger verification for unexpected exception
CowboyGH b1b79e0
docs: extract breaking section into a separate section
CowboyGH e96a794
test(test-attempt): add missing test case for general exception for β¦
CowboyGH File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 0 additions & 16 deletions
16
lib/features/tests/attempt/data/dto/complete_guest_test_request_dto.dart
This file was deleted.
Oops, something went wrong.
16 changes: 16 additions & 0 deletions
16
lib/features/tests/attempt/data/dto/complete_test_request_dto.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| part 'complete_test_request_dto.g.dart'; | ||
|
|
||
| /// DTO request for completing a test attempt. | ||
| @JsonSerializable() | ||
| class CompleteTestRequestDto { | ||
| /// Pulse after finishing the testing. | ||
| final int pulse; | ||
|
|
||
| /// Creates an instance of [CompleteTestRequestDto]. | ||
| CompleteTestRequestDto({required this.pulse}); | ||
|
|
||
| /// Converts this request to JSON. | ||
| Map<String, dynamic> toJson() => _$CompleteTestRequestDtoToJson(this); | ||
| } |
27 changes: 0 additions & 27 deletions
27
lib/features/tests/attempt/data/dto/save_guest_test_result_request_dto.dart
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
lib/features/tests/attempt/data/dto/save_guest_test_result_response_dto.dart
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
lib/features/tests/attempt/data/dto/save_test_result_request_dto.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| part 'save_test_result_request_dto.g.dart'; | ||
|
|
||
| /// DTO request for saving test exercise result. | ||
| @JsonSerializable() | ||
| class SaveTestResultRequestDto { | ||
| /// Exercise identifier inside the testing. | ||
| @JsonKey(name: 'testing_exercise_id') | ||
| final int testingExerciseId; | ||
|
|
||
| /// Result value from `1` to `4`. | ||
| @JsonKey(name: 'result_value') | ||
| final int resultValue; | ||
|
|
||
| /// Creates an instance of [SaveTestResultRequestDto]. | ||
| SaveTestResultRequestDto({ | ||
| required this.testingExerciseId, | ||
| required this.resultValue, | ||
| }); | ||
|
|
||
| /// Converts this request to JSON. | ||
| Map<String, dynamic> toJson() => _$SaveTestResultRequestDtoToJson(this); | ||
| } |
19 changes: 19 additions & 0 deletions
19
lib/features/tests/attempt/data/dto/save_test_result_response_dto.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| import 'save_test_result_data_dto.dart'; | ||
|
|
||
| part 'save_test_result_response_dto.g.dart'; | ||
|
|
||
| /// DTO envelope for saving test exercise result. | ||
| @JsonSerializable(createToJson: false) | ||
| class SaveTestResultResponseDto { | ||
| /// Saved test result payload. | ||
| final SaveTestResultDataDto data; | ||
|
|
||
| /// Creates an instance of [SaveTestResultResponseDto]. | ||
| SaveTestResultResponseDto({required this.data}); | ||
|
|
||
| /// Creates a [SaveTestResultResponseDto] from JSON. | ||
| factory SaveTestResultResponseDto.fromJson(Map<String, dynamic> json) => | ||
| _$SaveTestResultResponseDtoFromJson(json); | ||
| } |
31 changes: 31 additions & 0 deletions
31
lib/features/tests/attempt/data/dto/start_test_data_dto.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| import 'test_attempt_testing_dto.dart'; | ||
| import 'testing_exercise_dto.dart'; | ||
|
|
||
| part 'start_test_data_dto.g.dart'; | ||
|
|
||
| /// DTO payload returned when an authenticated test attempt is started. | ||
| @JsonSerializable(createToJson: false) | ||
| class StartTestDataDto { | ||
| /// Authenticated attempt identifier. | ||
| @JsonKey(name: 'attempt_id') | ||
| final int attemptId; | ||
|
|
||
| /// Testing summary. | ||
| final TestAttemptTestingDto testing; | ||
|
|
||
| /// Current exercise returned by the backend. | ||
| @JsonKey(name: 'current_exercise') | ||
| final TestingExerciseDto currentExercise; | ||
|
|
||
| /// Creates an instance of [StartTestDataDto]. | ||
| StartTestDataDto({ | ||
| required this.attemptId, | ||
| required this.testing, | ||
| required this.currentExercise, | ||
| }); | ||
|
|
||
| /// Creates a [StartTestDataDto] from JSON. | ||
| factory StartTestDataDto.fromJson(Map<String, dynamic> json) => _$StartTestDataDtoFromJson(json); | ||
| } |
19 changes: 19 additions & 0 deletions
19
lib/features/tests/attempt/data/dto/start_test_response_dto.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| import 'package:json_annotation/json_annotation.dart'; | ||
|
|
||
| import 'start_test_data_dto.dart'; | ||
|
|
||
| part 'start_test_response_dto.g.dart'; | ||
|
|
||
| /// DTO envelope for authenticated test start response. | ||
| @JsonSerializable(createToJson: false) | ||
| class StartTestResponseDto { | ||
| /// Authenticated test attempt payload. | ||
| final StartTestDataDto data; | ||
|
|
||
| /// Creates an instance of [StartTestResponseDto]. | ||
| StartTestResponseDto({required this.data}); | ||
|
|
||
| /// Creates a [StartTestResponseDto] from JSON. | ||
| factory StartTestResponseDto.fromJson(Map<String, dynamic> json) => | ||
| _$StartTestResponseDtoFromJson(json); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.