|
|
@ -17,20 +17,19 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
await game.add(bottomGroup);
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
expect(game.contains(bottomGroup), isTrue);
|
|
|
|
expect(game.contains(bottomGroup), isTrue);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
group('children', () {
|
|
|
|
group('children', () {
|
|
|
|
// TODO(alestiago): Make tests pass.
|
|
|
|
|
|
|
|
flameTester.test(
|
|
|
|
flameTester.test(
|
|
|
|
'has one left flipper',
|
|
|
|
'has one left flipper',
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
await game.add(bottomGroup);
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Flipper>(
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Flipper>(
|
|
|
|
condition: (flipper) => flipper.side.isLeft,
|
|
|
|
condition: (flipper) => flipper.side.isLeft,
|
|
|
@ -44,7 +43,7 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
await game.add(bottomGroup);
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Flipper>(
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Flipper>(
|
|
|
|
condition: (flipper) => flipper.side.isRight,
|
|
|
|
condition: (flipper) => flipper.side.isRight,
|
|
|
@ -58,7 +57,7 @@ void main() {
|
|
|
|
(game) async {
|
|
|
|
(game) async {
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
final bottomGroup = BottomGroup(position: Vector2.zero(), spacing: 0);
|
|
|
|
await game.ready();
|
|
|
|
await game.ready();
|
|
|
|
await game.add(bottomGroup);
|
|
|
|
await game.ensureAdd(bottomGroup);
|
|
|
|
|
|
|
|
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Baseboard>();
|
|
|
|
final leftFlippers = bottomGroup.findNestedChildren<Baseboard>();
|
|
|
|
expect(leftFlippers.length, equals(2));
|
|
|
|
expect(leftFlippers.length, equals(2));
|
|
|
|