Skip to content

Commit

Permalink
Merge branch '0.7.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Naumov committed May 24, 2021
2 parents 23bb186 + 6e73dbe commit c238f8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Sources/ViewInspector/SwiftUI/ActionSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ extension ViewType.ActionSheet: SupplementaryChildren {
return try InspectableView<ViewType.Text>(
content, parent: parent, call: "title()")
case 1:
let view = try Inspector.attribute(path: "sheet|message", value: parent.content.view, type: Text?.self)
guard let view = view else {
let maybeView = try Inspector.attribute(
path: "sheet|message", value: parent.content.view, type: Text?.self)
guard let view = maybeView else {
throw InspectionError.viewNotFound(parent: "message")
}
let content = try Inspector.unwrap(content: Content(view, medium: medium))
Expand Down
9 changes: 5 additions & 4 deletions Sources/ViewInspector/SwiftUI/Alert.swift
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ extension ViewType.Alert: SupplementaryChildren {
return try InspectableView<ViewType.Text>(
content, parent: parent, call: "title()")
case 1:
let view = try Inspector.attribute(path: "alert|message", value: parent.content.view, type: Text?.self)
guard let view = view else {
let maybeView = try Inspector.attribute(
path: "alert|message", value: parent.content.view, type: Text?.self)
guard let view = maybeView else {
throw InspectionError.viewNotFound(parent: "message")
}
let content = try Inspector.unwrap(content: Content(view, medium: medium))
Expand All @@ -133,9 +134,9 @@ extension ViewType.Alert: SupplementaryChildren {
return try InspectableView<ViewType.AlertButton>(
content, parent: parent, call: "primaryButton()")
default:
let view = try Inspector.attribute(
let maybeView = try Inspector.attribute(
path: "alert|secondaryButton", value: parent.content.view, type: Alert.Button?.self)
guard let view = view else {
guard let view = maybeView else {
throw InspectionError.viewNotFound(parent: "secondaryButton")
}
let content = try Inspector.unwrap(content: Content(view, medium: medium))
Expand Down
2 changes: 1 addition & 1 deletion ViewInspector.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pod::Spec.new do |s|

s.name = "ViewInspector"
s.version = "0.7.6"
s.version = "0.7.7"
s.summary = "ViewInspector is a library for unit testing SwiftUI views."
s.homepage = "https://github.com/nalexn/ViewInspector"
s.license = { :type => "MIT", :file => "LICENSE" }
Expand Down

0 comments on commit c238f8b

Please sign in to comment.