오류 수정
This commit is contained in:
@@ -19,5 +19,6 @@ blob-report/
|
|||||||
# Plans (exclude from Git)
|
# Plans (exclude from Git)
|
||||||
메인플랜.md
|
메인플랜.md
|
||||||
최초플랜.md
|
최초플랜.md
|
||||||
|
MAIN_PLAN.md
|
||||||
|
|
||||||
/src/generated/prisma
|
/src/generated/prisma
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
import {
|
import {
|
||||||
createEditorStore,
|
createEditorStore,
|
||||||
|
buildItemsTreeFromItems,
|
||||||
flattenItemsTreeToItems,
|
flattenItemsTreeToItems,
|
||||||
indentListItem,
|
indentListItem,
|
||||||
itemsTreeToLines,
|
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 에 쓸 수 있는 문자열로 직렬화할 수 있어야 한다", () => {
|
it("ListLine 배열을 textarea 에 쓸 수 있는 문자열로 직렬화할 수 있어야 한다", () => {
|
||||||
const lines: ListLine[] = [
|
const lines: ListLine[] = [
|
||||||
{ depth: 0, text: "A" },
|
{ depth: 0, text: "A" },
|
||||||
@@ -431,11 +415,11 @@ describe("editorStore", () => {
|
|||||||
|
|
||||||
expect(rows).toEqual([
|
expect(rows).toEqual([
|
||||||
"A",
|
"A",
|
||||||
"\tA-1",
|
" A-1",
|
||||||
"\tA-2",
|
" A-2",
|
||||||
"B",
|
"B",
|
||||||
"\tB-1",
|
" B-1",
|
||||||
"\t\tB-1-a",
|
" B-1-a",
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user