diff --git a/bricks/ui-test/src/custom-processors/__snapshots__/get-tree-data.spec.ts.snap b/bricks/ui-test/src/custom-processors/__snapshots__/get-tree-data.spec.ts.snap index 7b75bd9d5..0a487234a 100644 --- a/bricks/ui-test/src/custom-processors/__snapshots__/get-tree-data.spec.ts.snap +++ b/bricks/ui-test/src/custom-processors/__snapshots__/get-tree-data.spec.ts.snap @@ -20,6 +20,7 @@ exports[`getTreeData should work 1`] = ` "console.log(1323)", ], "parent": { + "flag": "skip", "instanceId": "603a85ccfb595", "label": "should work", "name": "it", @@ -179,6 +180,7 @@ exports[`getTreeData should work 1`] = ` }, ], "parent": { + "flag": "skip", "instanceId": "603a85ccfb595", "label": "should work", "name": "it", @@ -220,7 +222,8 @@ exports[`getTreeData should work 1`] = ` "type": "command", }, ], - "displayLabel": "it: should work", + "displayLabel": "[skip] it: should work", + "flag": "skip", "instanceId": "603a85ccfb595", "isChainChild": false, "label": "should work", @@ -243,7 +246,7 @@ exports[`getTreeData should work 1`] = ` "lib": "fa", }, "key": "603a85ccfb595", - "name": "it: should work", + "name": "[skip] it: should work", }, { "children": [ @@ -318,6 +321,7 @@ exports[`getTreeData should work 1`] = ` "data": { "children": [ { + "flag": "skip", "instanceId": "603a85ccfb595", "label": "should work", "name": "it", diff --git a/bricks/ui-test/src/custom-processors/get-tree-data.spec.ts b/bricks/ui-test/src/custom-processors/get-tree-data.spec.ts index 89aea58d8..bf0e0b438 100644 --- a/bricks/ui-test/src/custom-processors/get-tree-data.spec.ts +++ b/bricks/ui-test/src/custom-processors/get-tree-data.spec.ts @@ -21,6 +21,7 @@ describe("getTreeData", () => { name: "it", params: null, type: "block", + flag: "skip", }, { instanceId: "603ab42f8eae9", diff --git a/bricks/ui-test/src/custom-processors/get-tree-data.ts b/bricks/ui-test/src/custom-processors/get-tree-data.ts index c0b2a963d..73a972bc1 100644 --- a/bricks/ui-test/src/custom-processors/get-tree-data.ts +++ b/bricks/ui-test/src/custom-processors/get-tree-data.ts @@ -21,7 +21,7 @@ export interface GraphData { function getIcon( nodeData: NodeGraphData, - commandDocList: CommandDoc[], + commandDocList: CommandDoc[] ): CommandIcon { let icon: CommandIcon; @@ -85,18 +85,22 @@ function getIcon( } function getDisplayLabel(nodeItem: NodeGraphData): string { + const flag = + nodeItem.flag && nodeItem.flag !== "none" ? `[${nodeItem.flag}] ` : ""; + if (nodeItem.type === "suite") { return nodeItem.name; } if (nodeItem.label) { - return `${nodeItem.name}: ${nodeItem.label}`; + return `${flag}${nodeItem.name}: ${nodeItem.label}`; } const literalParams = getLiteralParams(nodeItem.params); + const nodeLabel = `${flag}${nodeItem.name}`; return literalParams.length === 0 - ? nodeItem.name - : `${nodeItem.name}: ${literalParams.join(", ")}`; + ? nodeLabel + : `${nodeLabel}: ${literalParams.join(", ")}`; } function getLiteralParams(params: unknown[]): unknown[] { @@ -118,7 +122,7 @@ function getLiteralParams(params: unknown[]): unknown[] { export function getTreeData( GraphData: GraphData, - commandDocList: CommandDoc[], + commandDocList: CommandDoc[] ): TestTreeData { const { topic_vertices: [rootData], @@ -129,9 +133,9 @@ export function getTreeData( const getChildVertices = (children: TestTreeData[]) => { return sortBy( vertices.filter((v) => - children.find((c) => c.data.instanceId === v.instanceId), + children.find((c) => c.data.instanceId === v.instanceId) ), - "sort", + "sort" ); }; diff --git a/bricks/ui-test/src/interface.ts b/bricks/ui-test/src/interface.ts index 3b5c129da..d760da477 100644 --- a/bricks/ui-test/src/interface.ts +++ b/bricks/ui-test/src/interface.ts @@ -72,6 +72,7 @@ export interface NodeGraphData { params?: any; type: NodeType; sort?: number; + flag?: string; } export interface TreeNodeItemData extends NodeGraphData {