File tree Expand file tree Collapse file tree
AndroidSwiftUICore/Tests/AndroidSwiftUICoreTests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -317,6 +317,20 @@ struct GraphicsTests {
317317 #expect( firstTextString ( node. children. first ?? node) == " inside " )
318318 }
319319
320+ @Test ( " ComposableView actions register callbacks the factory can invoke " )
321+ func composableViewActions( ) {
322+ var received = 0.0
323+ let host = ViewHost (
324+ ComposableView ( " RatingBar " , actions: [ " onRatingChanged " : . double { received = $0 } ] )
325+ )
326+ let node = host. evaluate ( )
327+ guard case . int( let id) ? = node. props [ " onRatingChanged " ] else {
328+ Issue . record ( " missing action id " ) ; return
329+ }
330+ host. callbacks. invokeDouble ( Int64 ( id) , 4.5 )
331+ #expect( received == 4.5 )
332+ }
333+
320334 @Test ( " Overlay emits base and overlay children with alignment " )
321335 func overlay( ) {
322336 let node = ViewHost ( Color . blue. overlay ( alignment: . bottomTrailing) { Text ( " badge " ) } ) . evaluate ( )
You can’t perform that action at this time.
0 commit comments