Skip to content

Conversation

jguz-pubnub
Copy link
Contributor

No description provided.

@pubnub-ops-terraform
Copy link
Contributor

pubnub-ops-terraform commented Sep 9, 2025

🎉 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)

@jguz-pubnub jguz-pubnub force-pushed the feat/test-improvements branch from 1c01953 to dd416c4 Compare September 9, 2025 14:37
@jguz-pubnub jguz-pubnub force-pushed the feat/test-improvements branch from ea97e0a to b6021e7 Compare September 9, 2025 16:33
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)

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 ?

Copy link
Contributor Author

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")

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"?

Copy link
Contributor Author

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


let firstPageResponse = try awaitResultValue {
chat.getChannels(
filter: "id LIKE 'swift-chat*'",

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" ?

Copy link
Contributor Author

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

@jguz-pubnub jguz-pubnub merged commit be4a2cb into master Sep 15, 2025
8 checks passed
@jguz-pubnub jguz-pubnub deleted the feat/test-improvements branch September 15, 2025 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants