feat(usability): label booking actions and enlarge row targets (U09)

This commit is contained in:
2026-11-02 19:25:34 +01:00
parent 62e2b7dee8
commit 2d36ab0b88
5 changed files with 57 additions and 15 deletions
@@ -0,0 +1,24 @@
using Bunit;
using Duempelkas.App.Components.Accounts;
using Duempelkas.App.Services.Models;
using Duempelkas.Domain.Enums;
using Xunit;
namespace Duempelkas.Tests;
public class EntryPresentationTests
{
[Fact]
public void Actions_HaveVisibleTextAndBookingSpecificNames()
{
using var context = new BunitContext();
var entry = new EntryDto(1, 1, "2026-001", EntryType.Expense, DateTime.Today, "Porto", 4.20m, false, false, null, null, null);
var edited = 0;
var table = context.Render<EntryTable>(p => p.Add(x => x.Entries, [entry]).Add(x => x.OnEditEntry, id => edited = id));
Assert.Contains("2026-001 Porto", table.Find("summary").GetAttribute("aria-label"));
var edit = table.FindAll("button").Single(b => b.TextContent.Contains("Bearbeiten"));
Assert.Contains("Porto", edit.GetAttribute("aria-label"));
edit.Click();
Assert.Equal(1, edited);
}
}