     
     @State private(set) var flag: Bool
     let publisher = PassthroughSubject<Bool, Never>()
-    var didReceiveValue: ((Self) -> Void)?
+    let inspection = Inspection<Self>()
     var didAppear: ((Self) -> Void)?
     
     var body: some View {
         Button(action: {
             self.flag.toggle()
         }, label: { Text(flag ? "true" : "false") })
-        .onReceive(publisher) { flag in
-            self.flag = flag
-            self.didReceiveValue?(self)
-        }
+        .onReceive(publisher) { self.flag = $0 }
+        .onReceive(inspection.notice) { self.inspection.visit(self, $0) }
         .onAppear { self.didAppear?(self) }
     }
 }
 
-private struct TestViewWithInspection: View, Inspectable {
-    
-    @State private(set) var flag: Bool
+private struct ObservedStateTestView: View, Inspectable {
+    
+    @ObservedObject var viewModel: ExternalState
+    
+    var body: some View {
+        Text(viewModel.value)
+    }
+}
+
+private struct IncorrectTestView: View, Inspectable {
+    
+    @EnvironmentObject var viewModel: ExternalState
+    
+    var body: some View {
+        EmptyView()
+    }
+}
+
+private struct EnvironmentStateTestView: View, Inspectable {
+    
+    @EnvironmentObject var viewModel: ExternalState
     let inspection = Inspection<Self>()
     
     var body: some View {
-        Button(action: {
-            self.flag.toggle()
-        }, label: { Text(flag ? "true" : "false") })
-        .onReceive(inspection.notice) { self.inspection.visit(self, $0) }
-    }
-}
-
-private struct ObservedStateTestView: View, Inspectable {
-    
-    @ObservedObject var viewModel: ExternalState
-    
-    var body: some View {
         Text(viewModel.value)
-    }
-}
-
-private struct IncorrectTestView: View, Inspectable {
-    
-    @EnvironmentObject var viewModel: ExternalState
-    
-    var body: some View {
-        EmptyView()
-    }
-}
-
-private struct EnvironmentStateTestView: View, Inspectable {
-    
-    @EnvironmentObject var viewModel: ExternalState
-    var didAppear: ((Self) -> Void)?
-    
-    var body: some View {
-        Text(viewModel.value)
-            .onAppear { self.didAppear?(self) }
+            .onReceive(inspection.notice) { self.inspection.visit(self, $0) }
     }
 }
 

    }
    
    func testEnvViewResetsModifiers() throws {
        var sut = EnvironmentStateTestView()
        let exp = sut.on(\.didAppear) { view in
            let sut = try view.inspect().text()
            // There is an inner 1 modifier "onAppear"
            XCTAssertEqual(sut.content.modifiers.count, 1)
        }
        ViewHosting.host(view: sut.environmentObject(ExternalState()).padding())
        wait(for: [exp], timeout: 0.1)

        wait(for: [exp], timeout: 0.1)
    }
    
    func testStateMutationOnPublisherUpdate() throws {
        let sut = LocalStateTestView(flag: false)
        let exp1 = sut.inspection.inspect { view in
            let text = try view.button().text().string()
            XCTAssertEqual(text, "false")
            sut.publisher.send(true)
        }
        let exp2 = sut.inspection.inspect(after: 0.1) { view in
            let text = try view.button().text().string()
            XCTAssertEqual(text, "true")
        }
        ViewHosting.host(view: sut)
        wait(for: [exp1, exp2], timeout: 0.2)
