mirror of https://github.com/flutter/pinball.git
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.
26 lines
802 B
26 lines
802 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>(
|
|
'charcterSelected emits selected character theme',
|
|
build: CharacterThemeCubit.new,
|
|
act: (bloc) => bloc.characterSelected(const SparkyTheme()),
|
|
expect: () => [
|
|
const CharacterThemeState(SparkyTheme()),
|
|
],
|
|
);
|
|
});
|
|
}
|