const ruleTester = require("../../ruletester"); import * as rule from "./page-warn-updated-markup"; ruleTester.run("page-warn-updated-markup", rule, { valid: [ { code: ``, }, { code: `import { Page } from '@patternfly/react-core'; `, }, ], invalid: [ { code: `import { Page } from '@patternfly/react-core'; `, output: `import { Page } from '@patternfly/react-core'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page } from '@patternfly/react-core'; `, output: `import { Page } from '@patternfly/react-core'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page } from '@patternfly/react-core'; `, output: `import { Page } from '@patternfly/react-core'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page as CustomThing } from '@patternfly/react-core'; `, output: `import { Page as CustomThing } from '@patternfly/react-core'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page } from '@patternfly/react-core/dist/esm/components/Page/index.js'; `, output: `import { Page } from '@patternfly/react-core/dist/esm/components/Page/index.js'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page } from '@patternfly/react-core/dist/js/components/Page/index.js'; `, output: `import { Page } from '@patternfly/react-core/dist/js/components/Page/index.js'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, { code: `import { Page } from '@patternfly/react-core/dist/dynamic/components/Page/index.js'; `, output: `import { Page } from '@patternfly/react-core/dist/dynamic/components/Page/index.js'; `, errors: [ { message: `The markup for Page has changed. When either the \`horizontalSubnav\` or \`breadcrumb\` props are passed, a PageBody component will always wrap the contents.`, type: "JSXOpeningElement", }, ], }, ], });