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 @@ -291,6 +291,20 @@ struct GraphicsTests {
291291 #expect( firstTextString ( node. children. first ?? node) == " inside " )
292292 }
293293
294+ @Test ( " ComposableView actions register callbacks the factory can invoke " )
295+ func composableViewActions( ) {
296+ var received = 0.0
297+ let host = ViewHost (
298+ ComposableView ( " RatingBar " , actions: [ " onRatingChanged " : . double { received = $0 } ] )
299+ )
300+ let node = host. evaluate ( )
301+ guard case . int( let id) ? = node. props [ " onRatingChanged " ] else {
302+ Issue . record ( " missing action id " ) ; return
303+ }
304+ host. callbacks. invokeDouble ( Int64 ( id) , 4.5 )
305+ #expect( received == 4.5 )
306+ }
307+
294308 @Test ( " Overlay emits base and overlay children with alignment " )
295309 func overlay( ) {
296310 let node = ViewHost ( Color . blue. overlay ( alignment: . bottomTrailing) { Text ( " badge " ) } ) . evaluate ( )
You can’t perform that action at this time.
0 commit comments