Skip to content

Commit 7efbf76

Browse files
committed
fix(interface-tester): fix pages dir resolving
1 parent a20f9bc commit 7efbf76

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/interface-tester/src/nodes.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Children, isValidElement, ReactNode } from 'react'
1+
import { Children, Fragment, isValidElement, ReactNode } from 'react'
22

33
import {
44
CreatePage,
@@ -35,15 +35,15 @@ export const createNode = (value: any): ReactNode[] => {
3535

3636
const props = value.props as any
3737
if (value.type === DataBindingProvider) {
38-
return [<>{props.children}</>]
38+
return [<Fragment key="_">{props.children}</Fragment>]
3939
} else if (value.type === EditPage || value.type === EditScope || value.type === DetailPage || value.type === DetailScope) {
40-
return [<EntitySubTree {...props as any} />]
40+
return [<EntitySubTree key="_" {...props as any} />]
4141
} else if (value.type === CreatePage || value.type === CreateScope) {
42-
return [<EntitySubTree {...props as any} isCreating />]
42+
return [<EntitySubTree key="_" {...props as any} isCreating />]
4343
} else if (value.type === DataGridPage || value.type === DataGrid || value.type === DataGridScope) {
44-
return [<DataGrid {...props as any} />]
44+
return [<DataGrid key="_" {...props as any} />]
4545
} else if (value.type === ListPage || value.type === ListScope || value.type === TablePage || value.type === MultiEditPage || value.type === MultiEditScope) {
46-
return [<EntityListSubTree {...props as any} />]
46+
return [<EntityListSubTree key="_" {...props as any} />]
4747
} else if (value.type === GenericPage || value.type === Symbol.for('react.fragment')) {
4848
return (Array.isArray(props.children) ? props.children : [props.children]).map(createNode).flat()
4949
}

packages/interface-tester/src/tests.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const getTests = async (config: Config): Promise<Test[]> => {
3131
let pageBaseDir
3232
const possibleDirs = config.pagesDir ? [config.pagesDir] : ['pages', 'admin/pages']
3333
for (const candidateDir of possibleDirs) {
34-
const tmpBaseDir = join(process.cwd(), config.pagesDir ?? 'pages')
34+
const tmpBaseDir = join(process.cwd(), candidateDir)
3535
if (await pathExists(tmpBaseDir)) {
3636
pageBaseDir = tmpBaseDir
3737
}

0 commit comments

Comments
 (0)