Before Width: | Height: | Size: 91 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 20 KiB |
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',
|
||||||
|
(game) async {
|
||||||
|
final spaceshipRamp = SpaceshipRamp();
|
||||||
|
await game.ensureAdd(spaceshipRamp);
|
||||||
|
|
||||||
tester.testGameWidget(
|
expect(game.contains(spaceshipRamp), isTrue);
|
||||||
'renders correctly',
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
group('renders correctly', () {
|
||||||
|
/*
|
||||||
|
flameTester.testGameWidget(
|
||||||
|
'inactive sprite',
|
||||||
setUp: (game, tester) async {
|
setUp: (game, tester) async {
|
||||||
await game.addFromBlueprint(SpaceshipRamp());
|
final spaceshipRamp = SpaceshipRamp();
|
||||||
game.camera.followVector2(Vector2(-13, -50));
|
await game.addFromBlueprint(spaceshipRamp);
|
||||||
await game.ready();
|
await game.ready();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
spaceshipRamp.firstChild<SpriteGroupComponent>()?.current,
|
||||||
|
SpaceshipRampArrowSpriteState.inactive,
|
||||||
|
);
|
||||||
|
|
||||||
|
game.camera.followVector2(Vector2(-13, -50));
|
||||||
},
|
},
|
||||||
verify: (game, tester) async {
|
verify: (game, tester) async {
|
||||||
await expectLater(
|
await expectLater(
|
||||||
find.byGame<TestGame>(),
|
find.byGame<TestGame>(),
|
||||||
matchesGoldenFile('golden/spaceship-ramp.png'),
|
matchesGoldenFile('golden/spaceship_ramp/inactive.png'),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
*/
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|