feat(api): add route names and handler tests for picker list endpoints (#105)

The WIP GET /api/filler-presets, /api/watermarks, and
/api/graphics-elements endpoints omitted the Name= route attribute
used by the other API GET actions (e.g. FFmpegProfileController). Add
Name = "GetFillerPresets" / "GetWatermarks" / "GetGraphicsElements" for
consistency.

Also add handler tests (FillerPresetHandlerTests, WatermarkHandlerTests,
GraphicsElementHandlerTests) covering the GetAll*ForApi handlers using
the InMemoryTvContext harness: multi-row projection to (Id, Name) DTOs,
the empty-DB case, and the graphics-element ordering rule (named
elements sort before elements whose projected Name equals FileName).
This commit is contained in:
2026-07-02 22:06:19 +02:00
parent 8912686a47
commit 0eaedb9cf6
6 changed files with 214 additions and 3 deletions
@@ -9,7 +9,7 @@ namespace ErsatzTV.Controllers.Api;
[ApiController]
public class FillerPresetController(IMediator mediator) : ControllerBase
{
[HttpGet("/api/filler-presets")]
[HttpGet("/api/filler-presets", Name = "GetFillerPresets")]
[Tags("Filler Presets")]
[EndpointSummary("Get all filler presets")]
[EndpointGroupName("general")]
@@ -9,7 +9,7 @@ namespace ErsatzTV.Controllers.Api;
[ApiController]
public class GraphicsElementController(IMediator mediator) : ControllerBase
{
[HttpGet("/api/graphics-elements")]
[HttpGet("/api/graphics-elements", Name = "GetGraphicsElements")]
[Tags("Graphics Elements")]
[EndpointSummary("Get all graphics elements")]
[EndpointGroupName("general")]
@@ -9,7 +9,7 @@ namespace ErsatzTV.Controllers.Api;
[ApiController]
public class WatermarkController(IMediator mediator) : ControllerBase
{
[HttpGet("/api/watermarks")]
[HttpGet("/api/watermarks", Name = "GetWatermarks")]
[Tags("Watermarks")]
[EndpointSummary("Get all watermarks")]
[EndpointGroupName("general")]