function toAssertCall()

in src/formatter/javascript.ts [82:100]


function toAssertCall(pageAlias: string, action: Action) {
  const { command, selector, value } = action;
  switch (command) {
    case 'textContent':
    case 'innerText':
      return `expect(await ${pageAlias}.${command}(${quote(
        selector ?? ''
      )})).toMatch(${quote(value ?? '')});`;
    case 'isVisible':
    case 'isHidden':
    case 'isChecked':
    case 'isEditable':
    case 'isEnabled':
    case 'isDisabled':
      return `expect(await ${pageAlias}.${command}(${quote(
        selector ?? ''
      )})).toBeTruthy();`;
  }
}