Implements tests for commit bfa7b190b2

Covers the four consumption lifecycle Web proxy endpoints with unit, integration and security tests and their DTO and request fixtures. Changes the report progress Web route from POST to PUT, matching the upstream API, and updates the music player and the book reader to send that verb.
This commit is contained in:
BinaryAlley committed 2026-10-28 12:55:55 +02:00
1 parent 1afb078efc
commit d3b4eec630
22 files changed
+3108 -5

No files matched your search

@@ -43,4 +43,26 @@ public class SettingsViewEndpointTests : IClassFixture<LuminaWebFactory>
string content = await response.Content.ReadAsStringAsync();
Assert.Contains("user-settings-form", content);
}
[Fact]
public async Task SettingsView_WhenCalledByAuthenticatedUser_ShouldRenderTheAudioPlayerConsumptionRouteTemplates()
{
// Arrange
AuthenticatedWebClient webClient = await WebTestHelpers.CreateAuthenticatedClientAsync(_apiFactory);
// Act
HttpResponseMessage response = await webClient.Client.GetAsync("/en-us/tools/settings");
// Assert
response.EnsureSuccessStatusCode();
string content = await response.Content.ReadAsStringAsync();
Assert.Contains("startConsumptionRouteTemplate", content);
Assert.Contains("reportConsumptionProgressRouteTemplate", content);
Assert.Contains("completeConsumptionRouteTemplate", content);
Assert.Contains("stopConsumptionRouteTemplate", content);
Assert.Contains("/media-consumption/api-start-consumption/{libraryId}/{mediaKind}/{mediaItemId}", content);
Assert.Contains("/media-consumption/api-report-consumption-progress/{recordId}", content);
Assert.Contains("/media-consumption/api-complete-consumption/{recordId}", content);
Assert.Contains("/media-consumption/api-stop-consumption/{recordId}", content);
}
}