Skip to content

[pointer_interceptor_web] Remove semantic tests. #6580

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

Merged
merged 1 commit into from
Apr 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -64,68 +64,6 @@ void main() {
expect(element.id, 'background-html-view');
}, semanticsEnabled: false);
});

group('With semantics', () {
testWidgets('finds semantics of wrapped widgets',
(WidgetTester tester) async {
await _fullyRenderApp(tester);

final web.Element element =
_getHtmlElementAtCenter(clickableButtonFinder, tester);

expect(element.tagName.toLowerCase(), 'flt-semantics');
expect(element.getAttribute('aria-label'), 'Works As Expected');
},
// TODO(bparrishMines): The semantics label is returning null.
// See https://github.com/flutter/flutter/issues/145238
skip: true);

testWidgets(
'finds semantics of wrapped widgets with intercepting set to false',
(WidgetTester tester) async {
await _fullyRenderApp(tester);

final web.Element element =
_getHtmlElementAtCenter(clickableWrappedButtonFinder, tester);

expect(element.tagName.toLowerCase(), 'flt-semantics');
expect(element.getAttribute('aria-label'),
'Never calls onPressed transparent');
},
// TODO(bparrishMines): The semantics label is returning null.
// See https://github.com/flutter/flutter/issues/145238
skip: true);

testWidgets('finds semantics of unwrapped elements',
(WidgetTester tester) async {
await _fullyRenderApp(tester);

final web.Element element =
_getHtmlElementAtCenter(nonClickableButtonFinder, tester);

expect(element.tagName.toLowerCase(), 'flt-semantics');
expect(element.getAttribute('aria-label'), 'Never calls onPressed');
},
// TODO(bparrishMines): The semantics label is returning null.
// See https://github.com/flutter/flutter/issues/145238
skip: true);

// Notice that, when hit-testing the background platform view, instead of
// finding a semantics node, the platform view itself is found. This is
// because the platform view does not add interactive semantics nodes into
// the framework's semantics tree. Instead, its semantics is determined by
// the HTML content of the platform view itself. Flutter's semantics tree
// simply allows the hit test to land on the platform view by making itself
// hit test transparent.
testWidgets('on background directly', (WidgetTester tester) async {
await _fullyRenderApp(tester);

final web.Element element =
_getHtmlElementAt(tester.getTopLeft(backgroundFinder));

expect(element.id, 'background-html-view');
});
});
}

Future<void> _fullyRenderApp(WidgetTester tester) async {
Expand Down