show story progress and reset last read when resetting progress.

This commit is contained in:
Stefan Hardegger
2025-10-30 13:44:54 +01:00
parent a3bc83db8a
commit 0e1ed7c92e
8 changed files with 62 additions and 19 deletions

View File

@@ -85,7 +85,8 @@ class StoryServiceTest {
Story result = storyService.updateReadingProgress(testId, position);
assertEquals(0, result.getReadingPosition());
assertNotNull(result.getLastReadAt());
// When position is 0, lastReadAt should be reset to null so the story doesn't appear in "last read" sorting
assertNull(result.getLastReadAt());
verify(storyRepository).save(testStory);
}
@@ -111,7 +112,8 @@ class StoryServiceTest {
Story result = storyService.updateReadingProgress(testId, position);
assertNull(result.getReadingPosition());
assertNotNull(result.getLastReadAt());
// When position is null, lastReadAt should be reset to null so the story doesn't appear in "last read" sorting
assertNull(result.getLastReadAt());
verify(storyRepository).save(testStory);
}