Files
jellyfin/tests/Jellyfin.Server.Integration.Tests/Controllers/SyncPlayControllerTests.cs
T
Shadowghost 93fc178db5 Backport pull request #17938 from jellyfin/release-12.z
Fix SyncPlay authentication error handling and limit group member wait time

Original-merge: 5fcb65bb46

Merged-by: crobibero <cody@robibe.ro>

Backported-by: Cody Robibero <cody@robibe.ro>
2026-09-15 11:16:05 -04:00

37 lines
1.1 KiB
C#

using System.Net;
using System.Threading.Tasks;
using Xunit;
namespace Jellyfin.Server.Integration.Tests.Controllers;
public sealed class SyncPlayControllerTests : IClassFixture<JellyfinApplicationFactory>
{
private readonly JellyfinApplicationFactory _factory;
public SyncPlayControllerTests(JellyfinApplicationFactory factory)
{
_factory = factory;
}
[Fact]
public async Task GetGroups_Unauthorized_ReturnsUnauthorized()
{
var client = _factory.CreateClient();
var response = await client.GetAsync("/SyncPlay/List", TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
}
[Fact]
public async Task GetGroups_InvalidToken_ReturnsUnauthorized()
{
var client = _factory.CreateClient();
client.DefaultRequestHeaders.AddAuthHeader("invalid-token");
var response = await client.GetAsync("/SyncPlay/List", TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.Unauthorized, response.StatusCode);
}
}