Skip to content

Commit

Permalink
feat: Fixing tests on flutter 3.24.0 (#3259)
Browse files Browse the repository at this point in the history
Fix tests to pass on newer Flutter.

From what I debugged, the update was not being added to the list because
the game was not attached, which seemed to makes sense to me. I am
unsure though how this was passing in previous verions.

Additionally, I want to create a `onResize` example under the system
group in our examples to make sure the onGameResize is working properly.

---------

Co-authored-by: Lukas Klingsbo <lukas.klingsbo@gmail.com>
  • Loading branch information
erickzanardo and spydon authored Aug 9, 2024
1 parent a04315a commit bf9a248
Show file tree
Hide file tree
Showing 40 changed files with 13 additions and 1 deletion.
Binary file modified packages/flame/test/_goldens/advanced_button_component.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/align_component_1.png
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.
Binary file modified packages/flame/test/_goldens/camera_component_order_test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/camera_component_test1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/circular_viewport_test1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/circular_viewport_test2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/circular_viewport_test3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/circular_viewport_test4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/circular_viewport_test5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/clip_component_circle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/clip_component_polygon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/fixed_size_viewport_test_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/has_decorator_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/nine_tile_box_test_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/nine_tile_box_test_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/paint_decorator_blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/paint_decorator_grayscale.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/paint_decorator_tinted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/paint_decorator_with_blur.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/rotate3d_decorator_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/rotate3d_decorator_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/rotate3d_decorator_3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/route_opaque.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packages/flame/test/_goldens/route_transparent.png
Binary file modified packages/flame/test/_goldens/route_with_decorators.png
Binary file modified packages/flame/test/_goldens/shadow3d_decorator_1.png
Binary file modified packages/flame/test/_goldens/shadow3d_decorator_2.png
Binary file modified packages/flame/test/_goldens/shadow3d_decorator_3.png
Binary file modified packages/flame/test/_goldens/snapshot_test_1.png
Binary file modified packages/flame/test/_goldens/snapshot_test_2.png
Binary file modified packages/flame/test/_goldens/snapshot_test_3.png
Binary file modified packages/flame/test/_goldens/sprite_font_renderer_1.png
Binary file modified packages/flame/test/_goldens/sprite_font_renderer_2.png
Binary file modified packages/flame/test/_goldens/sprite_font_renderer_3.png
Binary file modified packages/flame/test/_goldens/sprite_test_1.png
Binary file modified packages/flame/test/_goldens/text_box_component_test_1.png
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,24 @@ void main() {
final events = <String>[];
await tester.pumpWidget(_MyContainer(events));

// This ensures that the game is attached.
await tester.pump();

events.clear();
final state = tester.state<_MyContainerState>(find.byType(_MyContainer));
state.causeResize();

await tester.pump();
expect(events, ['onGameResize', 'update', 'render']); // no onRemove
expect(
events,
[
// additional because of the initial pump to ensure attachment
'update',
'onGameResize',
'update',
'render',
],
); // no onRemove
final game =
tester.allWidgets.whereType<GameWidget<_MyGame>>().first.game;
expect(game?.children, everyElement((Component c) => c.parent == game));
Expand Down
Binary file modified packages/flame_svg/test/_goldens/render_sharply.png

0 comments on commit bf9a248

Please sign in to comment.