You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
966 B
29 lines
966 B
using System.Net.Http.Json; |
|
using Bit.Core.Enums; |
|
using Bit.Events.Models; |
|
|
|
namespace Bit.Events.IntegrationTest.Controllers; |
|
|
|
public class CollectControllerTests |
|
{ |
|
// This is a very simple test, and should be updated to assert more things, but for now |
|
// it ensures that the events startup doesn't throw any errors with fairly basic configuration. |
|
[Fact] |
|
public async Task Post_Works() |
|
{ |
|
var eventsApplicationFactory = new EventsApplicationFactory(); |
|
var (accessToken, _) = await eventsApplicationFactory.LoginWithNewAccount(); |
|
var client = eventsApplicationFactory.CreateAuthedClient(accessToken); |
|
|
|
var response = await client.PostAsJsonAsync<IEnumerable<EventModel>>("collect", |
|
[ |
|
new EventModel |
|
{ |
|
Type = EventType.User_ClientExportedVault, |
|
Date = DateTime.UtcNow, |
|
}, |
|
]); |
|
|
|
response.EnsureSuccessStatusCode(); |
|
} |
|
}
|
|
|