-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from wakamenod/354-mobile-test-収入スケジュール詳細uiテスト追加
[Mobile] [Test] 収入スケジュール詳細UIテスト追加 #354
- Loading branch information
Showing
4 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+47.4 KB
.../features/schedules/presentations/income/goldens/new_income_schedule_detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+66.7 KB
...atures/schedules/presentations/income/goldens/update_income_schedule_detail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions
45
.../test/src/features/schedules/presentations/income/income_schedule_detail_screen_test.dart
This file contains 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,45 @@ | ||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:golden_toolkit/golden_toolkit.dart'; | ||
import 'package:openapi/openapi.dart'; | ||
import 'package:suito/src/features/transactions/services/income/income_form_value.dart'; | ||
|
||
import '../../schedules_robot.dart'; | ||
|
||
void main() { | ||
// TODO エラー時の表示テスト追加 | ||
|
||
group('IncomeScheduleDetail Golden test group', () { | ||
testGoldens('Open IncomeDetailView as registration for new income', | ||
(tester) async { | ||
await loadAppFonts(); | ||
final r = SchedulesRobot(tester); | ||
final now = DateTime(2023, 5, 1); | ||
final income = IncomeFormValue.newIncome(now); | ||
await r.pumpIncomeDetailScreen(income); | ||
await screenMatchesGolden(tester, 'new_income_schedule_detail'); | ||
}); | ||
|
||
testGoldens( | ||
'Open IncomeScheduleDetailView for updating a registered income schedule', | ||
(tester) async { | ||
await loadAppFonts(); | ||
final r = SchedulesRobot(tester); | ||
const id = 'income_schedule_id'; | ||
final incomeType = ModelIncomeType((e) => e | ||
..id = 'income_type_id' | ||
..name = 'Test Income Type'); | ||
final incomeTypeMap = {incomeType.id: incomeType}; | ||
final res = IncomeScheduleDetailRes( | ||
(r) => r.incomeSchedule.replace(ModelIncomeSchedule((b) => b | ||
..id = id | ||
..timezone = 'Asia/Tokyo' | ||
..incomeTypeId = incomeType.id | ||
..memo = 'Some memo' | ||
..amount = 400))); | ||
|
||
final income = IncomeFormValue.fromSchedule(res, incomeTypeMap); | ||
await r.pumpIncomeDetailScreen(income); | ||
await screenMatchesGolden(tester, 'update_income_schedule_detail'); | ||
}); | ||
}); | ||
} |
This file contains 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