Fakultas Ilmu Komputer UI

Commit cb495b75 authored by Tsamara Esperanti Erwin's avatar Tsamara Esperanti Erwin
Browse files

[RED] Add test for view goods donation detail

parent 2bce63d6
Pipeline #62148 failed with stages
in 2 minutes and 7 seconds
......@@ -131,6 +131,56 @@ void main() {
})).called(1);
});
testWidgets('show dialog for goods donation', (WidgetTester tester) async {
when(dio.get(_donation, queryParameters: queryParam)).thenAnswer(
(_) async =>
Response<Map<String, dynamic>>(statusCode: 200, data:
{
"count": 1,
"next": "ada",
"previous": null,
"results": [
{
"id": "5b0a405c-a5a2-415e-9788-2b52c50792b1",
"donation_number": "8DVQQ6",
"program": "b02580b3-d1ab-4bf8-b4c3-87a340ed3319",
"program_code": "5GZW45",
"user": "f26c3bcd-f9d3-469e-b466-57610d9acdcb",
"user_username": "sarah",
"user_full_name": "sarah",
"user_phone_number": "+628123456789",
"program_name": "Program Mengaji Bersama",
"donation_type": "GDS",
"donation_status": "002",
"amount": null,
"readable_donation_status": "Selesai",
"proof_of_bank_transfer": null,
"user_bank_name": null,
"user_bank_account_name": null,
"bank_account_transfer_destination": null,
"transfer_destination_bank_name": null,
"transfer_destination_bank_account_name": null,
"transfer_destination_bank_account_number": null,
"goods_quantity": "1",
"goods_description": "kaos",
"delivery_method": "PCK",
"delivery_address": "rumah",
"created_at": "2020-11-27T09:11:13.019671+07:00",
"updated_at": "2020-12-05T20:29:11.013324+07:00"
}
]
}));
await tester.pumpWidget(widgetTested);
expect(find.byType(CircularProgressIndicator), findsOneWidget);
await tester.pump(Duration(seconds: 5));
await tester.pump();
expect(find.text('27 November 2020'), findsOneWidget);
await tester.tap(find.text('27 November 2020'));
await tester.pump(Duration(seconds: 3));
expect(find.text('Barang: kaos'), findsOneWidget);
expect(find.text('Jumlah: 1'), findsOneWidget);
});
testWidgets('refresh load', (WidgetTester tester) async {
when(dio.get(_donation, queryParameters: queryParam)).thenAnswer(
(_) async =>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment