UNPKG

react-unit-test-generator

Version:

react-unit-test-generator is a helper for writing unit tests for React apps. Its main goal is to automatically generate a suite of the most common test cases for a given component.

32 lines (27 loc) 947 B
export function noIdentifierSpecified(element) { const label = element.label || element.text; process.TEST_GENERATOR_WARNINGS.push({ element, failureMessage: 'No identifier specified', title: `Attempt to test the click event for the "${label}" ${element.type}`, }); } export function noFormIdentifierSpecified() { process.TEST_GENERATOR_WARNINGS.push({ failureMessage: 'No identifier specified', title: `Attempt to test the form functionallity`, }); } export function noFieldIdentifier() { process.TEST_GENERATOR_WARNINGS.push({ failureMessage: 'No identifier specified', title: `Attempt to populate a required form field`, }); } export function noInlineMethods(element) { process.TEST_GENERATOR_WARNINGS.push({ element, failureMessage: 'Inline onClick declarations are not supported', title: `Attempt to test the "${element.label}" button click`, }); }