Reduce frontend polling load and clean stale UI hooks
This commit is contained in:
@@ -348,6 +348,45 @@ public class SuggestionTests
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Update_does_not_revalidate_unchanged_screenshot_url()
|
||||
{
|
||||
await using var factory = new TestWebApplicationFactory();
|
||||
var client = factory.CreateClientWithCookies();
|
||||
await client.RegisterAsync("reval");
|
||||
|
||||
var create = await client.PostAsJsonAsync("/api/suggestions", new
|
||||
{
|
||||
Name = "Reachable once",
|
||||
Genre = (string?)null,
|
||||
Description = (string?)null,
|
||||
ScreenshotUrl = "http://example.com/shot.png",
|
||||
YoutubeUrl = (string?)null,
|
||||
GameUrl = (string?)null,
|
||||
MinPlayers = (int?)null,
|
||||
MaxPlayers = (int?)null
|
||||
});
|
||||
create.EnsureSuccessStatusCode();
|
||||
var createdPayload = await create.Content.ReadFromJsonAsync<JsonElement>();
|
||||
var suggestionId = createdPayload.GetProperty("id").GetInt32();
|
||||
|
||||
factory.HttpHandler.SetResponder(_ => new HttpResponseMessage(HttpStatusCode.BadRequest));
|
||||
|
||||
var update = await client.PutAsJsonAsync($"/api/suggestions/{suggestionId}", new
|
||||
{
|
||||
Name = "Reachable once",
|
||||
Genre = "Updated",
|
||||
Description = (string?)null,
|
||||
ScreenshotUrl = "http://example.com/shot.png",
|
||||
YoutubeUrl = (string?)null,
|
||||
GameUrl = (string?)null,
|
||||
MinPlayers = (int?)null,
|
||||
MaxPlayers = (int?)null
|
||||
});
|
||||
|
||||
update.EnsureSuccessStatusCode();
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Get_all_requires_vote_phase()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user