Skip to content

Commit

Permalink
clean test
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazar Otasevic committed Sep 9, 2024
1 parent 740c72a commit d4d7019
Showing 1 changed file with 2 additions and 50 deletions.
52 changes: 2 additions & 50 deletions Tests/ViewInspectionTests/StaticViewElementsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,10 @@ final class StaticViewElementsTests: XCTestCase {}

@MainActor extension StaticViewElementsTests {
func test_Text() throws {
XCTAssertEqual(
try Text("a").snap.one(.text).string,
"a"
)
XCTAssertEqual(try Text("a").snap.one(.text).string, "a")
}

func test_Image() throws {
let ref = try Image(systemName: "circle").snap.one(.image)
XCTAssertEqual(try ref.name, "circle")
}

@available(iOS 16.0, macOS 13.0, tvOS 16.0, watchOS 9.0, *)
func test_NavigationStack() throws {
XCTAssertEqual(
try NavigationStack { Text("a") }
.snap
.one(.navigationStack)
.node
.one(.text)
.string,
"a"
)
}

func test_GeometryReader() {
XCTAssertEqual(
GeometryReader { _ in }
.snap
.all(.geometryReader)
.count,
1
)
}

func test_ForEach() {
XCTAssertEqual(
ForEach(Array(0 ... 1), id: \.self) {
Text($0.description)
}
.snap
.all(.forEach)
.count,
2
)
XCTAssertEqual(
ForEach(Array(0 ... 1), id: \.self) {
Text($0.description)
}
.snap
.all(.text)
.count,
0
)
XCTAssertEqual(try Image(systemName: "circle").snap.one(.image).name, "circle")
}
}

0 comments on commit d4d7019

Please sign in to comment.