fix(guild): populate leader_name in search results (matches prod capture)
Add IViewerRepository.LoadDisplayNamesAsync (batch AsNoTracking select), extend GuildSearchEntry with LeaderName, enrich GuildService.SearchAsync with a leader-id batch lookup, and thread the name through the controller's ToDetailDto call. Adds a leader_name assertion to GuildSearchFlowTests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -231,5 +231,8 @@ public class GuildSearchFlowTests
|
||||
Assert.That(entry.TryGetProperty("detail", out _), Is.False, "no 'detail' wrapper on search list entries");
|
||||
Assert.That(entry.TryGetProperty("guild_name", out var gn), Is.True);
|
||||
Assert.That(gn.GetString(), Is.EqualTo("SmallFreeGuild"));
|
||||
// leader_name must be populated from the seeded viewer's DisplayName, not empty string
|
||||
Assert.That(entry.TryGetProperty("leader_name", out var ln), Is.True, "leader_name field must be present");
|
||||
Assert.That(ln.GetString(), Is.EqualTo("SearchLeader7"), "leader_name must match the seeded leader's DisplayName");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user