const ruleTester = require("../../ruletester");
import * as rule from "./Th-Td-warn-update-markup";
ruleTester.run("Th-Td-warn-update-markup", rule, {
valid: [
{
code: `
| `,
},
{
code: ` | `,
},
{
code: `import { Th } from '@patternfly/react-table'; | `,
},
{
code: `import { Td } from '@patternfly/react-table'; | `,
},
],
invalid: [
{
code: `import { Th } from '@patternfly/react-table'; | `,
output: `import { Th } from '@patternfly/react-table'; | `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { Th as CustomTh } from '@patternfly/react-table'; `,
output: `import { Th as CustomTh } from '@patternfly/react-table'; `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { Td } from '@patternfly/react-table'; | `,
output: `import { Td } from '@patternfly/react-table'; | `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { Th } from '@patternfly/react-table/dist/esm/components/Table/index.js'; | `,
output: `import { Th } from '@patternfly/react-table/dist/esm/components/Table/index.js'; | `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { Th } from '@patternfly/react-table/dist/js/components/Table/index.js'; | `,
output: `import { Th } from '@patternfly/react-table/dist/js/components/Table/index.js'; | `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
{
code: `import { Th } from '@patternfly/react-table/dist/dynamic/components/Table/index.js'; | `,
output: `import { Th } from '@patternfly/react-table/dist/dynamic/components/Table/index.js'; | `,
errors: [
{
message: `The \`--pf-v6-c-table__sticky-cell--Left\` and \`--pf-v6-c-table__sticky-cell--Right\` CSS variables applied as inline styles have been updated to \`--pf-v6-c-table__sticky-cell--InsetInlineStart\` and \`--pf-v6-c-table__sticky-cell--InsetInlineEnd\`, respectively.`,
type: "JSXOpeningElement",
},
],
},
],
});