feat(transcription): person @mention sidecar + rename propagation (PR-A backend, #362) #366
@@ -143,6 +143,28 @@ class PersonMentionPropagationListenerTest {
|
|||||||
.containsExactly("Augusta Raddatz");
|
.containsExactly("Augusta Raddatz");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void noOps_whenPersonIdNoLongerExists_orphanedSidecarGuard() {
|
||||||
|
UUID orphanId = UUID.randomUUID();
|
||||||
|
when(personService.existsById(orphanId)).thenReturn(false);
|
||||||
|
|
||||||
|
TranscriptionBlock saved = saveBlock(
|
||||||
|
"Stale reference to @Ghost Name should not be rewritten.",
|
||||||
|
List.of(new PersonMention(orphanId, "Ghost Name")));
|
||||||
|
em.clear();
|
||||||
|
|
||||||
|
listener.onPersonDisplayNameChanged(
|
||||||
|
new PersonDisplayNameChangedEvent(orphanId, "Ghost Name", "Resurrected Name"));
|
||||||
|
blockRepository.flush();
|
||||||
|
em.clear();
|
||||||
|
|
||||||
|
TranscriptionBlock reloaded = blockRepository.findById(saved.getId()).orElseThrow();
|
||||||
|
assertThat(reloaded.getText()).isEqualTo("Stale reference to @Ghost Name should not be rewritten.");
|
||||||
|
assertThat(reloaded.getMentionedPersons())
|
||||||
|
.extracting(PersonMention::getDisplayName)
|
||||||
|
.containsExactly("Ghost Name");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void leavesUnrelatedBlockUntouched_whenNoSidecarReferencesPerson() {
|
void leavesUnrelatedBlockUntouched_whenNoSidecarReferencesPerson() {
|
||||||
UUID personId = savedPersonId("Auguste", "Raddatz");
|
UUID personId = savedPersonId("Auguste", "Raddatz");
|
||||||
|
|||||||
Reference in New Issue
Block a user