Files
holobooth/test/audio_player/bloc/mute_sound_bloc_test.dart
Kirpal Demian d17b4d2df0 feat: add mute sound functionality (#379)
* feat: add mute sound functionality

* fix footer layout while resizing

* remove mute button on mobile

Co-authored-by: Oscar <martinm.oscar@gmail.com>
2023-01-20 12:07:48 +01:00

31 lines
890 B
Dart

import 'package:bloc_test/bloc_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:holobooth/audio_player/audio_player.dart';
void main() {
group('MuteSoundBloc', () {
test('initial state is unmuted', () {
expect(MuteSoundBloc().state, MuteSoundState(isMuted: false));
});
blocTest<MuteSoundBloc, MuteSoundState>(
'emits muted state when mute is toggled on',
build: MuteSoundBloc.new,
act: (bloc) => bloc.add(MuteSoundToggled()),
expect: () => [
MuteSoundState(isMuted: true),
],
);
blocTest<MuteSoundBloc, MuteSoundState>(
'emits unmuted state when mute is toggled off',
build: MuteSoundBloc.new,
seed: () => MuteSoundState(isMuted: true),
act: (bloc) => bloc.add(MuteSoundToggled()),
expect: () => [
MuteSoundState(isMuted: false),
],
);
});
}