Skip to content

Commit 1c0a528

Browse files
committed
add src/open
1 parent 0990567 commit 1c0a528

22 files changed

+900
-271
lines changed

.gitignore

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ gitlab-ui
99
/src/demo.js
1010
/src/demo.html
1111

12-
/npm-publish
12+
/npm-publish
13+
14+
/src/open/build
15+
/src/open/npm-publish

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,7 @@ Check [documentation](./doc/) for more details.
112112
# Work in progress
113113

114114
Work still in progress, currently the default golang coverage visualizer is implemented.
115+
116+
# Code Guidelines
117+
1. no default export
118+
2. prefer verbose syntax instead of one-liner code

bun.lockb

0 Bytes
Binary file not shown.

src/mock-editor/TestingExplorer/TestingList/TestingListDemo.tsx

+16-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import TestingList, { TestingAPI } from "./index";
2+
import { TestingList, Options, TestingAPI } from "./index";
33
import { ItemPath } from "../../List";
44
import { RunStatus } from "../testing";
55
import { TestingItem } from "../testing-api";
@@ -10,19 +10,25 @@ function randList<T>(list: T[]): T {
1010
}
1111

1212
export const demoAPI: TestingAPI = {
13-
delete: function (item: TestingItem, path: ItemPath): Promise<void> {
13+
delete: function (item: TestingItem, opts: Options): Promise<void> {
1414
throw new Error("Function not implemented.");
1515
},
16-
run: function (item: TestingItem, path: ItemPath): Promise<RunStatus> {
16+
run: function (item: TestingItem, opts: Options): Promise<RunStatus> {
1717
// the API can be designed to have rate limit
1818
return new Promise((resolve) => {
1919
setTimeout(() => resolve(randList(["success", /* "fail", "error", "skip" */] as RunStatus[])), (1 + Math.random() * 3) * 1000)
2020
})
2121
},
22-
duplicate: function (item: TestingItem, path: ItemPath): Promise<void> {
22+
duplicate: function (item: TestingItem, opts: Options): Promise<void> {
2323
throw new Error("Function not implemented.");
2424
},
25-
add: async function (item: TestingItem, path: ItemPath): Promise<void> {
25+
add: async function (item: TestingItem, opts: Options): Promise<void> {
26+
27+
},
28+
addFolder: async function (item: TestingItem, opts: Options): Promise<void> {
29+
30+
},
31+
delFolder: async function (item: TestingItem, opts: Options): Promise<void> {
2632

2733
}
2834
}
@@ -38,6 +44,7 @@ function newArray(n) {
3844
export default function () {
3945
return <TestingList
4046
data={demoData}
47+
showEditActions={false}
4148
style={{
4249
width: "400px",
4350
minHeight: "600px",
@@ -67,6 +74,10 @@ export const demoData: TestingItem[] = [
6774
{
6875
name: "WhatInterface to test?",
6976
kind: "case",
77+
children: [{
78+
name: "sub_case",
79+
kind: "case",
80+
}]
7081
},
7182
...newArray(25).map((e, i): TestingItem => ({
7283
name: `Test_${i}`,

0 commit comments

Comments
 (0)