Skip to content

Commit 698051f

Browse files
committed
Use a cleaner test
1 parent c9aa589 commit 698051f

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/test/suite/participant/participant.test.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2185,15 +2185,21 @@ Schema:
21852185
throw new Error(`Unhandled message content type ${message}`);
21862186
};
21872187

2188-
expect(
2189-
messages.find((message) =>
2190-
contentIncludes(message, 'some disallowed message')
2191-
)
2192-
).to.be.undefined;
2193-
2194-
expect(
2195-
messages.find((message) => contentIncludes(message, 'ok message'))
2196-
).to.not.be.undefined;
2188+
const messageContents = messages.map((message) => {
2189+
// There may be different types for the messages' content
2190+
const content = Array.isArray(message.content)
2191+
? message.content.flatMap((sub) => sub.value).join('')
2192+
: message.content;
2193+
2194+
return content;
2195+
});
2196+
2197+
// Skip the preset prompt and check that the rest are correct.
2198+
expect(messageContents.slice(1)).deep.equal([
2199+
'give me the count of all people in the prod database',
2200+
'ok message',
2201+
'find all docs by a name example',
2202+
]);
21972203
});
21982204
});
21992205
});

0 commit comments

Comments
 (0)