Skip to content

Commit cd1d8ee

Browse files
committed
. d Update markdown snippets
1 parent c21cd6e commit cd1d8ee

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ When using [ViewInspector](https://github.com/nalexn/ViewInspector/) to unit tes
3232
func test_incrementOnce_withBoilerplate() throws {
3333
var sut = ContentView()
3434
let expectation = sut.on(\.viewInspectorHook) { view in
35-
try view.find(viewWithId: "increment").button().tap()
36-
let count = try view.find(viewWithId: "count").text().string()
35+
try view.find(viewWithAccessibilityIdentifier: "increment").button().tap()
36+
let count = try view.find(viewWithAccessibilityIdentifier: "count").text().string()
3737
XCTAssertEqual(count, "1")
3838
}
3939
ViewHosting.host(view: sut)
@@ -82,8 +82,8 @@ Now our test can call `inspectChangingView(_:action:)` like this:
8282
func test_incrementOnce_withTestableView() throws {
8383
var sut = ContentView()
8484
inspectChangingView(&sut) { view in
85-
try view.find(viewWithId: "increment").button().tap()
86-
let count = try view.find(viewWithId: "count").text().string()
85+
try view.find(viewWithAccessibilityIdentifier: "increment").button().tap()
86+
let count = try view.find(viewWithAccessibilityIdentifier: "count").text().string()
8787
XCTAssertEqual(count, "1")
8888
}
8989
}
@@ -108,8 +108,8 @@ func test_incrementOnce_scannable() throws {
108108
var count: String?
109109

110110
inspectChangingView(&sut) { view in
111-
try view.find(viewWithId: "increment").button().tap()
112-
count = try view.find(viewWithId: "count").text().string()
111+
try view.find(viewWithAccessibilityIdentifier: "increment").button().tap()
112+
count = try view.find(viewWithAccessibilityIdentifier: "count").text().string()
113113
}
114114

115115
XCTAssertEqual(count, "1")

0 commit comments

Comments
 (0)