CI: feature/builder-13-forms-style-sync #7
@@ -19,5 +19,6 @@ blob-report/
|
||||
# Plans (exclude from Git)
|
||||
메인플랜.md
|
||||
최초플랜.md
|
||||
MAIN_PLAN.md
|
||||
|
||||
/src/generated/prisma
|
||||
|
||||
@@ -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",
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user