test: tests for spaceship ramp

pull/207/head
RuiAlonso 3 years ago
parent 2ec74d8e0d
commit 2e80485a4e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

@ -1,30 +1,50 @@
// ignore_for_file: cascade_invocations
import 'package:flame_forge2d/flame_forge2d.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart';
import '../../helpers/helpers.dart';
void main() {
TestWidgetsFlutterBinding.ensureInitialized();
final flameTester = FlameTester(TestGame.new);
group('SpaceshipRamp', () {
final tester = FlameTester(TestGame.new);
flameTester.test(
'loads correctly',
(game) async {
final spaceshipRamp = SpaceshipRamp();
await game.ensureAdd(spaceshipRamp);
tester.testGameWidget(
'renders correctly',
expect(game.contains(spaceshipRamp), isTrue);
},
);
group('renders correctly', () {
/*
flameTester.testGameWidget(
'inactive sprite',
setUp: (game, tester) async {
await game.addFromBlueprint(SpaceshipRamp());
game.camera.followVector2(Vector2(-13, -50));
final spaceshipRamp = SpaceshipRamp();
await game.addFromBlueprint(spaceshipRamp);
await game.ready();
expect(
spaceshipRamp.firstChild<SpriteGroupComponent>()?.current,
SpaceshipRampArrowSpriteState.inactive,
);
game.camera.followVector2(Vector2(-13, -50));
},
verify: (game, tester) async {
await expectLater(
find.byGame<TestGame>(),
matchesGoldenFile('golden/spaceship-ramp.png'),
matchesGoldenFile('golden/spaceship_ramp/inactive.png'),
);
},
);
*/
});
});
}

Loading…
Cancel
Save