Add golden test for text shade overflow (#18816)

Goldens for flutter/flutter#18729
This commit is contained in:
liyuqian
2018-06-28 13:50:49 -07:00
committed by GitHub
parent 35e8cd83d0
commit 7678c2a5d4
2 changed files with 39 additions and 1 deletions

View File

@@ -1 +1 @@
e4920845c80ca52c8891c023f137f1c9a651523e
c0e7174ec1fad55e920b9dfd8b79291e093a9f2d

View File

@@ -5,6 +5,7 @@
import 'dart:io' show Platform;
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
void main() {
@@ -139,4 +140,41 @@ void main() {
skip: true, // !Platform.isLinux,
);
});
testWidgets('Text Fade', (WidgetTester tester) async {
await tester.pumpWidget(
new MaterialApp(
home: new Scaffold(
backgroundColor: Colors.transparent,
body: new RepaintBoundary(
child: Center(
child: new Container(
width: 200.0,
height: 200.0,
color: Colors.green,
child: new Center(
child: new Container(
width: 100.0,
color: Colors.blue,
child: const Text(
'Pp PPp PPPp PPPPp PPPPpp PPPPppp PPPPppppp ',
style: const TextStyle(color: Colors.black),
maxLines: 3,
overflow: TextOverflow.fade,
),
),
),
),
),
),
)
)
);
await expectLater(
find.byType(RepaintBoundary).first,
matchesGoldenFile('text_golden.Fade.1.png'),
skip: !Platform.isLinux,
);
});
}