Skip to content

Commit

Permalink
default login with admin if not to create user (#6260)
Browse files Browse the repository at this point in the history
  • Loading branch information
eromano committed Oct 16, 2020
1 parent 13e8683 commit 04f5e35
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/testing/src/lib/core/actions/users.actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ export class UsersActions {
}

async createUser(userModel?: UserModel): Promise<UserModel> {
if (!this.api.apiService.isLoggedIn()) {
await this.api.apiService.login(browser.params.testConfig.admin.email, browser.params.testConfig.admin.password);
}

const user = new UserModel({ ...(userModel ? userModel : {}) });

try {
Expand Down Expand Up @@ -99,7 +103,7 @@ export class UsersActions {
}

async createUserWithName(firstName: string, lastName: string): Promise<UserModel> {
const user = new UserModel({ firstName: firstName, lastName: lastName});
const user = new UserModel({ firstName: firstName, lastName: lastName });
return this.createUser(user);
}

Expand Down

0 comments on commit 04f5e35

Please sign in to comment.