Fakultas Ilmu Komputer UI

Commit 1dc7a119 authored by Adzkia Aisyah Afrah Hardian's avatar Adzkia Aisyah Afrah Hardian
Browse files

[RED] make test for school detail UI

parent 0586d104
Pipeline #41026 failed with stages
in 4 minutes and 23 seconds
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=/Library/Java/JavaVirtualMachines/jdk1.8.0_171.jdk/Contents/Home
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class InformasiSekolahAppBar extends StatelessWidget implements PreferredSizeWidget {
@override
final Size preferredSize = Size.fromHeight(55);
@override
Widget build(BuildContext context) {
return AppBar(
elevation: 15,
centerTitle: true,
backgroundColor: greenPrimary,
title: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Padding(padding: EdgeInsets.all(doubleSpace),
child: Text(
"Informasi Sekolah",
style: TextStyle(
fontSize: 25,
fontFamily: 'Comfortaa',
fontWeight: FontWeight.w800),
),)
],
),
);
}
}
import 'dart:async';
import 'package:location/location.dart';
import 'package:flutter/material.dart';
import 'package:ppl_disabilitas/component/bisago_drawer.dart';
import 'package:ppl_disabilitas/component/informasi_sekolah_appbar.dart';
import 'package:ppl_disabilitas/config/styles.dart';
class DetailSekolah extends StatefulWidget {
final String namaSekolah;
final String alamat;
final String nomerTelpon;
final String website;
final String jumlahSiswa;
final String status;
final String jenisSekolah;
final String akreditasi;
DetailSekolah(this.namaSekolah, this.alamat, this.nomerTelpon,
this.website, this.jumlahSiswa, this.status, this.jenisSekolah, this.akreditasi);
@override
DetailSekolahState createState() => DetailSekolahState();
}
class DetailSekolahState extends State<DetailSekolah> {
@override
Widget build(BuildContext context) {
return Scaffold(
drawer: BisaGoDrawer(),
appBar: PreferredSize(
preferredSize: Size.fromHeight(55),
child: InformasiSekolahAppBar(),
),
);
}
}
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility that Flutter provides. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:ppl_disabilitas/page/filter_fasilitas/fasilitas.dart';
import 'package:ppl_disabilitas/page/informasi/detailSekolah.dart';
void main() {
Widget buildTestableWidget(Widget widget) {
// https://docs.flutter.io/flutter/widgets/MediaQuery-class.html
return MediaQuery(data: MediaQueryData(), child: MaterialApp(home: widget));
}
testWidgets('find fasilitas page', (WidgetTester tester) async {
// Provide the childWidget to the Container.
await tester.pumpWidget(buildTestableWidget(DetailSekolah(
"Sekolah Pilar Indonesia",
"Ciangsana",
"02149305494",
"www.pilarindonesia.com",
"1000",
"Swasta",
"Inklusi",
"A")));
// Search for the childWidget in the tree and verify it exists.
expect(find.byType(Scaffold), findsOneWidget);
expect(find.byType(ListView), findsOneWidget);
expect(find.byType(Container), findsNWidgets(23));
expect(find.byType(Column), findsNWidgets(1));
expect(find.byType(Text), findsNWidgets(16));
});
}
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