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.
23 lines
647 B
23 lines
647 B
3 years ago
|
import 'package:bloc_test/bloc_test.dart';
|
||
|
import 'package:flutter_test/flutter_test.dart';
|
||
3 years ago
|
import 'package:pinball/theme/theme.dart';
|
||
|
import 'package:pinball_theme/pinball_theme.dart';
|
||
3 years ago
|
|
||
|
void main() {
|
||
|
group('ThemeCubit', () {
|
||
|
test('initial state has Dash theme', () {
|
||
|
final themeCubit = ThemeCubit();
|
||
|
expect(themeCubit.state.theme, equals(const DashTheme()));
|
||
|
});
|
||
|
|
||
3 years ago
|
blocTest<ThemeCubit, ThemeState>(
|
||
|
'themeSelected emits selected theme',
|
||
|
build: ThemeCubit.new,
|
||
|
act: (bloc) => bloc.themeSelected(const SparkyTheme()),
|
||
|
expect: () => [
|
||
|
const ThemeState(SparkyTheme()),
|
||
|
],
|
||
|
);
|
||
3 years ago
|
});
|
||
|
}
|