Skip to content

Commit

Permalink
feat: Updated test/e2e/e2e.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Feb 1, 2024
1 parent fe9a82d commit f5b3060
Showing 1 changed file with 43 additions and 6 deletions.
49 changes: 43 additions & 6 deletions test/e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,34 @@ func RunE2ETests(t *testing.T) {
token, err := gettoken.GetUserToken("openIM123456")
if err != nil {
t.Fatalf("Failed to get user token: %v", err)
return
}
headers := map[string]string{
if err != nil {
t.Fatalf("Failed to get user token: %v", err)
return
}
if err != nil {
t.Fatalf("Failed to get user token: %v", err)
}
if headers == nil {
headers = make(map[string]string)
}
if _, ok := headers["operationID"]; !ok {
headers["operationID"] = operationID
}
if _, ok := headers["token"]; !ok {
headers["token"] = token
}
"token": token,

Check failure on line 54 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / lint

illegal label declaration (typecheck)

Check failure on line 54 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: unexpected : at end of statement

Check failure on line 54 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: unexpected : at end of statement

Check failure on line 54 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: unexpected : at end of statement

Check failure on line 54 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: unexpected : at end of statement
"operationID": operationID,
}

// Example of getting user info
// Example of getting user info
_, err = user.GetUsersInfo(token, []string{"user1", "user2"})

Check failure on line 59 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: non-declaration statement outside function body

Check failure on line 59 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: non-declaration statement outside function body

Check failure on line 59 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: non-declaration statement outside function body

Check failure on line 59 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / Execute OpenIM script on ubuntu-latest

syntax error: non-declaration statement outside function body
if err != nil {
t.Fatalf("Failed to get user info: %v", err)
return
}
_ = user.GetUsersInfo(token, []string{"user1", "user2"})

// Example of updating user info
Expand All @@ -49,16 +70,32 @@ func RunE2ETests(t *testing.T) {
_ = user.GetUsersOnlineStatus(token, []string{"user1", "user2"})

// Example of forcing a logout
_ = user.ForceLogout(token, "4950983283", 2)
_, err = user.ForceLogout(token, "4950983283", 2)
if err != nil {
t.Fatalf("Failed to force logout: %v", err)
return
}

// Example of checking user account
_ = user.CheckUserAccount(token, []string{"openIM123456", "anotherUserID"})
_, err = user.CheckUserAccount(token, []string{"openIM123456", "anotherUserID"})
if err != nil {
t.Fatalf("Failed to check user account: %v", err)
return
}

// Example of getting users
_ = user.GetUsers(token, 1, 100)
_, err = user.GetUsers(token, 1, 100)
if err != nil {
t.Fatalf("Failed to get users: %v", err)
return
}
}
// Example of getting users' online status
_ = user.GetUsersOnlineStatus(token, []string{"user1", "user2"})
_, err = user.GetUsersOnlineStatus(token, []string{"user1", "user2"})

Check failure on line 94 in test/e2e/e2e.go

View workflow job for this annotation

GitHub Actions / lint

expected declaration, found _ (typecheck)
if err != nil {
t.Fatalf("Failed to get users' online status: %v", err)
return
}

// Example of forcing a logout
_ = user.ForceLogout(token, "4950983283", 2)
Expand Down

0 comments on commit f5b3060

Please sign in to comment.