Dashboard: show 10 chapters titled Chapters; bump chapter mtime on beat changes

Beat create/update/delete/reorder/assign/move now touch the parent
chapter's UpdatedAt so the dashboard's recency sort reflects beat edits,
not just chapter-level prose/tag changes.
This commit is contained in:
James Wampler
2026-08-17 22:53:05 -07:00
parent 17facba3b9
commit bc85a36e18
3 changed files with 49 additions and 3 deletions
@@ -35,6 +35,31 @@ public class BeatServiceTests : ServiceTestFixture
});
}
[Test]
public async Task Adding_a_beat_bumps_the_chapters_last_modified_date()
{
var updatedAtBefore = (await Chapters.GetAsync(_chapterId))!.UpdatedAt;
await Task.Delay(10);
await Beats.CreateAsync(_chapterId, new CreateBeatRequest("She finds the map"));
var updatedAtAfter = (await Chapters.GetAsync(_chapterId))!.UpdatedAt;
Assert.That(updatedAtAfter, Is.GreaterThan(updatedAtBefore));
}
[Test]
public async Task Editing_a_beats_text_bumps_the_chapters_last_modified_date()
{
var beat = await Beats.CreateAsync(_chapterId, new CreateBeatRequest("She finds the map"));
var updatedAtBefore = (await Chapters.GetAsync(_chapterId))!.UpdatedAt;
await Task.Delay(10);
await Beats.UpdateAsync(beat!.Id, new UpdateBeatRequest(WhatHappened: "She reads it by lamplight"));
var updatedAtAfter = (await Chapters.GetAsync(_chapterId))!.UpdatedAt;
Assert.That(updatedAtAfter, Is.GreaterThan(updatedAtBefore));
}
[Test]
public async Task Reordering_renumbers_to_match_the_order_given()
{