Add PromiseKit dependency
- Added PromiseKit dependency
This commit is contained in:
BIN
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Default-568h@2x.png
vendored
Normal file
BIN
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Default-568h@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
12
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Entitlements.plist
vendored
Normal file
12
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/Entitlements.plist
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.private.tcc.allow</key>
|
||||
<array>
|
||||
<string>kTCCServiceAddressBook</string>
|
||||
<string>kTCCServiceCalendar</string>
|
||||
<string>kTCCServicePhotos</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
31
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/TestUIImagePickerController.swift
vendored
Normal file
31
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/TestUIImagePickerController.swift
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
import XCTest
|
||||
|
||||
class UIImagePickerControllerTests: XCTestCase {
|
||||
func test_fulfills_with_data() {
|
||||
let app = XCUIApplication()
|
||||
let tablesQuery = app.tables
|
||||
tablesQuery.staticTexts["1"].tap()
|
||||
tablesQuery.children(matching: .cell).element(boundBy: 1).tap()
|
||||
app.collectionViews.children(matching: .cell).element(boundBy: 0).tap()
|
||||
|
||||
XCTAssertTrue(value)
|
||||
}
|
||||
|
||||
var toggle: XCUIElement {
|
||||
// calling this ensures that any other ViewController has dismissed
|
||||
// as a side-effect since otherwise the switch won't be found
|
||||
return XCUIApplication().tables.switches.element
|
||||
}
|
||||
|
||||
var value: Bool {
|
||||
return (toggle.value as! String) == "1"
|
||||
}
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
continueAfterFailure = false
|
||||
XCUIApplication().launch()
|
||||
XCTAssertFalse(value)
|
||||
}
|
||||
|
||||
}
|
39
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/app.swift
vendored
Normal file
39
Carthage/Checkouts/PromiseKit/Extensions/AssetsLibrary/Tests/app.swift
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
import PMKAssetsLibrary
|
||||
import AssetsLibrary
|
||||
import PromiseKit
|
||||
import UIKit
|
||||
|
||||
@UIApplicationMain
|
||||
class App: UITableViewController, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow? = UIWindow(frame: UIScreen.main.bounds)
|
||||
let testSuceededSwitch = UISwitch()
|
||||
|
||||
func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey : Any]? = nil) -> Bool {
|
||||
window!.rootViewController = self
|
||||
window!.backgroundColor = UIColor.purple
|
||||
window!.makeKeyAndVisible()
|
||||
UIView.setAnimationsEnabled(false)
|
||||
return true
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
view.addSubview(testSuceededSwitch)
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
return 1
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = UITableViewCell()
|
||||
cell.textLabel?.text = "1"
|
||||
return cell
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
|
||||
_ = promise(UIImagePickerController()).done { (data: NSData) in
|
||||
self.testSuceededSwitch.isOn = true
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user