-
Notifications
You must be signed in to change notification settings - Fork 309
Flutter update breaks link interaction tests #475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
OK, here's the upstream change that caused this breakage: So chalk up another one for #239, then. The change sounds like a good one. Still investigating to determine why it breaks the tests and what the right fix is. |
OK, the core of the issue is that we say things like this: testWidgets('can tap a link to open URL', (tester) async {
await prepareContent(tester,
'<p><a href="https://example/">hello</a></p>');
await tester.tapAt(find.text('hello')); and There's a few possible ways we might fix that: possibly the Text widget we build for a ParagraphNode of Zulip content should only go as wide as its internal layout, or possibly the tests should just change where they tap. |
By saying `tester.tapAt(find.text('hello'))`, we had been aiming at the center of the Text widgets, and expecting that to hit the recognizer we've put on the span, even though the widget is much wider than the span and the latter doesn't reach the former's center. Effectively we were relying on the presence of issue zulip#214. But with an upstream change yesterday: flutter/flutter#140621 such a tap no longer hits the span. That broke these tests. To fix them, aim the taps near the start of the widget instead. Fixes: zulip#475
By saying `tester.tapAt(find.text('hello'))`, we had been aiming at the center of the Text widgets, and expecting that to hit the recognizer we've put on the span, even though the widget is much wider than the span and the latter doesn't reach the former's center. Effectively we were relying on the presence of issue #214. But with an upstream change yesterday: flutter/flutter#140621 such a tap no longer hits the span. That broke these tests. To fix them, aim the taps near the start of the widget instead. Fixes: #475
After a Flutter update, some tests are failing in main. This is visible also in the recent PRs #472 and #474, as here:
https://github.com/zulip/zulip-flutter/actions/runs/7391944552/job/20109637276?pr=472
The failure looks like this:
The test renders some content that has a link in it, then taps the link and checks that the tap made it to the binding for
launchUrl
. The check fails — apparently the tap didn't make it to the binding.On the other hand, following a link in the actual app seems to work fine. So this may only affect the tests.
More investigation needed.
The text was updated successfully, but these errors were encountered: