Fix the test case `testWebImageEXIFImage`

This commit is contained in:
DreamPiggy 2021-02-24 17:28:25 +08:00
parent 09c55243c2
commit 78a2769b06
1 changed files with 9 additions and 4 deletions

View File

@ -162,10 +162,15 @@ class WebImageTests: XCTestCase {
let displayImage = try? imageView.inspect().group().image(0).nsImage()
XCTAssertNotNil(displayImage)
#else
let displayImage = try? imageView.inspect().group().image(0).cgImage()
let orientation = try! imageView.inspect().group().image(0).orientation()
XCTAssertNotNil(displayImage)
XCTAssertEqual(orientation, .leftMirrored)
if #available(iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
let displayImage = try? imageView.inspect().group().image(0).uiImage()
XCTAssertEqual(displayImage, image)
} else {
let displayImage = try? imageView.inspect().group().image(0).cgImage()
let orientation = try? imageView.inspect().group().image(0).orientation()
XCTAssertNotNil(displayImage)
XCTAssertEqual(orientation, .leftMirrored)
}
#endif
expectation.fulfill()
}.onFailure { error in