const ruleTester = require("../../ruletester");
import * as rule from "./wizardStep-updated-body-typing";
ruleTester.run("wizardStep-updated-body-typing", rule, {
valid: [
{
code: ``,
},
{
code: `import { WizardStep } from '@patternfly/react-core'; `,
},
{
code: `import { WizardStep } from '@patternfly/react-core'; `,
},
],
invalid: [
{
code: `import { WizardStep } from '@patternfly/react-core'; `,
output: `import { WizardStep } from '@patternfly/react-core'; `,
errors: [
{
message: `The \`body\` prop on WizardStep no longer accepts a value of "null".`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { WizardStep } from '@patternfly/react-core'; const bodyProp = null; `,
output: `import { WizardStep } from '@patternfly/react-core'; const bodyProp = null; `,
errors: [
{
message: `The \`body\` prop on WizardStep no longer accepts a value of "null".`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { WizardStep } from '@patternfly/react-core/dist/esm/components/Wizard/index.js'; `,
output: `import { WizardStep } from '@patternfly/react-core/dist/esm/components/Wizard/index.js'; `,
errors: [
{
message: `The \`body\` prop on WizardStep no longer accepts a value of "null".`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { WizardStep } from '@patternfly/react-core/dist/js/components/Wizard/index.js'; `,
output: `import { WizardStep } from '@patternfly/react-core/dist/js/components/Wizard/index.js'; `,
errors: [
{
message: `The \`body\` prop on WizardStep no longer accepts a value of "null".`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { WizardStep } from '@patternfly/react-core/dist/dynamic/components/Wizard/index.js'; `,
output: `import { WizardStep } from '@patternfly/react-core/dist/dynamic/components/Wizard/index.js'; `,
errors: [
{
message: `The \`body\` prop on WizardStep no longer accepts a value of "null".`,
type: "JSXOpeningElement",
},
],
},
],
});