overlay_geometry_test.dart 1.04 KB
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
7
import 'package:manual_tests/overlay_geometry.dart' as overlay_geometry;
8 9 10

void main() {
  testWidgets('Overlay geometry smoke test', (WidgetTester tester) async {
11
    await tester.pumpWidget(MaterialApp(home: overlay_geometry.OverlayGeometryApp()));
12 13 14 15 16 17 18 19 20 21 22
    expect(find.byType(overlay_geometry.Marker), findsNothing);
    await tester.tap(find.text('Card 3'));
    await tester.pump();
    expect(find.byType(overlay_geometry.Marker), findsNWidgets(3));
    final double y = tester.getTopLeft(find.byType(overlay_geometry.Marker).first).dy;
    await tester.fling(find.text('Card 3'), const Offset(0.0, -100.0), 100.0);
    await tester.pump();
    expect(find.byType(overlay_geometry.Marker), findsNWidgets(3));
    expect(tester.getTopLeft(find.byType(overlay_geometry.Marker).first).dy, lessThan(y));
  });
}