const ruleTester = require("../../ruletester");
import * as rule from "./expandableSection-remove-isActive-prop";
ruleTester.run("expandableSection-remove-isActive-prop", rule, {
valid: [
{
code: ``,
},
{
code: `import { ExpandableSection } from '@patternfly/react-core'; `,
},
],
invalid: [
// importing from react-core
{
code: `import { ExpandableSection } from '@patternfly/react-core'; `,
output: `import { ExpandableSection } from '@patternfly/react-core'; `,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/dynamic
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/dynamic/components/ExpandableSection'; `,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/dynamic/components/ExpandableSection'; `,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/esm
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/esm/components/ExpandableSection'; `,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/esm/components/ExpandableSection'; `,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
// importing from dist/js
{
code: `import { ExpandableSection } from '@patternfly/react-core/dist/js/components/ExpandableSection'; `,
output: `import { ExpandableSection } from '@patternfly/react-core/dist/js/components/ExpandableSection'; `,
errors: [
{
message: `The \`isActive\` prop has been removed from ExpandableSection.`,
type: "JSXOpeningElement",
},
],
},
],
});