-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed88c58
commit 2c4fed1
Showing
8 changed files
with
108 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
tests/integration/email_link_send_test.go → ...gration/emaillink/email_link_send_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//go:build integration | ||
|
||
package project_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/corbado/corbado-go/tests/integration" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestProjectConfigGet(t *testing.T) { | ||
rsp, err := integration.SDK(t).Projects().ConfigGet(context.TODO()) | ||
|
||
require.NoError(t, err) | ||
assert.Equal(t, integration.GetProjectID(t), rsp.Data.ProjectID) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//go:build integration | ||
|
||
package project_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/corbado/corbado-go/pkg/sdk/entity/api" | ||
"github.com/corbado/corbado-go/pkg/sdk/util" | ||
"github.com/corbado/corbado-go/tests/integration" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestProjectConfigUpdate(t *testing.T) { | ||
newName := integration.CreateRandomTestName(t) | ||
err := integration.SDK(t).Projects().ConfigUpdate(context.TODO(), api.ProjectConfigSaveReq{ | ||
ExternalName: util.Ptr(newName), | ||
}) | ||
require.NoError(t, err) | ||
|
||
newCfg, err := integration.SDK(t).Projects().ConfigGet(context.TODO()) | ||
require.NoError(t, err) | ||
assert.Equal(t, newName, newCfg.Data.ExternalName) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
//go:build integration | ||
|
||
package user_test | ||
|
||
import ( | ||
"context" | ||
"testing" | ||
|
||
"github.com/corbado/corbado-go/pkg/sdk/entity/api" | ||
"github.com/corbado/corbado-go/pkg/sdk/util" | ||
"github.com/corbado/corbado-go/tests/integration" | ||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestUserList(t *testing.T) { | ||
// send email link first so that we have at least one user | ||
_, err := integration.SDK(t).EmailLinks().Send(context.TODO(), api.EmailLinkSendReq{ | ||
Email: integration.CreateRandomTestEmail(t), | ||
Redirect: "https://some.site.com/authenticate", | ||
TemplateName: util.Ptr("default"), | ||
Create: true, | ||
AdditionalPayload: util.Ptr("{}"), | ||
ClientInfo: util.ClientInfo("foobar", "127.0.0.1"), | ||
}) | ||
require.NoError(t, err) | ||
|
||
usersRsp, err := integration.SDK(t).Users().List(context.TODO(), nil) | ||
require.NoError(t, err) | ||
|
||
assert.True(t, len(usersRsp.Data.Users) > 0) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters