Merge remote-tracking branches 'origin/main_laptop_1', 'origin/sub_laptop_1' and 'origin/sub_laptop_3' into sub_laptop_8
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/* setLink 순수 길(`spreadsheet_link_set.ts`) 시험 진입 — vite --ssr 로 번들해 Node 로 돌림.
|
||||
* 결과 = JSON {pass, fail, failures} 한 줄(`test_spreadsheet_set_link.py` 가 읽음) */
|
||||
import { applyCommand } from "../../../A00_Common/spreadsheet/spreadsheet_commands";
|
||||
import { linkHues } from "../../../A00_Common/spreadsheet/spreadsheet_link_color";
|
||||
import { linkAreaCell, linkCommand } from "../../../A00_Common/spreadsheet/spreadsheet_link_set";
|
||||
import type { Command, Workbook } from "../../../A00_Common/spreadsheet/spreadsheet_types";
|
||||
|
||||
@@ -100,4 +101,27 @@ eq("틀린 주소", linkAreaCell(b, "철근|ton", "9C"), null);
|
||||
eq("풀기 · 시트 넘어", links(linkAreaCell(b, "치기|㎥", null)!), [links(book())[0], null]);
|
||||
eq("바뀔 것 없음 = 사본", JSON.stringify(linkAreaCell(b, "깔기|㎡", "B6")), before);
|
||||
|
||||
// linkHues — 키로 정해짐 · 차례 무관 · 24 개까지 서로 다름 · 12 개까지 30° 바퀴 · 15° 눈금
|
||||
const keys = Array.from({ length: 24 }, (_, i) => `알약${i}|㎡`);
|
||||
const h1 = linkHues(keys);
|
||||
const h2 = linkHues([...keys].reverse());
|
||||
eq("차례 무관", [...h1.entries()].sort(), [...h2.entries()].sort());
|
||||
eq("24 개 서로 다름", new Set(h1.values()).size, 24);
|
||||
eq(
|
||||
"15° 눈금",
|
||||
[...h1.values()].every((h) => h % 15 === 0 && h >= 0 && h < 360),
|
||||
true,
|
||||
);
|
||||
const few = linkHues(keys.slice(0, 12));
|
||||
eq(
|
||||
"12 개 = 30° 바퀴",
|
||||
[...few.values()].every((h) => h % 30 === 0),
|
||||
true,
|
||||
);
|
||||
eq(
|
||||
"같은 키 같은 색",
|
||||
linkHues(["철근|ton", "깔기|㎡"]).get("철근|ton"),
|
||||
linkHues(["철근|ton"]).get("철근|ton"),
|
||||
);
|
||||
|
||||
console.log(JSON.stringify({ pass, fail: failures.length, failures }));
|
||||
|
||||
@@ -55,7 +55,7 @@ def test_setLink_순수_길():
|
||||
assert run.stdout.strip(), run.stderr
|
||||
result = json.loads(run.stdout)
|
||||
assert result["fail"] == 0, result["failures"]
|
||||
assert result["pass"] == 19
|
||||
assert result["pass"] == 24
|
||||
|
||||
|
||||
def test_손잡이_setLink_몸():
|
||||
@@ -66,3 +66,19 @@ def test_손잡이_setLink_몸():
|
||||
assert "linkCommand(ctx.book, ctx.sheet().id, key, cell, info)" in body
|
||||
assert "if (command) dispatch(command);" in body # 되돌리기 이력에 쌓임(setDoc 아님)
|
||||
assert "loadLinks();" in body
|
||||
|
||||
|
||||
def test_알약_끌어_놓기_색():
|
||||
"""40-3 ② ③ — 알약 끌어 칸에 놓기(다른 알약 칸이면 물음) · 이은 알약 · 칸 = 키 색 · 두 테마 밝기."""
|
||||
src = (ROOT / "A00_Common" / "spreadsheet" / "spreadsheet_links.ts").read_text(encoding="utf-8")
|
||||
assert "b.draggable = !ctx.readOnly;" in src and 'addEventListener("drop", onDropEvent)' in src
|
||||
assert "showConfirmDialog(" in src and "link(item, 칸);" in src
|
||||
assert 'if (!b.draggable) b.addEventListener("mousedown"' in src # 끌기 막지 않음
|
||||
assert "const hues = linkHues(found().keys());" in src and 'className: "ss-link-cell"' in src
|
||||
css = (ROOT / "A00_Common" / "spreadsheet" / "spreadsheet_links.css").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
assert (
|
||||
"--ss-link-l: 31%;" in css and css.count("--ss-link-l: 66%;") == 2
|
||||
) # 밝음 · 어두움(설정 · 시스템)
|
||||
assert "ss-link-flash" in css # 반짝임 그대로
|
||||
|
||||
Reference in New Issue
Block a user