Fix wrapper
This commit is contained in:
@ -68,10 +68,29 @@ describe("merges with existing className attribute", () => {
|
||||
|
||||
const clsName = getClassName("text-center");
|
||||
expect(files.js.text).toContain(
|
||||
`import { composeRenderProps as _composeRenderProps } from "react-aria-component";`
|
||||
`{ ...props, className: typeof _className === "function" ? (...args) => _cx("${clsName}", _className(...args)) : _cx("${clsName}", _className),`
|
||||
);
|
||||
});
|
||||
|
||||
it("supports composeRenderProps (2)", async () => {
|
||||
const { files } = await compileESBuild({
|
||||
clsx: "clsx",
|
||||
expectFiles: 2,
|
||||
composeRenderProps: true,
|
||||
javascript: /* tsx */ `
|
||||
export function Hello({ className, ...props }) {
|
||||
return (
|
||||
<div className={className} css="text-center">
|
||||
<span {...props}>Hello, world!</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
`,
|
||||
});
|
||||
|
||||
const clsName = getClassName("text-center");
|
||||
expect(files.js.text).toContain(
|
||||
`...props, className: _composeRenderProps(_className, (n) => _cx("${clsName}", n)),`
|
||||
`{ className: typeof className === "function" ? (...args) => _cx("${clsName}", className(...args)) : _cx("${clsName}", className),`
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -52,7 +52,7 @@ export function getBuild(name: string) {
|
||||
external: [
|
||||
"react",
|
||||
"react/jsx-runtime",
|
||||
"react-aria-component",
|
||||
"react-aria-components",
|
||||
"@emotion/css",
|
||||
"clsx",
|
||||
"tslib",
|
||||
|
Reference in New Issue
Block a user