(t *testing.T)
| 167 | } |
| 168 | |
| 169 | func TestUserAuthMethods(t *testing.T) { |
| 170 | t.Parallel() |
| 171 | t.Run("Password", func(t *testing.T) { |
| 172 | t.Parallel() |
| 173 | client := coderdtest.New(t, nil) |
| 174 | |
| 175 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 176 | defer cancel() |
| 177 | |
| 178 | methods, err := client.AuthMethods(ctx) |
| 179 | require.NoError(t, err) |
| 180 | require.True(t, methods.Password.Enabled) |
| 181 | require.False(t, methods.Github.Enabled) |
| 182 | }) |
| 183 | t.Run("Github", func(t *testing.T) { |
| 184 | t.Parallel() |
| 185 | client := coderdtest.New(t, &coderdtest.Options{ |
| 186 | GithubOAuth2Config: &coderd.GithubOAuth2Config{}, |
| 187 | }) |
| 188 | |
| 189 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 190 | defer cancel() |
| 191 | |
| 192 | methods, err := client.AuthMethods(ctx) |
| 193 | require.NoError(t, err) |
| 194 | require.True(t, methods.Password.Enabled) |
| 195 | require.True(t, methods.Github.Enabled) |
| 196 | }) |
| 197 | } |
| 198 | |
| 199 | // nolint:bodyclose |
| 200 | func TestUserOAuth2Github(t *testing.T) { |
nothing calls this directly
no test coverage detected