@@ -49,11 +49,12 @@ const atomicComponent = (
4949
5050 let styledComponentsType = "styled-components" ;
5151 let baseComponent = "div" ;
52+ let testId = "data-testid" ;
5253 let withClassNameClassName = `className={${
5354 IS_FUNCTIONAL ? "" : "this."
5455 } props.className} `;
5556 let withClassNameProps = "interface Props extends PropsWithClassName" ;
56- let withClassNameImport = `import {PropsWithClassName} from " ${ fullConfig . withClassnameInterfaceImportPath } ";\n ` ;
57+ let withClassNameImport = `import {PropsWithClassName} from ' ${ fullConfig . withClassnameInterfaceImportPath } ' ` ;
5758
5859 if ( fullConfig . useMacro ) {
5960 styledComponentsType = "styled-components/macro" ;
@@ -62,14 +63,15 @@ const atomicComponent = (
6263 if ( IS_NATIVE ) {
6364 styledComponentsType = "styled-components/native" ;
6465 baseComponent = "Text" ;
66+ testId = "testID" ;
6567 withClassNameClassName = `style={${
6668 IS_FUNCTIONAL ? "" : "this."
6769 } props.style} `;
6870 withClassNameProps = "interface Props extends PropsWithNativeStyle" ;
69- withClassNameImport = `import {PropsWithNativeStyle} from " ${ fullConfig . withStyleInterfaceImportPath } ";\n ` ;
71+ withClassNameImport = `import {PropsWithNativeStyle} from ' ${ fullConfig . withStyleInterfaceImportPath } ' ` ;
7072 }
7173
72- let styleImport = `\nimport {Root} from './{{pascalCase name}}.styles'; ` ;
74+ let styleImport = `import {Root} from './{{pascalCase name}}.styles'` ;
7375 let templateBaseComponent = "Root" ;
7476
7577 if ( ! WITH_STYLED_COMPONENTS ) {
@@ -81,12 +83,16 @@ const atomicComponent = (
8183 }
8284
8385 data = {
84- templateBaseComponent,
85- withClassNameProps,
86- withClassNameClassName,
86+ styledComponents : fullConfig . styledComponents ,
8787 baseComponent,
8888 styledComponentsType,
89+ templateBaseComponent,
90+ withClassNameClassName,
91+ withClassNameProps,
92+ testId,
8993 } ;
94+
95+ plop . setPartial ( "testId" , testId ) ;
9096 plop . setPartial ( "styleImport" , styleImport ) ;
9197 plop . setPartial ( "withClassNameImport" , withClassNameImport ) ;
9298 plop . setPartial ( "withClassNameClassName" , withClassNameClassName ) ;
0 commit comments