|
|
@ -300,6 +300,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds PlayerInitialsSubmitted when initials are submitted',
|
|
|
|
'adds PlayerInitialsSubmitted when initials are submitted',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final state = InitialsFormState(
|
|
|
|
final state = InitialsFormState(
|
|
|
|
score: 10,
|
|
|
|
score: 10,
|
|
|
|
character: game.character,
|
|
|
|
character: game.character,
|
|
|
@ -336,6 +337,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds GameOverInfoDisplay when InitialsSuccessState',
|
|
|
|
'adds GameOverInfoDisplay when InitialsSuccessState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
@ -350,6 +352,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -363,6 +366,7 @@ void main() {
|
|
|
|
'adds the mobile controls overlay '
|
|
|
|
'adds the mobile controls overlay '
|
|
|
|
'when platform is mobile at InitialsFormState',
|
|
|
|
'when platform is mobile at InitialsFormState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final platformHelper = _MockPlatformHelper();
|
|
|
|
final platformHelper = _MockPlatformHelper();
|
|
|
|
final state = InitialsFormState(
|
|
|
|
final state = InitialsFormState(
|
|
|
|
score: 10,
|
|
|
|
score: 10,
|
|
|
@ -382,6 +386,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -395,6 +400,7 @@ void main() {
|
|
|
|
'remove the mobile controls overlay '
|
|
|
|
'remove the mobile controls overlay '
|
|
|
|
'when InitialsSuccessState',
|
|
|
|
'when InitialsSuccessState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final platformHelper = _MockPlatformHelper();
|
|
|
|
final platformHelper = _MockPlatformHelper();
|
|
|
|
final state = InitialsSuccessState(score: 10);
|
|
|
|
final state = InitialsSuccessState(score: 10);
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
@ -411,6 +417,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -423,6 +430,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds InitialsSubmissionSuccessDisplay on InitialsSuccessState',
|
|
|
|
'adds InitialsSubmissionSuccessDisplay on InitialsSuccessState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
@ -437,6 +445,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -449,6 +458,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds ShareScoreRequested event when sharing',
|
|
|
|
'adds ShareScoreRequested event when sharing',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
final state = InitialsSuccessState(score: 100);
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
@ -484,6 +494,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds InitialsSubmissionFailureDisplay on InitialsFailureState',
|
|
|
|
'adds InitialsSubmissionFailureDisplay on InitialsFailureState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
|
Stream<BackboxState>.empty(),
|
|
|
|
Stream<BackboxState>.empty(),
|
|
|
@ -500,6 +511,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -521,6 +533,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds ShareDisplay on ShareState',
|
|
|
|
'adds ShareDisplay on ShareState',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final state = ShareState(score: 100);
|
|
|
|
final state = ShareState(score: 100);
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
@ -535,6 +548,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
expect(
|
|
|
|
expect(
|
|
|
@ -547,6 +561,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'opens Facebook link when sharing with Facebook',
|
|
|
|
'opens Facebook link when sharing with Facebook',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
when(() => urlLauncher.canLaunch(any()))
|
|
|
|
when(() => urlLauncher.canLaunch(any()))
|
|
|
|
.thenAnswer((_) async => true);
|
|
|
|
.thenAnswer((_) async => true);
|
|
|
|
when(
|
|
|
|
when(
|
|
|
@ -711,6 +726,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'closes the subscription when it is removed',
|
|
|
|
'closes the subscription when it is removed',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final streamController = StreamController<BackboxState>();
|
|
|
|
final streamController = StreamController<BackboxState>();
|
|
|
|
whenListen(
|
|
|
|
whenListen(
|
|
|
|
bloc,
|
|
|
|
bloc,
|
|
|
@ -751,6 +767,7 @@ void main() {
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
flameTester.testGameWidget(
|
|
|
|
'adds PlayerInitialsSubmitted when the timer is finished',
|
|
|
|
'adds PlayerInitialsSubmitted when the timer is finished',
|
|
|
|
setUp: (game, _) async {
|
|
|
|
setUp: (game, _) async {
|
|
|
|
|
|
|
|
await game.onLoad();
|
|
|
|
final initialState = InitialsFailureState(
|
|
|
|
final initialState = InitialsFailureState(
|
|
|
|
score: 10,
|
|
|
|
score: 10,
|
|
|
|
character: theme.DashTheme(),
|
|
|
|
character: theme.DashTheme(),
|
|
|
@ -769,6 +786,7 @@ void main() {
|
|
|
|
backbox,
|
|
|
|
backbox,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|
|
|
|
await game.ready();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
verify: (game, _) async {
|
|
|
|
verify: (game, _) async {
|
|
|
|
game.update(4);
|
|
|
|
game.update(4);
|
|
|
|