Skip to content

Commit

Permalink
tests fixed and goldens updated locally
Browse files Browse the repository at this point in the history
  • Loading branch information
elliette committed Dec 20, 2024
1 parent a85ba6b commit 3afa636
Show file tree
Hide file tree
Showing 11 changed files with 30 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ void main() {
(WidgetTester tester) async {
await _loadInspectorUI(tester);

// Toggle implementation widgets on.
await _toggleImplementationWidgets(tester);

// Before hidden widgets are expanded, confirm the HeroControllerScope
// is hidden:
final hideableNodeFinder = findNodeMatching('HeroControllerScope');
Expand Down Expand Up @@ -207,6 +210,9 @@ void main() {
) async {
await _loadInspectorUI(tester);

// Toggle implementation widgets on.
await _toggleImplementationWidgets(tester);

// Before searching, confirm the HeroControllerScope is hidden:
final hideableNodeFinder = findNodeMatching('HeroControllerScope');
expect(hideableNodeFinder, findsNothing);
Expand Down Expand Up @@ -239,21 +245,15 @@ void main() {
) async {
await _loadInspectorUI(tester);

// Give time for the initial animation to complete.
await tester.pumpAndSettle(inspectorChangeSettleTime);
// Toggle implementation widgets on.
await _toggleImplementationWidgets(tester);

// Confirm the hidden widgets are visible behind affordances like "X more
// widgets".
expect(find.richTextContaining('more widgets...'), findsWidgets);

// Tap the "Show Implementation Widgets" button (selected by default).
final showImplementationWidgetsButton = find.descendant(
of: find.byType(DevToolsToggleButton),
matching: find.text('Show Implementation Widgets'),
);
expect(showImplementationWidgetsButton, findsOneWidget);
await tester.tap(showImplementationWidgetsButton);
await tester.pumpAndSettle(inspectorChangeSettleTime);
// Toggle implementation widgets ff.
await _toggleImplementationWidgets(tester);

// Confirm that the hidden widgets are no longer visible.
expect(find.richTextContaining('more widgets...'), findsNothing);
Expand Down Expand Up @@ -287,6 +287,10 @@ void main() {
) async {
// Load the Inspector.
await _loadInspectorUI(tester);

// Toggle implementation widgets on.
await _toggleImplementationWidgets(tester);

await tester.pumpAndSettle(inspectorChangeSettleTime);
final state =
tester.state(find.byType(InspectorScreenBody))
Expand All @@ -300,14 +304,8 @@ void main() {
diagnostics.firstWhere((d) => d?.description == 'Text')!;
expect(textDiagnostic.isCreatedByLocalProject, isTrue);

// Tap the "Show Implementation Widgets" button (selected by default).
final showImplementationWidgetsButton = find.descendant(
of: find.byType(DevToolsToggleButton),
matching: find.text('Show Implementation Widgets'),
);
expect(showImplementationWidgetsButton, findsOneWidget);
await tester.tap(showImplementationWidgetsButton);
await tester.pumpAndSettle(inspectorChangeSettleTime);
// Toggle implementation widgets off.
await _toggleImplementationWidgets(tester);

// Verify the Text diagnostic node is still in the tree.
final diagnosticsNow = state.controller.inspectorTree.rowsInTree.value.map(
Expand Down Expand Up @@ -505,6 +503,9 @@ void main() {
) async {
await _loadInspectorUI(tester);

// Toggle implementation widgets on.
await _toggleImplementationWidgets(tester);

// Give time for the initial animation to complete.
await tester.pumpAndSettle(inspectorChangeSettleTime);

Expand Down Expand Up @@ -596,6 +597,17 @@ void main() {
});
}

Future<void> _toggleImplementationWidgets(WidgetTester tester) async {
// Tap the "Show Implementation Widgets" button (selected by default).
final showImplementationWidgetsButton = find.descendant(
of: find.byType(DevToolsToggleButton),
matching: find.text('Show Implementation Widgets'),
);
expect(showImplementationWidgetsButton, findsOneWidget);
await tester.tap(showImplementationWidgetsButton);
await tester.pumpAndSettle(inspectorChangeSettleTime);
}

Future<void> _loadInspectorUI(WidgetTester tester) async {
final screen = InspectorScreen();
await tester.pumpWidget(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3afa636

Please sign in to comment.