|
|
@ -70,21 +70,14 @@ void main() {
|
|
|
|
|
|
|
|
|
|
|
|
group('onReset', () {
|
|
|
|
group('onReset', () {
|
|
|
|
blocTest<SpaceshipRampCubit, SpaceshipRampState>(
|
|
|
|
blocTest<SpaceshipRampCubit, SpaceshipRampState>(
|
|
|
|
'emits state reset to initial values',
|
|
|
|
'emits initial state',
|
|
|
|
build: SpaceshipRampCubit.new,
|
|
|
|
build: SpaceshipRampCubit.new,
|
|
|
|
seed: () => SpaceshipRampState(
|
|
|
|
seed: () => SpaceshipRampState(
|
|
|
|
hits: 100,
|
|
|
|
hits: 100,
|
|
|
|
lightState: ArrowLightState.active3,
|
|
|
|
lightState: ArrowLightState.active3,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
act: (bloc) => bloc.onReset(),
|
|
|
|
act: (bloc) => bloc.onReset(),
|
|
|
|
expect: () => [
|
|
|
|
expect: () => [SpaceshipRampState.initial(),
|
|
|
|
isA<SpaceshipRampState>()
|
|
|
|
|
|
|
|
..having((state) => state.hits, 'hits', 0)
|
|
|
|
|
|
|
|
..having(
|
|
|
|
|
|
|
|
(state) => state.lightState,
|
|
|
|
|
|
|
|
'lightState',
|
|
|
|
|
|
|
|
ArrowLightState.inactive,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
);
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|