Skip to content

Commit 47f70a9

Browse files
committed
Fix tests
1 parent d9defff commit 47f70a9

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

codersdk/users_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,29 @@ package codersdk_test
22

33
import (
44
"context"
5-
"net/http"
65
"testing"
76

87
"github.com/stretchr/testify/require"
98

109
"github.com/coder/coder/coderd"
1110
"github.com/coder/coder/coderd/coderdtest"
12-
"github.com/coder/coder/codersdk"
1311
)
1412

1513
func TestUsers(t *testing.T) {
16-
t.Run("MultipleInitial", func(t *testing.T) {
14+
t.Run("CreateInitial", func(t *testing.T) {
1715
server := coderdtest.New(t)
1816
_, err := server.Client.CreateInitialUser(context.Background(), coderd.CreateInitialUserRequest{
1917
Email: "wowie@coder.com",
2018
Organization: "somethin",
2119
Username: "tester",
2220
Password: "moo",
2321
})
24-
var cerr *codersdk.Error
25-
require.ErrorAs(t, err, &cerr)
26-
require.Equal(t, cerr.StatusCode(), http.StatusConflict)
27-
require.Greater(t, len(cerr.Error()), 0)
22+
require.NoError(t, err)
2823
})
2924

3025
t.Run("Get", func(t *testing.T) {
3126
server := coderdtest.New(t)
27+
_ = server.RandomInitialUser(t)
3228
_, err := server.Client.User(context.Background(), "")
3329
require.NoError(t, err)
3430
})

0 commit comments

Comments
 (0)