Skip to content

Commit

Permalink
update cli and oauth tests for users with email
Browse files Browse the repository at this point in the history
Signed-off-by: Kristoffer Dalby <[email protected]>
  • Loading branch information
kradalby committed Dec 18, 2024
1 parent d8adb72 commit 1e224d4
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 26 deletions.
50 changes: 30 additions & 20 deletions integration/auth_oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ func TestOIDCAuthenticationPingAll(t *testing.T) {

want := []v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
{
Id: 2,
Expand All @@ -141,8 +142,9 @@ func TestOIDCAuthenticationPingAll(t *testing.T) {
ProviderId: oidcConfig.Issuer + "/user1",
},
{
Id: 3,
Name: "user2",
Id: 3,
Name: "user2",
Email: "[email protected]",
},
{
Id: 4,
Expand Down Expand Up @@ -260,8 +262,9 @@ func TestOIDC024UserCreation(t *testing.T) {
want: func(iss string) []v1.User {
return []v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
{
Id: 2,
Expand All @@ -271,8 +274,9 @@ func TestOIDC024UserCreation(t *testing.T) {
ProviderId: iss + "/user1",
},
{
Id: 3,
Name: "user2",
Id: 3,
Name: "user2",
Email: "[email protected]",
},
{
Id: 4,
Expand All @@ -295,8 +299,9 @@ func TestOIDC024UserCreation(t *testing.T) {
want: func(iss string) []v1.User {
return []v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
{
Id: 2,
Expand All @@ -305,8 +310,9 @@ func TestOIDC024UserCreation(t *testing.T) {
ProviderId: iss + "/user1",
},
{
Id: 3,
Name: "user2",
Id: 3,
Name: "user2",
Email: "[email protected]",
},
{
Id: 4,
Expand Down Expand Up @@ -357,8 +363,9 @@ func TestOIDC024UserCreation(t *testing.T) {
want: func(iss string) []v1.User {
return []v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
{
Id: 2,
Expand All @@ -367,8 +374,9 @@ func TestOIDC024UserCreation(t *testing.T) {
ProviderId: iss + "/user1",
},
{
Id: 3,
Name: "user2",
Id: 3,
Name: "user2",
Email: "[email protected]",
},
{
Id: 4,
Expand Down Expand Up @@ -421,8 +429,9 @@ func TestOIDC024UserCreation(t *testing.T) {
want: func(iss string) []v1.User {
return []v1.User{
{
Id: 1,
Name: "user1.headscale.net",
Id: 1,
Name: "user1.headscale.net",
Email: "[email protected]",
},
{
Id: 2,
Expand All @@ -431,8 +440,9 @@ func TestOIDC024UserCreation(t *testing.T) {
ProviderId: iss + "/user1",
},
{
Id: 3,
Name: "user2.headscale.net",
Id: 3,
Name: "user2.headscale.net",
Email: "[email protected]",
},
{
Id: 4,
Expand Down
15 changes: 9 additions & 6 deletions integration/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,9 @@ func TestUserCommand(t *testing.T) {
slices.SortFunc(listByUsername, sortWithID)
want := []*v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
}

Expand All @@ -161,8 +162,9 @@ func TestUserCommand(t *testing.T) {
slices.SortFunc(listByID, sortWithID)
want = []*v1.User{
{
Id: 1,
Name: "user1",
Id: 1,
Name: "user1",
Email: "[email protected]",
},
}

Expand Down Expand Up @@ -199,8 +201,9 @@ func TestUserCommand(t *testing.T) {
slices.SortFunc(listAfterIDDelete, sortWithID)
want = []*v1.User{
{
Id: 2,
Name: "newname",
Id: 2,
Name: "newname",
Email: "[email protected]",
},
}

Expand Down

0 comments on commit 1e224d4

Please sign in to comment.