-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from crelies/dev
Improvements
- Loading branch information
Showing
15 changed files
with
130 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"object": { | ||
"pins": [ | ||
{ | ||
"package": "ViewInspector", | ||
"repositoryURL": "https://github.com/nalexn/ViewInspector.git", | ||
"state": { | ||
"branch": null, | ||
"revision": "ec943ed718cd293b95f17a2b81e8917d6ed70752", | ||
"version": "0.3.8" | ||
} | ||
} | ||
] | ||
}, | ||
"version": 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 0 additions & 17 deletions
17
Sources/RemoteImage/public/Models/PlatformSpecificImageType.swift
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Tests/RemoteImageTests/Extensions/RemoteImage+Inspectable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// | ||
// RemoteImage+Inspectable.swift | ||
// RemoteImageTests | ||
// | ||
// Created by Christian Elies on 22.02.20. | ||
// | ||
|
||
@testable import RemoteImage | ||
import ViewInspector | ||
|
||
extension RemoteImage: Inspectable {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// RemoteImageTests.swift | ||
// RemoteImageTests | ||
// | ||
// Created by Christian Elies on 22.02.20. | ||
// | ||
|
||
#if canImport(UIKit) | ||
@testable import RemoteImage | ||
import SwiftUI | ||
import ViewInspector | ||
import XCTest | ||
|
||
final class RemoteImageTests: XCTestCase { | ||
private let fileManager: FileManager = .default | ||
private lazy var mockImageURL = URL(fileURLWithPath: "\(fileManager.currentDirectoryPath)/mock.jpeg") | ||
private let errorStateViewString = "Error" | ||
private lazy var errorView = Text(errorStateViewString) | ||
private let loadingStateViewString = "Loading ..." | ||
private lazy var loadingView = Text(loadingStateViewString) | ||
|
||
func testLoadingState() { | ||
let view = RemoteImage(type: .url(mockImageURL), | ||
errorView: { _ in self.errorView }, | ||
imageView: { image in image }, | ||
loadingView: { self.loadingView }) | ||
|
||
do { | ||
let inspectableView = try view.body.inspect() | ||
let group = try inspectableView.group().first | ||
let textString = try group?.text().string() | ||
XCTAssertEqual(textString, loadingStateViewString) | ||
} catch { | ||
XCTFail("\(error)") | ||
} | ||
} | ||
} | ||
#endif |