Skip to content

Commit

Permalink
Add test for issue 1923
Browse files Browse the repository at this point in the history
  • Loading branch information
onevcat committed May 8, 2022
1 parent 61f9dba commit 2feff08
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Tests/KingfisherTests/ImageViewExtensionTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,27 @@ class ImageViewExtensionTests: XCTestCase {
waitForExpectations(timeout: 3, handler: nil)
}

// https://github.com/onevcat/Kingfisher/issues/1923
func testLoadGIFImageWithDifferentOptions() {
let exp = expectation(description: #function)
let url = testURLs[0]
stub(url, data: testImageGIFData)

imageView.kf.setImage(with: url) { result in
let fullImage = result.value?.image
XCTAssertNotNil(fullImage)
XCTAssertEqual(fullImage?.images?.count, 8)

self.imageView.kf.setImage(with: url, options: [.onlyLoadFirstFrame]) { result in
let firstFrameImage = result.value?.image
XCTAssertNotNil(firstFrameImage)
XCTAssertNil(firstFrameImage?.images)
exp.fulfill()
}
}
waitForExpectations(timeout: 3)
}

// https://github.com/onevcat/Kingfisher/issues/665
// The completion handler should be called even when the image view loading url gets changed.
func testIssue665() {
Expand Down

0 comments on commit 2feff08

Please sign in to comment.