You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pinball/test/select_character/cubit/character_theme_cubit_test....

26 lines
803 B

import 'package:bloc_test/bloc_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pinball/select_character/select_character.dart';
import 'package:pinball_theme/pinball_theme.dart';
void main() {
group('CharacterThemeCubit', () {
test('initial state has Dash character theme', () {
final characterThemeCubit = CharacterThemeCubit();
expect(
characterThemeCubit.state.characterTheme,
equals(const DashTheme()),
);
});
blocTest<CharacterThemeCubit, CharacterThemeState>(
'characterSelected emits selected character theme',
build: CharacterThemeCubit.new,
act: (bloc) => bloc.characterSelected(const SparkyTheme()),
expect: () => [
const CharacterThemeState(SparkyTheme()),
],
);
});
}