Skip to content

Commit 9d842a1

Browse files
committed
chore: write tests for side menu screen (#61)
- grammar fixes
1 parent fe1910b commit 9d842a1

9 files changed

+25
-23
lines changed

test/modules/forgot_password/forgot_password_interactor_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ void main() {
3232
interactor.delegate = delegate;
3333
});
3434

35-
describe("its resetPassword is called", () {
35+
describe("its resetPassword() is called", () {
3636
context("when authRepository's resetPassword return success", () {
3737
beforeEach(() {
3838
when(authRepository.resetPassword(email: anyNamed("email")))
3939
.thenAnswer((realInvocation) => Future.value(null));
4040
interactor.resetPassword(email: "email");
4141
});
4242

43-
it("trigger delegate's passwordDidReset emits", () {
43+
it("trigger delegate's passwordDidReset to emit", () {
4444
expect(delegate.passwordDidReset, emits(null));
4545
});
4646
});
@@ -53,7 +53,7 @@ void main() {
5353
interactor.resetPassword(email: "email");
5454
});
5555

56-
it("trigger delegate's passwordDidFailToReset emits", () {
56+
it("trigger delegate's passwordDidFailToReset to emit", () {
5757
expect(delegate.passwordDidFailToReset, emits(exception));
5858
});
5959
});

test/modules/forgot_password/forgot_password_view_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ void main() {
147147
await tester.tap(find.byKey(ForgotPasswordView.resetButtonKey));
148148
});
149149

150-
it("triggers delegate's resetButtonDidTap emits", (tester) async {
150+
it("triggers delegate's resetButtonDidTap to emit", (tester) async {
151151
expect(delegate.resetButtonDidTap, emits(""));
152152
});
153153
});
@@ -159,7 +159,7 @@ void main() {
159159
find.byKey(ForgotPasswordView.emailTextFieldKey), text);
160160
});
161161

162-
it("triggers delegate's emailTextFieldDidChange emits", (tester) async {
162+
it("triggers delegate's emailTextFieldDidChange to emit", (tester) async {
163163
expect(delegate.emailTextFieldDidChange, emits(text));
164164
});
165165
});

test/modules/home/home_module_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void main() {
1212
module = HomeModule();
1313
});
1414

15-
describe("its build is called", () {
15+
describe("its build() is called", () {
1616
late Widget widget;
1717

1818
beforeEach(() {

test/modules/home/home_presenter_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void main() {
172172
});
173173
});
174174

175-
describe("it's sideMenuDidShow emits", () {
175+
describe("its sideMenuDidShow emits", () {
176176
beforeEach(() {
177177
presenter.sideMenuDidShow.add(null);
178178
});
@@ -182,7 +182,7 @@ void main() {
182182
});
183183
});
184184

185-
describe("it's sideMenuDidDismiss emits", () {
185+
describe("its sideMenuDidDismiss emits", () {
186186
beforeEach(() {
187187
presenter.sideMenuDidDismiss.add(null);
188188
});
@@ -192,7 +192,7 @@ void main() {
192192
});
193193
});
194194

195-
describe("it's userAvatarButtonDidTap emits", () {
195+
describe("its userAvatarButtonDidTap emits", () {
196196
beforeEach(() {
197197
presenter.userAvatarButtonDidTap.add(null);
198198
});

test/modules/home/home_view_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,14 @@ void main() {
245245
});
246246
});
247247

248-
describe("it's showSideMenu() is called", () {
248+
describe("its showSideMenu() is called", () {
249249
beforeEach((tester) async {
250250
await tester.pumpAndSettle();
251251
module.view.showSideMenu();
252252
await tester.pumpAndSettle();
253253
});
254254

255-
it("triggers delegate's sideMenuDidShow emits", (tester) async {
255+
it("triggers delegate's sideMenuDidShow to emit", (tester) async {
256256
expect(delegate.sideMenuDidShow, emits(null));
257257
});
258258

@@ -263,24 +263,24 @@ void main() {
263263
await tester.pumpAndSettle();
264264
});
265265

266-
it("triggers delegate's sideMenuDidDismiss emits", (tester) async {
266+
it("triggers delegate's sideMenuDidDismiss to emit", (tester) async {
267267
expect(delegate.sideMenuDidDismiss, emits(null));
268268
});
269269
});
270270
});
271271

272-
describe("it's user avatar button is tapped", () {
272+
describe("its user avatar button is tapped", () {
273273
beforeEach((tester) async {
274274
await tester.pumpAndSettle();
275275
await tester.tap(find.byKey(HomeView.userAvatarButtonKey));
276276
});
277277

278-
it("triggers delegate's userAvatarButtonDidTap emits", (tester) async {
278+
it("triggers delegate's userAvatarButtonDidTap to emit", (tester) async {
279279
expect(delegate.userAvatarButtonDidTap, emits(null));
280280
});
281281
});
282282

283-
describe("it's setUserInteractionEnable() is called", () {
283+
describe("its setUserInteractionEnable() is called", () {
284284
beforeEach((tester) async {
285285
module.view.setUserInteractionEnable(isEnabled: false);
286286
await tester.pumpAndSettle();

test/modules/landing/landing_interactor_test.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ void main() {
4444
interactor.validateAuthentication();
4545
});
4646

47-
it("triggers delegate's didValidateAuthentication emits true", () {
47+
it("triggers delegate's didValidateAuthentication to emit true", () {
4848
expect(delegate.authenticationDidValidate, emits(true));
4949
});
5050
});
@@ -57,7 +57,8 @@ void main() {
5757
interactor.validateAuthentication();
5858
});
5959

60-
it("triggers delegate's didValidateAuthentication emits error", () {
60+
it("triggers delegate's didValidateAuthentication to emit an error",
61+
() {
6162
expect(delegate.authenticationDidFailToValidate, emits(error));
6263
});
6364
});

test/modules/login/login_interactor_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void main() {
4040
interactor.login("email", "password");
4141
});
4242

43-
it("triggers delegate's didLogin emits", () {
43+
it("triggers delegate's didLogin to emit", () {
4444
expect(delegate.didLogin, emits(null));
4545
});
4646
});

test/modules/login/login_view_test.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ void main() {
154154
await tester.enterText(find.byKey(LoginView.emailTextFieldKey), text);
155155
});
156156

157-
it("triggers to delegate's didChangeEmailText emits", (tester) async {
157+
it("triggers to delegate's didChangeEmailText to emit", (tester) async {
158158
expect(delegate.emailTextFieldDidChange, emits(text));
159159
});
160160
});
@@ -168,7 +168,8 @@ void main() {
168168
find.byKey(LoginView.passwordTextFieldKey), text);
169169
});
170170

171-
it("triggers to delegate's didChangePasswordText emits", (tester) async {
171+
it("triggers to delegate's didChangePasswordText to emit",
172+
(tester) async {
172173
expect(delegate.passwordTextFieldDidChange, emits(text));
173174
});
174175
});
@@ -182,7 +183,7 @@ void main() {
182183
await tester.tap(find.byKey(LoginView.loginButtonKey));
183184
});
184185

185-
it("triggers to delegate's didTapLoginButton emits", (tester) async {
186+
it("triggers to delegate's didTapLoginButton to emit", (tester) async {
186187
expect(delegate.loginButtonDidTap, emits(["", ""]));
187188
});
188189
});
@@ -195,7 +196,7 @@ void main() {
195196
await tester.tap(find.byKey(LoginView.forgotButtonKey));
196197
});
197198

198-
it("triggers to delegate's didTapLoginButton emits", (tester) async {
199+
it("triggers to delegate's didTapLoginButton to emit", (tester) async {
199200
expect(delegate.forgotButtonDidTap, emits(null));
200201
});
201202
});

test/modules/side_menu/side_menu_module_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void main() {
1212
module = SideMenuModule();
1313
});
1414

15-
describe("its build is called", () {
15+
describe("its build() is called", () {
1616
late Widget widget;
1717

1818
beforeEach(() {

0 commit comments

Comments
 (0)