Skip to content

Commit

Permalink
test: Minor test updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tjtanjin committed Feb 11, 2025
1 parent 6553594 commit 2a876c8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cypress/fixtures/templates/ChatBotApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function App() {
},
ask_height: {
message: "What is your height (cm)?",
path: (params: Params) => {
path: async (params: Params) => {
if (isNaN(Number(params.userInput))) {
params.injectMessage("Height needs to be a number!");
await params.injectMessage("Height needs to be a number!");
return;
}
return "ask_weather";
Expand Down Expand Up @@ -95,11 +95,11 @@ function App() {
</button>
</div>
),
path: (params: Params) => {
path: async (params: Params) => {
if (params.userInput.toLowerCase() != "black") {
return "incorrect_answer"
} else {
params.openChat(false);
await params.openChat(false);
return "close_chat";
}
},
Expand All @@ -124,8 +124,8 @@ function App() {
loop: {
message: (params: Params) => {
// sends the message half a second later to facilitate testing of new message prompt
setTimeout(() => {
params.injectMessage("You have reached the end of the conversation!");
setTimeout(async () => {
await params.injectMessage("You have reached the end of the conversation!");
}, 500)
},
path: "loop"
Expand Down
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ function App() {
},
loop: {
message: (params: Params) => {
// sends the message half a second later to facilitate testing of new message prompt
// sends the message a second later to facilitate testing of new message prompt
setTimeout(async () => {
await params.injectMessage("You have reached the end of the conversation!");
}, 500)
}, 1000)
},
path: "loop"
},
Expand Down

0 comments on commit 2a876c8

Please sign in to comment.