Fakultas Ilmu Komputer UI

filter_test.dart 1.52 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());
fazasabira's avatar
fazasabira committed
21
22
23
    //await tester.pumpWidget(InsideFilter());
//    final button = find.byKey(Key("button"));
//    await tester.tap(button);
24
    //await Future.delayed(Duration(seconds: 2));
25
    // Search for the childWidget in the tree and verify it exists.
26
27

    // inside filter
fazasabira's avatar
fazasabira committed
28
    expect(find.byType(Container), findsNWidgets(13));
29
    expect(find.byType(Row), findsNWidgets(11));
fazasabira's avatar
fazasabira committed
30
    expect(find.byType(Column), findsNothing);
fazasabira's avatar
fazasabira committed
31
    expect(find.byType(Text), findsNWidgets(13));
32
    expect(find.byType(Flex), findsNothing);
33
34
    expect(find.text('jns fasilitas'), findsNothing);
    expect(find.text('urutn'), findsNothing);
fazasabira's avatar
fazasabira committed
35
    expect(find.text('hps smw'), findsNothing);
36
37
38
39
40

    // filter
    expect(find.byType(Scaffold), findsOneWidget);
    expect(find.byType(Icon), findsOneWidget);

41
42
  });

43
44
45



46
}