Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ private static void main(Context ctx) {
List<String> held = estates == null ? List.of() : estates.holdings(UUID.fromString(ctx.character().getId()));
lines.add(held.isEmpty() ? "Your estate holds nothing recorded today." : "Your estate today:");
for (String line : held) lines.add("• " + line);
lines.add("Pets and animals are not included yet.");
List<Button> buttons = new ArrayList<>();
buttons.add(button(ctx, "Name an heir", values -> ask(ctx)));
if (will.named()) buttons.add(button(ctx, "Revoke", values -> confirm(ctx, null, "Revoke your will? Nobody will be named.")));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,14 @@ private void click(String label) {
@Test
void namingAnHeirByNameConfirmsAndSaves() {
EstateHooks hooks = mock(EstateHooks.class);
when(hooks.holdings(UUID.fromString(aria.getId()))).thenReturn(List.of("340.25 in pouch and bank"));
when(hooks.holdings(UUID.fromString(aria.getId()))).thenReturn(List.of("340.25 in pouch and bank", "2 pets", "1 animal"));
estates.when(EstateLink::current).thenReturn(hooks);
WillMenu.open(player);
assertEquals("Will of Aria", last().title());
assertTrue(last().lines().contains("No heir is named."));
assertTrue(last().lines().contains("• 340.25 in pouch and bank"));
assertTrue(last().lines().contains("Pets and animals are not included yet."));
assertTrue(last().lines().contains("• 2 pets"));
assertTrue(last().lines().contains("• 1 animal"));
assertEquals(List.of("Name an heir", "Close"), last().buttons().stream().map(Button::label).toList());
click("Name an heir");
assertEquals("heir", last().input().key());
Expand Down
Loading