diff options
| author | Ethan Pippin <ethanpippin2343@gmail.com> | 2026-11-12 00:42:03 -0500 |
|---|---|---|
| committer | Ethan Pippin <ethanpippin2343@gmail.com> | 2026-11-12 00:42:03 -0500 |
| commit | 2cfcb9ac0cfae50aa1a5be456fa6178cb4a2aaef (patch) | |
| tree | 296abc2e9cd09868e5503aae0c09085a370801f8 /tests/Jellyfin.Server.Integration.Tests | |
| parent | 7b8c6451b508c8ec77070c91a14d2e631067c87e (diff) | |
Years, Ratings for filters endpoints
Diffstat (limited to 'tests/Jellyfin.Server.Integration.Tests')
| -rw-r--r-- | tests/Jellyfin.Server.Integration.Tests/Controllers/FilterControllerTests.cs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/Jellyfin.Server.Integration.Tests/Controllers/FilterControllerTests.cs b/tests/Jellyfin.Server.Integration.Tests/Controllers/FilterControllerTests.cs new file mode 100644 index 0000000000..0e174fb597 --- /dev/null +++ b/tests/Jellyfin.Server.Integration.Tests/Controllers/FilterControllerTests.cs @@ -0,0 +1,35 @@ +using System.Net.Http.Json; +using System.Text.Json; +using System.Threading.Tasks; +using Xunit; + +namespace Jellyfin.Server.Integration.Tests.Controllers; + +public sealed class FilterControllerTests : IClassFixture<JellyfinApplicationFactory> +{ + private readonly JellyfinApplicationFactory _factory; + private static string? _accessToken; + + public FilterControllerTests(JellyfinApplicationFactory factory) + { + _factory = factory; + } + + [Theory] + [InlineData("Movie")] + [InlineData("Series")] + public async Task GetQueryFilters_EmptyLibrary_SerializesEmptyArrays(string itemType) + { + using var client = _factory.CreateClient(); + client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client)); + + var filters = await client.GetFromJsonAsync<JsonElement>($"/Items/Filters2?includeItemTypes={itemType}", TestContext.Current.CancellationToken); + + foreach (var field in new[] { "Years", "OfficialRatings", "Genres", "Tags", "AudioLanguages", "SubtitleLanguages" }) + { + var values = filters.GetProperty(field); + Assert.Equal(JsonValueKind.Array, values.ValueKind); + Assert.Equal(0, values.GetArrayLength()); + } + } +} |
