Removed the unused IndicatorTests
This commit is contained in:
parent
8192aecee6
commit
84e792704b
|
@ -15,19 +15,16 @@
|
|||
320CDC3222FADB45007CF858 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 320CDC3122FADB45007CF858 /* Assets.xcassets */; };
|
||||
320CDC3522FADB45007CF858 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 320CDC3422FADB45007CF858 /* Preview Assets.xcassets */; };
|
||||
320CDC3822FADB45007CF858 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 320CDC3622FADB45007CF858 /* LaunchScreen.storyboard */; };
|
||||
322E0DF728D331A20003A55F /* IndicatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF028D331A20003A55F /* IndicatorTests.swift */; };
|
||||
322E0DF828D331A20003A55F /* WebImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF128D331A20003A55F /* WebImageTests.swift */; };
|
||||
322E0DF928D331A20003A55F /* Images.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 322E0DF228D331A20003A55F /* Images.bundle */; };
|
||||
322E0DFA28D331A20003A55F /* ImageManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF328D331A20003A55F /* ImageManagerTests.swift */; };
|
||||
322E0DFB28D331A20003A55F /* AnimatedImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF428D331A20003A55F /* AnimatedImageTests.swift */; };
|
||||
322E0DFD28D331A20003A55F /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF628D331A20003A55F /* TestUtils.swift */; };
|
||||
322E0E1828D3320D0003A55F /* ImageManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF328D331A20003A55F /* ImageManagerTests.swift */; };
|
||||
322E0E1928D3320D0003A55F /* IndicatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF028D331A20003A55F /* IndicatorTests.swift */; };
|
||||
322E0E1A28D3320D0003A55F /* WebImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF128D331A20003A55F /* WebImageTests.swift */; };
|
||||
322E0E1B28D3320D0003A55F /* AnimatedImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF428D331A20003A55F /* AnimatedImageTests.swift */; };
|
||||
322E0E1C28D3320D0003A55F /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF628D331A20003A55F /* TestUtils.swift */; };
|
||||
322E0E1D28D3320D0003A55F /* ImageManagerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF328D331A20003A55F /* ImageManagerTests.swift */; };
|
||||
322E0E1E28D3320D0003A55F /* IndicatorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF028D331A20003A55F /* IndicatorTests.swift */; };
|
||||
322E0E1F28D3320D0003A55F /* WebImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF128D331A20003A55F /* WebImageTests.swift */; };
|
||||
322E0E2028D3320D0003A55F /* AnimatedImageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF428D331A20003A55F /* AnimatedImageTests.swift */; };
|
||||
322E0E2128D3320D0003A55F /* TestUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 322E0DF628D331A20003A55F /* TestUtils.swift */; };
|
||||
|
@ -142,7 +139,6 @@
|
|||
320CDC3722FADB45007CF858 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||
320CDC3922FADB45007CF858 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
322E0DE628D3318B0003A55F /* SDWebImageSwiftUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDWebImageSwiftUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
322E0DF028D331A20003A55F /* IndicatorTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IndicatorTests.swift; sourceTree = "<group>"; };
|
||||
322E0DF128D331A20003A55F /* WebImageTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WebImageTests.swift; sourceTree = "<group>"; };
|
||||
322E0DF228D331A20003A55F /* Images.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Images.bundle; sourceTree = "<group>"; };
|
||||
322E0DF328D331A20003A55F /* ImageManagerTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageManagerTests.swift; sourceTree = "<group>"; };
|
||||
|
@ -323,7 +319,6 @@
|
|||
322E0DEF28D331A20003A55F /* Tests */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
322E0DF028D331A20003A55F /* IndicatorTests.swift */,
|
||||
322E0DF128D331A20003A55F /* WebImageTests.swift */,
|
||||
322E0DF228D331A20003A55F /* Images.bundle */,
|
||||
322E0DF328D331A20003A55F /* ImageManagerTests.swift */,
|
||||
|
@ -1159,7 +1154,6 @@
|
|||
322E0DF828D331A20003A55F /* WebImageTests.swift in Sources */,
|
||||
322E0DFD28D331A20003A55F /* TestUtils.swift in Sources */,
|
||||
322E0DFB28D331A20003A55F /* AnimatedImageTests.swift in Sources */,
|
||||
322E0DF728D331A20003A55F /* IndicatorTests.swift in Sources */,
|
||||
322E0DFA28D331A20003A55F /* ImageManagerTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
|
@ -1172,7 +1166,6 @@
|
|||
322E0E1A28D3320D0003A55F /* WebImageTests.swift in Sources */,
|
||||
322E0E1828D3320D0003A55F /* ImageManagerTests.swift in Sources */,
|
||||
322E0E1C28D3320D0003A55F /* TestUtils.swift in Sources */,
|
||||
322E0E1928D3320D0003A55F /* IndicatorTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1184,7 +1177,6 @@
|
|||
322E0E1F28D3320D0003A55F /* WebImageTests.swift in Sources */,
|
||||
322E0E1D28D3320D0003A55F /* ImageManagerTests.swift in Sources */,
|
||||
322E0E2128D3320D0003A55F /* TestUtils.swift in Sources */,
|
||||
322E0E1E28D3320D0003A55F /* IndicatorTests.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -1,84 +0,0 @@
|
|||
import XCTest
|
||||
import SwiftUI
|
||||
import ViewInspector
|
||||
@testable import SDWebImageSwiftUI
|
||||
|
||||
extension ActivityIndicator : Inspectable {}
|
||||
extension ProgressIndicator : Inspectable {}
|
||||
|
||||
#if os(iOS) || os(tvOS)
|
||||
typealias ActivityIndicatorViewType = UIActivityIndicatorView
|
||||
typealias ProgressIndicatorViewType = UIProgressView
|
||||
#else
|
||||
typealias ActivityIndicatorViewType = NSProgressIndicator
|
||||
typealias ProgressIndicatorViewType = NSProgressIndicator
|
||||
#endif
|
||||
|
||||
class IndicatorTests: XCTestCase {
|
||||
|
||||
override func setUp() {
|
||||
super.setUp()
|
||||
// Put setup code here. This method is called before the invocation of each test method in the class.
|
||||
}
|
||||
|
||||
override func tearDown() {
|
||||
// Put teardown code here. This method is called after the invocation of each test method in the class.
|
||||
super.tearDown()
|
||||
SDImageCache.shared.clear(with: .all)
|
||||
}
|
||||
|
||||
func testActivityIndicator() throws {
|
||||
let expectation = self.expectation(description: "Activity indicator")
|
||||
let binding = Binding<Bool>(wrappedValue: true)
|
||||
let indicator = ActivityIndicator(binding, style: .medium)
|
||||
ViewHosting.host(view: indicator)
|
||||
let indicatorView = try indicator.inspect().actualView().platformView()
|
||||
#if os(iOS) || os(tvOS)
|
||||
XCTAssertTrue(indicatorView.isAnimating)
|
||||
#endif
|
||||
binding.wrappedValue = false
|
||||
XCTAssertFalse(binding.wrappedValue)
|
||||
XCTAssertFalse(indicator.isAnimating)
|
||||
#if os(iOS) || os(tvOS)
|
||||
indicatorView.stopAnimating()
|
||||
#else
|
||||
indicatorView.stopAnimation(nil)
|
||||
#endif
|
||||
#if os(iOS) || os(tvOS)
|
||||
XCTAssertFalse(indicatorView.isAnimating)
|
||||
#endif
|
||||
expectation.fulfill()
|
||||
self.waitForExpectations(timeout: 5, handler: nil)
|
||||
ViewHosting.expel()
|
||||
}
|
||||
|
||||
func testProgressIndicator() throws {
|
||||
let expectation = self.expectation(description: "Progress indicator")
|
||||
let binding = Binding<Bool>(wrappedValue: true)
|
||||
let progress = Binding<Double>(wrappedValue: 0)
|
||||
let indicator = ProgressIndicator(binding, progress: progress)
|
||||
ViewHosting.host(view: indicator)
|
||||
let indicatorView = try indicator.inspect().actualView().platformView().wrapped
|
||||
#if os(iOS) || os(tvOS)
|
||||
XCTAssertEqual(indicatorView.progress, 0.0)
|
||||
#else
|
||||
XCTAssertEqual(indicatorView.doubleValue, 0.0)
|
||||
#endif
|
||||
progress.wrappedValue = 1.0
|
||||
XCTAssertEqual(indicator.progress, 1.0)
|
||||
#if os(iOS) || os(tvOS)
|
||||
indicatorView.setProgress(1.0, animated: true)
|
||||
#else
|
||||
indicatorView.increment(by: 1.0)
|
||||
#endif
|
||||
#if os(iOS) || os(tvOS)
|
||||
XCTAssertEqual(indicatorView.progress, 1.0)
|
||||
#else
|
||||
XCTAssertEqual(indicatorView.doubleValue, 1.0)
|
||||
#endif
|
||||
expectation.fulfill()
|
||||
self.waitForExpectations(timeout: 5, handler: nil)
|
||||
ViewHosting.expel()
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue