Fakultas Ilmu Komputer UI

filter_test.dart 1.29 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
// 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/filter.dart';
fazasabira's avatar
fazasabira committed
12
//import 'package:ppl_disabilitas/page/filter%20&%20fasilitas/insideFilter.dart';
13
14
15
16
17



void main() {

fazasabira's avatar
fazasabira committed
18
  testWidgets('find inside filter page', (WidgetTester tester) async {
19
    // Provide the childWidget to the Container.
20
    await tester.pumpWidget(Filter());
21
    // inside filter
22
    expect(find.byType(Container), findsNWidgets(21));
fazasabira's avatar
fazasabira committed
23
    expect(find.byType(Row), findsNWidgets(12));
24
    expect(find.byType(Column), findsNWidgets(2));
fazasabira's avatar
fazasabira committed
25
    expect(find.byType(Text), findsNWidgets(14));
26
    expect(find.byType(Flex), findsNothing);
27
28
    expect(find.text('jns fasilitas'), findsNothing);
    expect(find.text('urutn'), findsNothing);
fazasabira's avatar
fazasabira committed
29
    expect(find.text('hps smw'), findsNothing);
30
31
    // filter
    expect(find.byType(Scaffold), findsOneWidget);
fazasabira's avatar
fazasabira committed
32
    expect(find.byType(Icon), findsNWidgets(2));
33

34
35
  });

36
37
38



39
}