diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6199e3b..4a1f2a4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Select Xcode version - run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer' + run: sudo xcode-select -s '/Applications/Xcode.app/Contents/Developer' # - name: Pod lib lint # run: pod lib lint --allow-warnings - name: Build project diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 960de7f..f80cb60 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Select Xcode version - run: sudo xcode-select -s '/Applications/Xcode_14.2.app/Contents/Developer' + run: sudo xcode-select -s '/Applications/Xcode.app/Contents/Developer' - name: Push to Cocoapods env: COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }} diff --git a/Sources/Mailosaur/Models/MessageModels.swift b/Sources/Mailosaur/Models/MessageModels.swift index dddbaf2..9e0a7ef 100644 --- a/Sources/Mailosaur/Models/MessageModels.swift +++ b/Sources/Mailosaur/Models/MessageModels.swift @@ -37,9 +37,9 @@ public struct Message: Decodable { public struct MessageAddress: Decodable { /// Gets or sets display name, if one is specified. - public let name: String + public let name: String? /// Gets or sets email address (applicable to email messages). - public let email: String + public let email: String? /// Gets or sets phone number (applicable to SMS messages). public let phone: String? } diff --git a/Tests/MailosaurTests/EmailsTests.swift b/Tests/MailosaurTests/EmailsTests.swift index 3650649..5843d6b 100644 --- a/Tests/MailosaurTests/EmailsTests.swift +++ b/Tests/MailosaurTests/EmailsTests.swift @@ -327,10 +327,10 @@ final class EmailsTests: XCTestCase { XCTAssertEqual("Email", email.type) XCTAssertEqual(1, email.from.count) XCTAssertEqual(1, email.to.count) - XCTAssertTrue(email.from[0].email.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) - XCTAssertTrue(email.from[0].name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) - XCTAssertTrue(email.to[0].email.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) - XCTAssertTrue(email.to[0].name.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) + XCTAssertTrue(email.from[0].email?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) + XCTAssertTrue(email.from[0].name?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) + XCTAssertTrue(email.to[0].email?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) + XCTAssertTrue(email.to[0].name?.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) XCTAssertTrue(email.subject.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty == false) XCTAssertLessThanOrEqual(Date.now.timeIntervalSince(email.received) / 3600, 1) }