2022-02-19 16:48:57 +08:00
|
|
|
import 'package:app_flowy/startup/startup.dart';
|
|
|
|
import 'package:app_flowy/workspace/application/workspace/welcome_bloc.dart';
|
2022-07-04 15:07:11 +08:00
|
|
|
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
|
2022-02-19 16:48:57 +08:00
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:bloc_test/bloc_test.dart';
|
|
|
|
|
|
|
|
import 'util/test_env.dart';
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
UserProfile? userInfo;
|
|
|
|
setUpAll(() async {
|
|
|
|
final flowyTest = await FlowyTest.setup();
|
|
|
|
userInfo = await flowyTest.signIn();
|
|
|
|
});
|
|
|
|
|
|
|
|
group('WelcomeBloc', () {
|
|
|
|
blocTest<WelcomeBloc, WelcomeState>(
|
2022-02-20 16:10:50 +08:00
|
|
|
"welcome screen init",
|
2022-02-19 16:48:57 +08:00
|
|
|
build: () => getIt<WelcomeBloc>(param1: userInfo),
|
|
|
|
act: (bloc) {
|
|
|
|
bloc.add(const WelcomeEvent.initial());
|
|
|
|
},
|
2022-02-19 23:19:33 +08:00
|
|
|
wait: const Duration(seconds: 3),
|
2022-02-19 16:48:57 +08:00
|
|
|
verify: (bloc) {
|
|
|
|
assert(bloc.state.isLoading == false);
|
|
|
|
},
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|