Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
geir-eilertsen committed Dec 16, 2024
1 parent 254430b commit 928c932
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
}
messageList.appendChild(newMessage);
messageList.appendChild(document.createElement("div")).style.clear = "both";
newMessage.scrollIntoView({ behavior: "smooth" });

if (sender !== "User") {
const senderHeader = document.createElement("span");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.assetvisor.marvin.robot.domain.communication.ForCheckingIfAnybodyIsListening;
import com.assetvisor.marvin.robot.domain.communication.ForConvertingTextToSpeech;
import com.assetvisor.marvin.robot.domain.communication.ForMessaging;
import com.assetvisor.marvin.robot.domain.communication.Message;
import com.assetvisor.marvin.robot.domain.communication.SpeechBuffer;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -31,16 +32,16 @@ public class BrainResponderTest {
@Test
public void shouldRespond() {
// Given
String message = "message";
Message message = new Message("Marvin", "message");
byte[] bytes = {1, 2, 3};

given(forConvertingTextToSpeech.convert(message)).willReturn(bytes);
given(forConvertingTextToSpeech.convert(message.content())).willReturn(bytes);
given(forCheckingIfAnybodyIsListening.isAnybodyListening()).willReturn(true);

// When
brainResponder.respond(message);
brainResponder.respond(message.content());
// Then
verify(forConvertingTextToSpeech).convert(message);
verify(forConvertingTextToSpeech).convert(message.content());
verify(speechBuffer).add(bytes);
verify(forMessaging).message(message);
verifyNoMoreInteractions(forMessaging, forConvertingTextToSpeech, speechBuffer);
Expand Down

0 comments on commit 928c932

Please sign in to comment.