Skip to content

Commit

Permalink
chore: write tests for login screen (#23)
Browse files Browse the repository at this point in the history
- grammar fixes
  • Loading branch information
markgravity committed May 19, 2021
1 parent 4a0189e commit 012964b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/modules/login/login_interactor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
interactor.delegate = delegate;
});

describe("it's login() is called", () {
describe("its login() is called", () {
context("when success", () {
beforeEach(() {
when(authRepository.login(
Expand Down
2 changes: 1 addition & 1 deletion test/modules/login/login_module_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void main() {
module = LoginModule();
});

context("it's build() is called", () {
context("its build() is called", () {
late Widget widget;

beforeEach(() {
Expand Down
12 changes: 6 additions & 6 deletions test/modules/login/login_presenter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main() {
presenter.configure(view: view, interactor: interactor, router: router);
});

describe("it's didChangeEmailText and didChangePasswordText emit", () {
describe("its didChangeEmailText and didChangePasswordText emit", () {
context("when one of them is emptied", () {
beforeEach(() {
presenter.passwordTextFieldDidChange.add("");
Expand All @@ -49,7 +49,7 @@ void main() {
});
});

describe("it's didInitState emits", () {
describe("its didInitState emits", () {
beforeEach(() {
presenter.stateDidInit.add(null);
});
Expand All @@ -60,7 +60,7 @@ void main() {
});
});

describe("it's didTapForgotButton emits", () {
describe("its didTapForgotButton emits", () {
beforeEach(() {
presenter.forgotButtonDidTap.add(null);
});
Expand All @@ -70,7 +70,7 @@ void main() {
});
});

describe("it's didTapLoginButton emits", () {
describe("its didTapLoginButton emits", () {
beforeEach(() {
presenter.loginButtonDidTap.add(["", ""]);
});
Expand All @@ -84,7 +84,7 @@ void main() {
});
});

describe("it's didLogin emits", () {
describe("its didLogin emits", () {
beforeEach(() {
presenter.didLogin.add(null);
});
Expand All @@ -94,7 +94,7 @@ void main() {
});
});

describe("it's didFailToLogin emits", () {
describe("its didFailToLogin emits", () {
final error = Exception();
beforeEach(() {
presenter.didFailToLogin.add(error);
Expand Down
4 changes: 2 additions & 2 deletions test/modules/login/login_router_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void main() {
router = LoginRouterImpl();
});

describe("it's replaceToHomeScreen() is called", () {
describe("its replaceToHomeScreen() is called", () {
beforeEach(() {
router.replaceToHomeScreen(buildContext);
});
Expand All @@ -37,7 +37,7 @@ void main() {
});
});

describe("it's pushToForgotPasswordScreen() is called", () {
describe("its pushToForgotPasswordScreen() is called", () {
beforeEach(() {
router.pushToForgotPasswordScreen(buildContext);
});
Expand Down
18 changes: 9 additions & 9 deletions test/modules/login/login_view_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void main() {
});
});

describe("it's beginAnimation() is called", () {
describe("its beginAnimation() is called", () {
beforeEach((tester) async {
await tester.pumpModule(module);
module.view.beginAnimation();
Expand All @@ -75,7 +75,7 @@ void main() {
});
});

describe("it's showProgressHUD() is called", () {
describe("its showProgressHUD() is called", () {
beforeEach((tester) async {
await tester.pumpModule(module);
module.view.showProgressHUD();
Expand All @@ -89,7 +89,7 @@ void main() {
});
});

describe("it's dismissProgressHUD() is called", () {
describe("its dismissProgressHUD() is called", () {
beforeEach((tester) async {
await tester.pumpModule(module);
module.view.dismissProgressHUD();
Expand All @@ -103,7 +103,7 @@ void main() {
});
});

describe("it's setLoginButton() is called", () {
describe("its setLoginButton() is called", () {
context("isEnabled is true", () {
beforeEach((tester) async {
await tester.pumpModule(module);
Expand Down Expand Up @@ -133,7 +133,7 @@ void main() {
});
});

describe("it's alert() is called", () {
describe("its alert() is called", () {
const message = "a message";
beforeEach((tester) async {
await tester.pumpModule(module);
Expand All @@ -146,7 +146,7 @@ void main() {
});
});

describe("it's email text field is changed", () {
describe("its email text field is changed", () {
const text = "a text";
beforeEach((tester) async {
await tester.pumpModule(module);
Expand All @@ -159,7 +159,7 @@ void main() {
});
});

context("it's password text field is changed", () {
context("its password text field is changed", () {
const text = "a text";
beforeEach((tester) async {
await tester.pumpModule(module);
Expand All @@ -173,7 +173,7 @@ void main() {
});
});

context("it's login button is tapped", () {
context("its login button is tapped", () {
beforeEach((tester) async {
await tester.pumpModule(module);
module.view.setLoginButton(isEnabled: true);
Expand All @@ -187,7 +187,7 @@ void main() {
});
});

context("it's forgot button is tapped", () {
context("its forgot button is tapped", () {
beforeEach((tester) async {
await tester.pumpModule(module);
await tester.pumpAndSettle();
Expand Down

0 comments on commit 012964b

Please sign in to comment.