mirror of
https://github.com/flutter/holobooth.git
synced 2025-08-06 14:50:05 +08:00

* feat: add mute sound functionality * fix footer layout while resizing * remove mute button on mobile Co-authored-by: Oscar <martinm.oscar@gmail.com>
31 lines
890 B
Dart
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),
|
|
],
|
|
);
|
|
});
|
|
}
|