-
Notifications
You must be signed in to change notification settings - Fork 0
Add more integration tests #36
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
1c01953
to
dd416c4
Compare
ea97e0a
to
b6021e7
Compare
let firstPageResponse = try await chat.getChannels(filter: "id LIKE 'swift-chat*'", limit: 2) | ||
let secondPageResponse = try await chat.getChannels(filter: "id LIKE 'swift-chat*'", page: firstPageResponse.page) | ||
|
||
XCTAssertTrue(firstPageResponse.channels.count == 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clearer failures wouldn't
XCTAssertEqual(count, 2)
be better choice ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will change it
@@ -221,6 +260,30 @@ class ChatAsyncIntegrationTests: BaseAsyncIntegrationTestCase { | |||
} | |||
} | |||
|
|||
func testChatAsync_GetChannelsWithPagination() async throws { | |||
let channel1 = try await chat.createChannel(id: randomString(), name: "Channel1") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't channel ids have prefix "swift-chat"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The randomString()
has an optional withPrefix:
argument (default: true) that prepends swift-chat
. There's no need to pass it explicitly unless overriding the default. I will extract swift-chat
as a constant to not to repeat it in many places
Tests/ChatIntegrationTests.swift
Outdated
|
||
let firstPageResponse = try awaitResultValue { | ||
chat.getChannels( | ||
filter: "id LIKE 'swift-chat*'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do channel ids contains "swift-chat" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it contains swift-chat
prefix
No description provided.