HomeGuidesReference
Log In

ready

Emitted when an EBT Element’s input field is able to respond to user interactions like keypress, focus, etc.

You can listen for the ready event during integration testing. You can also use the ready event to change the UI when an EBT Element is ready for user interaction.

{
  type: 'ready',
  usecase: 'collect_pin',
  error: null
}

Examples

In these examples, the ForagePinElement is used for a balance check.

Test your integration using the ready event

balanceElement.on('ready', (event) => {
  // element’s input field is ready to receive keypress and focus events

  await page.click(#test-balance-check)
  // mock typing EBT PIN
 });

Hide loading skeleton when a ForagePinElement is able to respond to user interactions

balanceElement.on('ready', (event) => {
  // hide skeleton or loader
  setEbtFormLoading(false)
});