()
| 322 | }); |
| 323 | |
| 324 | const Toggle = () => { |
| 325 | const [ext, setExt] = createSignal(false); |
| 326 | |
| 327 | const doAction = () => { |
| 328 | expect(ext()).toBeTruthy(); |
| 329 | resolve(); |
| 330 | }; |
| 331 | |
| 332 | const [, send] = useActor( |
| 333 | toggleMachine.provide({ |
| 334 | actions: { |
| 335 | doAction |
| 336 | } |
| 337 | }) |
| 338 | ); |
| 339 | |
| 340 | return ( |
| 341 | <div> |
| 342 | <button |
| 343 | data-testid="extbutton" |
| 344 | onclick={(_) => { |
| 345 | setExt(true); |
| 346 | }} |
| 347 | /> |
| 348 | <button |
| 349 | data-testid="button" |
| 350 | onclick={(_) => { |
| 351 | send({ type: 'TOGGLE' }); |
| 352 | }} |
| 353 | /> |
| 354 | </div> |
| 355 | ); |
| 356 | }; |
| 357 | |
| 358 | render(() => <Toggle />); |
| 359 |