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

Loading…
Cancel
Save