darabos commited on
Commit
c1aa871
·
1 Parent(s): 502f722

Use non-comment boxes in test.

Browse files
lynxkite-app/web/src/workspace/nodes/NodeWithComment.tsx CHANGED
@@ -6,7 +6,7 @@ import type { UpdateOptions } from "./NodeParameter";
6
  export default function NodeWithComment(props: any) {
7
  const reactFlow = useReactFlow();
8
  const [editing, setEditing] = useState(false);
9
- function setComment(newValue: any, opts?: UpdateOptions) {
10
  reactFlow.updateNodeData(props.id, (prevData: any) => ({
11
  ...prevData,
12
  params: { text: newValue },
@@ -39,7 +39,7 @@ export default function NodeWithComment(props: any) {
39
  return (
40
  <textarea
41
  className="comment-editor"
42
- onBlur={(e) => finishEditing(e.target)}
43
  onKeyDown={onKeyDown}
44
  onInput={(e) => onInput(e.currentTarget)}
45
  ref={(el) => onInput(el)}
 
6
  export default function NodeWithComment(props: any) {
7
  const reactFlow = useReactFlow();
8
  const [editing, setEditing] = useState(false);
9
+ function setComment(newValue: string, opts?: UpdateOptions) {
10
  reactFlow.updateNodeData(props.id, (prevData: any) => ({
11
  ...prevData,
12
  params: { text: newValue },
 
39
  return (
40
  <textarea
41
  className="comment-editor"
42
+ onBlur={(e) => finishEditing(e.currentTarget)}
43
  onKeyDown={onKeyDown}
44
  onInput={(e) => onInput(e.currentTarget)}
45
  ref={(el) => onInput(el)}
lynxkite-app/web/tests/basic.spec.ts CHANGED
@@ -21,7 +21,7 @@ test("Box creation & deletion per env", async () => {
21
  const envs = await workspace.getEnvs();
22
  for (const env of envs) {
23
  await workspace.setEnv(env);
24
- const catalog = await workspace.getCatalog();
25
  expect(catalog).not.toHaveLength(0);
26
  const op = catalog[0];
27
  await workspace.addBox(op);
 
21
  const envs = await workspace.getEnvs();
22
  for (const env of envs) {
23
  await workspace.setEnv(env);
24
+ const catalog = (await workspace.getCatalog()).filter((box) => box !== "Comment");
25
  expect(catalog).not.toHaveLength(0);
26
  const op = catalog[0];
27
  await workspace.addBox(op);