오류 수정
CI / test (push) Successful in 10m58s
CI / pr_and_merge (push) Successful in 1m48s
CI / test (pull_request) Failing after 44m48s
CI / pr_and_merge (pull_request) Has been skipped

This commit is contained in:
2025-11-21 17:12:54 +09:00
parent 9266d8b874
commit d423aedcbe
2 changed files with 6 additions and 21 deletions
+5 -21
View File
@@ -1,6 +1,7 @@
import { describe, it, expect } from "vitest";
import {
createEditorStore,
buildItemsTreeFromItems,
flattenItemsTreeToItems,
indentListItem,
itemsTreeToLines,
@@ -399,23 +400,6 @@ describe("editorStore", () => {
]);
});
describe("parseTextareaToLines / stringifyLinesToTextarea", () => {
it("단순 텍스트를 ListLine 배열로 파싱하고 다시 문자열로 직렬화할 수 있다", () => {
const input = "a\nb\nc";
const lines = parseTextareaToLines(input);
expect(lines).toEqual<ReadonlyArray<ListLine>>([
{ depth: 0, text: "a" },
{ depth: 0, text: "b" },
{ depth: 0, text: "c" },
]);
"B-1-a",
"공백 들여쓰기도 depth 로 인정",
]);
expect(lines.map((l) => l.depth)).toEqual([0, 1, 1, 0, 1, 2, 1]);
});
it("ListLine 배열을 textarea 에 쓸 수 있는 문자열로 직렬화할 수 있어야 한다", () => {
const lines: ListLine[] = [
{ depth: 0, text: "A" },
@@ -431,11 +415,11 @@ describe("editorStore", () => {
expect(rows).toEqual([
"A",
"\tA-1",
"\tA-2",
" A-1",
" A-2",
"B",
"\tB-1",
"\t\tB-1-a",
" B-1",
" B-1-a",
]);
});