Skip to content

widgets/basic_test.dart failures when switching to M3 #129713

@bleroux

Description

@bleroux

Is there an existing issue for this?

Steps to reproduce

When switching to M3 (see #127501), there are two tests failures in packages/flutter/test/widgets/basic_test.dart:

testWidgets('multiple baseline aligned children', (WidgetTester tester) async {

testWidgets('baseline aligned children account for a larger, no-baseline child size', (WidgetTester tester) async {

Those failures are related to M3 typography which sets line height to 1.43.

Expected results

All tests run successfully

Actual results

2 tests fail

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: <114.0>
  Actual: <157.60000038146973>

When the exception was thrown, this was the stack:
#4      main.<anonymous closure>.<anonymous closure> (file:///home/bruno/Nevercode/flutter/packages/flutter/test/widgets/basic_test.dart:504:7)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

This was caught by the test expectation on the following line:
  file:///home/bruno/Nevercode/flutter/packages/flutter/test/widgets/basic_test.dart line 504
The test description was:
  multiple baseline aligned children
════════════════════════════════════════════════════════════════════════════════════════════════════

══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following TestFailure was thrown running a test:
Expected: <30.0>
  Actual: <38.60000038146973>

When the exception was thrown, this was the stack:
#4      main.<anonymous closure>.<anonymous closure> (file:///home/bruno/Nevercode/flutter/packages/flutter/test/widgets/basic_test.dart:557:7)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from package:stack_trace)

This was caught by the test expectation on the following line:
  file:///home/bruno/Nevercode/flutter/packages/flutter/test/widgets/basic_test.dart line 557
The test description was:
  baseline aligned children account for a larger, no-baseline child size
════════════════════════════════════════════════════════════════════════════════════════════════════

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

Labels

a: typographyText rendering, possibly libtxtf: material designflutter/packages/flutter/material repository.found in release: 3.12Found to occur in 3.12frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions