mirror of
https://github.com/bitwarden/server.git
synced 2025-05-31 08:10:32 -05:00
Fix tests
This commit is contained in:
parent
edc4b567ef
commit
b4618b31be
@ -5,6 +5,7 @@ using Bit.IntegrationTestCommon;
|
|||||||
using Bit.IntegrationTestCommon.Factories;
|
using Bit.IntegrationTestCommon.Factories;
|
||||||
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
using Microsoft.AspNetCore.Authentication.JwtBearer;
|
||||||
using Microsoft.AspNetCore.TestHost;
|
using Microsoft.AspNetCore.TestHost;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
#nullable enable
|
#nullable enable
|
||||||
|
|
||||||
@ -50,6 +51,10 @@ public class ApiApplicationFactory : WebApplicationFactoryBase<Startup>
|
|||||||
public async Task<(string Token, string RefreshToken)> LoginWithNewAccount(
|
public async Task<(string Token, string RefreshToken)> LoginWithNewAccount(
|
||||||
string email = "integration-test@bitwarden.com", string masterPasswordHash = "master_password_hash")
|
string email = "integration-test@bitwarden.com", string masterPasswordHash = "master_password_hash")
|
||||||
{
|
{
|
||||||
|
// This might be the first action in a test and since it forwards to the Identity server, we need to ensure that
|
||||||
|
// this server is initialized since it's responsible for seeding the database.
|
||||||
|
Assert.NotNull(Services);
|
||||||
|
|
||||||
await _identityApplicationFactory.RegisterNewIdentityFactoryUserAsync(
|
await _identityApplicationFactory.RegisterNewIdentityFactoryUserAsync(
|
||||||
new RegisterFinishRequestModel
|
new RegisterFinishRequestModel
|
||||||
{
|
{
|
||||||
|
@ -45,6 +45,10 @@ public class EventsApplicationFactory : WebApplicationFactoryBase<Startup>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public async Task<(string Token, string RefreshToken)> LoginWithNewAccount(string email = "integration-test@bitwarden.com", string masterPasswordHash = "master_password_hash")
|
public async Task<(string Token, string RefreshToken)> LoginWithNewAccount(string email = "integration-test@bitwarden.com", string masterPasswordHash = "master_password_hash")
|
||||||
{
|
{
|
||||||
|
// This might be the first action in a test and since it forwards to the Identity server, we need to ensure that
|
||||||
|
// this server is initialized since it's responsible for seeding the database.
|
||||||
|
Assert.NotNull(Services);
|
||||||
|
|
||||||
await _identityApplicationFactory.RegisterNewIdentityFactoryUserAsync(
|
await _identityApplicationFactory.RegisterNewIdentityFactoryUserAsync(
|
||||||
new RegisterFinishRequestModel
|
new RegisterFinishRequestModel
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user