Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve testing for messages functionality #195

Open
lawrence-forooghian opened this issue Dec 12, 2024 · 1 comment
Open

Improve testing for messages functionality #195

lawrence-forooghian opened this issue Dec 12, 2024 · 1 comment
Labels
testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them.

Comments

@lawrence-forooghian
Copy link
Collaborator

lawrence-forooghian commented Dec 12, 2024

From commit message of 7fcab5c in #196:

I was surprised to find that there were no existing tests for the request that ChatAPI makes when you call sendMessage, nor for DefaultMessages’s handling of messages received over a realtime channel, which meant that there wasn’t an obvious place to slot in the tests for the fixes introduced by this commit, nor did the mocks have any support for writing such tests. I’ve added tests for my fixes but, given my rush to get this fix done, the changes to the mocks aren’t great. Have created issue #195 for us come back and write the missing tests and tidy mine up.

┆Issue is synchronized with this Jira Task by Unito

@lawrence-forooghian lawrence-forooghian added the testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them. label Dec 12, 2024
lawrence-forooghian added a commit that referenced this issue Dec 12, 2024
We were not serializing or deserializing the Chat SDK’s Metadata and
Headers types. This was a mistake in 8b6e56a.

I was surprised to find that there were no existing tests for the
request that ChatAPI makes when you call sendMessage, nor for
DefaultMessages’s handling of messages received over a realtime channel,
which meant that there wasn’t an obvious place to slot in the tests for
the fixes introduced by this commit, nor did the mocks have any support
for writing such tests. I’ve added tests for my fixes but, given my rush
to get this fix done, the changes to the mocks aren’t great. Have
created issue #195 for us come back and write the missing tests and tidy
mine up.

Note that I’ve removed the optionality of Metadata’s values. This
optionality came from 20e7f5f when it was unclear what Metadata would
be. We probably should have removed it in 8b6e56a when we introduced
`null` as a MetadataValue case.

Resolves #193.
@lawrence-forooghian
Copy link
Collaborator Author

Relates to #86

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Includes all kinds of automated tests, the way that we run them and the infrastructure around them.
Development

No branches or pull requests

1 participant