Created
April 22, 2021 18:09
-
-
Save pedromassango/2fa04f07ba1a3ee42ae0e7b2aca5bc44 to your computer and use it in GitHub Desktop.
Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testWidgets('Ellipsis is passed to the inner TextPainter when provided', (WidgetTester tester) async { | |
await tester.pumpWidget( | |
const MaterialApp( | |
home: Material( | |
child: SelectableText( | |
'overflow', | |
maxLines: 1, | |
style: TextStyle(overflow: TextOverflow.ellipsis), | |
), | |
), | |
), | |
Duration.zero, | |
EnginePhase.build | |
); | |
final EditableTextState editableTextState = tester.state(find.byType(EditableText)); | |
//expect(editableTextState.renderEditable.textPainter.ellipsis, kDefaultEllipsis); | |
// Getting no element | |
//final SelectableTextState state = tester.state<SelectableTextState>(find.byElementType(SelectableTextState)); | |
final box = editableTextState.context.findRenderObject() as RenderBox?; | |
expect(box?.size.width, 8); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment