Skip to content

Commit

Permalink
fix: Tiled component orthogonal test (#2549)
Browse files Browse the repository at this point in the history
Fixing orthogonal tiled tests
  • Loading branch information
erickzanardo committed Jun 6, 2023
1 parent 4710530 commit 34e5f0e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/flame_tiled/test/tiled_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -406,29 +406,31 @@ void main() {

final world = World(children: [component]);
final cameraComponent = CameraComponent(world: world);
cameraComponent.viewfinder.anchor = Anchor.topLeft;

// Need to initialize a game and call `onLoad` and `onGameResize` to
// get the camera and canvas sizes all initialized
final game = FlameGame(children: [world, cameraComponent]);
await game.ready();
cameraComponent.viewfinder.anchor = Anchor.center;
cameraComponent.viewfinder.position = Vector2(150, 20);
cameraComponent.viewport.size = mapSizePx.clone();
game.onGameResize(mapSizePx);
component.onGameResize(mapSizePx);
await component.onLoad();
await game.ready();
});

test('component size', () {
expect(component.tileMap.destTileSize, Vector2(16, 16));
expect(component.size, mapSizePx);
});

// TODO(Erick): Don't skip when it is solved.
test(
'renders',
() async {
final pngData = await renderMapToPng(component);

expect(pngData, matchesGoldenFile('goldens/orthogonal.png'));
},
skip: true,
);
});

Expand Down

0 comments on commit 34e5f0e

Please sign in to comment.