Skip to content

Commit

Permalink
Add a mock CKShare owned by current user (#18)
Browse files Browse the repository at this point in the history
Canopy test tools previously provided a mock CKShare that was owned by another user, where current user was a regular participant.

This PR adds another mock share that is owned by the current user with two regular participants.

It also adds basic smoke tests to check that these shares are valid and can be unarchived successfully.
  • Loading branch information
jaanus authored Aug 7, 2023
1 parent d7089cd commit bb9ffe2
Show file tree
Hide file tree
Showing 2 changed files with 222 additions and 2 deletions.
19 changes: 19 additions & 0 deletions Targets/Canopy/Tests/MockObjectTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@testable import Canopy
import CanopyTestTools
import CanopyTypes
import CloudKit
import Foundation
import XCTest

/// Test the validity mock objects provided as part of the test tools.
final class MockObjectTests: XCTestCase {
func test_mock_share_owned_by_another_user() {
let share = CKShare.mock
XCTAssertEqual(share.participants.count, 2)
}

func test_mock_share_owned_by_current_user() {
let share = CKShare.mock_owned_by_current_user
XCTAssertEqual(share.participants.count, 3)
}
}
Loading

0 comments on commit bb9ffe2

Please sign in to comment.