ink_splash_test.dart 916 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4 5 6 7 8 9 10
// 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';

void main() {
  // Regression test for https://github.com/flutter/flutter/issues/21506.
  testWidgets('InkSplash receives textDirection', (WidgetTester tester) async {
11 12 13 14
    await tester.pumpWidget(MaterialApp(
      home: Scaffold(
      appBar: AppBar(title: const Text('Button Border Test')),
      body: Center(
15
        child: ElevatedButton(
16
          child: const Text('Test'),
17
          onPressed: () { },
18 19 20 21 22 23 24 25 26
        ),
      ),
    )));
    await tester.tap(find.text('Test'));
    // start ink animation which asserts for a textDirection.
    await tester.pumpAndSettle(const Duration(milliseconds: 30));
    expect(tester.takeException(), isNull);
  });
}