Skip to content

Commit

Permalink
potential test
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer committed Feb 1, 2024
1 parent ec8192b commit 1967934
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions Tests/XMTPTests/CodecTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,33 @@ class CodecTests: XCTestCase {
XCTAssertEqual(nil, content)
XCTAssertEqual("pi", messages[0].fallbackContent)
}

func testCanGetPushInfoBeforeDecoded() async throws {
let fixtures = await fixtures()

let aliceClient = fixtures.aliceClient!
let aliceConversation = try await aliceClient.conversations.newConversation(with: fixtures.bob.address)

aliceClient.register(codec: NumberCodec())

try await aliceConversation.send(content: 3.14, options: .init(contentType: NumberCodec().contentType))

let messages = try await aliceConversation.messages()
XCTAssertEqual(messages.count, 1)

let message = try await MessageV2.encode(
client: aliceClient,
content: messages[0].encodedContent,
topic: aliceConversation.topic,
keyMaterial: Data(aliceConversation.keyMaterial!),
codec: NumberCodec()
)

XCTAssertEqual(false, message.shouldPush)
XCTAssert(!message.senderHmac.isEmpty)

}


func testCompositeCodecOnePart() async throws {
let fixtures = await fixtures()
Expand Down

0 comments on commit 1967934

Please sign in to comment.