- 지움: M01 LogicLab_Ho · LogicLab_Cover · M02 Sangeun_Cover_Model · Sangeun_Undo · Sangeun_BaseHead · Labor_RowSk - Sangeun_Detail: 숨긴 몸 · 바탕 원값(bare) 셈 · 덮개 고침 · 재료 고름 · 키 글자 약속(SK-000000) 걷음 → 모드 옵션(page · ref · memory) - Sangeun_Tabs: 몸 그릇 · 숨김 걷음 · Sangeun_Cover: 뺀 줄 띠 걷음 · 셈 보기 덧칸 끔(머리 띠는 안 씀) · 머리 띠 타입만 둠(856-2 에서 파일째) - 일위대가 줄 모달: 로직 줄 · 셈 주입 줄 = 안내 한 줄(856-3 까지) · 상세 · [적용] 걷음 · 줄 패치 칸 · 타입 걷음(저장본 0) - M01 LogicLab_Detail: M02 몸 칸 걷음(M01 보기 그대로) · 지운 파일만 쓰던 글 키 16 · CSS 규칙 걷음 - 시험: 지운 몸만 붙든 시험 지움(717_3 · 722 · 748_0 · helper 728_2 · 748_0) · 섞인 파일은 몸 꼴 · 글 대조 함수 · 줄만 지움(서버 셈 시험 남김) · 856-0 단언 뒤집음 - 수치: 열 때 /sangeun/calc 2 → 1 · 숨은 몸 DOM 2 → 0 · 화면 파일 줄 −1.9 천 안팎 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
75 lines
3.2 KiB
Python
75 lines
3.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
"""PLAN 856-0 — 단가산출 화면 지킴(가짜 DOM · 진짜 코드 · `helper_856_0_sk_screen.cjs`).
|
|
|
|
① 단가산출 화면을 열 때 서버 `/sangeun/calc` 부름 수 · 숨은 상세 몸 DOM · 줄 쌓기 그림
|
|
② 일위대가 표 줄 누름 — 단가산출(SK) 참조 줄 = 그 SK 줄 쌓기 · M01 로직 줄 · 셈 주입(프로젝트 사본) 줄
|
|
③ 머리 띠 넷(까닭 · M01 개정 · 빠진 줄 · 짝 잃음)이 뜨는 경우 — 견본 답
|
|
④ M01 로직 상세 그릇 = 기본정보 접힘 + 줄 쌓기
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
from functools import lru_cache
|
|
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
|
@lru_cache(maxsize=1)
|
|
def _run() -> dict:
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_856_0_sk_screen.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
)
|
|
assert proc.returncode == 0, proc.stderr[-3000:]
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_sk_page_open_calls_and_hidden_body() -> None:
|
|
got = _run()
|
|
# 856-1 — 셈 한 번(머리 띠용 · 바탕 원값 bare 셈 걷음) · 숨은 상세 몸 DOM 0 · 줄 쌓기 한 번 그림
|
|
for k in ("page_base", "page_nobase", "memory"):
|
|
assert got[k]["calc"] == 1, k
|
|
assert got[k]["body"] == 0, k
|
|
assert got[k]["stack"]["shown"] is True, k
|
|
assert got["page_base"]["stack"]["draws"] == [{"key": "SK-000001", "memory": False}]
|
|
# 불러오기 미리 보기(저장 전 가져온 식) = 빈 키 + 문서째
|
|
assert got["memory"]["stack"]["draws"] == [{"key": "", "memory": True}]
|
|
|
|
|
|
def test_labor_row_click() -> None:
|
|
sk, logic = _run()["labor"]
|
|
# 단가산출 참조 줄 = 그 SK 문서 모달 · 줄 쌓기가 그 키로 보임
|
|
assert sk["skModal"] == 1 and sk["stack"]["shown"] is True
|
|
assert sk["stack"]["draws"] == ["SK-000010"] and sk["calc"] == 1
|
|
# M01 로직 줄 = 줄 모달(안내 한 줄) · 상세 몸 · 줄 쌓기 · 셈 없음(856-1)
|
|
assert logic["skModal"] == 0 and logic["stack"] is None
|
|
assert logic["body"] == 0 and logic["banners"] == ["info"] and logic["calc"] == 0
|
|
|
|
|
|
def test_labor_row_click_inject() -> None:
|
|
sk, logic = _run()["labor_inject"]
|
|
# 셈 주입(프로젝트 사본) = 줄 모달 · 안내 한 줄(856-3 까지) · 셈 없음
|
|
for row in (sk, logic):
|
|
assert row["modal"] and row["stack"] is None
|
|
assert row["body"] == 0 and row["banners"] == ["info"] and row["calc"] == 0
|
|
|
|
|
|
def test_head_bands_four() -> None:
|
|
got = _run()
|
|
# 까닭(빨강) · M01 개정 · 빠진 줄 · 짝 잃음(노랑) + 머리 배지 · 개정 배지
|
|
assert got["bands"]["banners"] == ["danger", "warning", "warning", "warning"]
|
|
assert got["bands"]["badges"] == [["info", "계"], ["danger", "M02_SangeunRevisedBase"]]
|
|
# 서버 못 닿음 = 빨강 하나
|
|
assert got["bands_fail"]["banners"] == ["danger"]
|
|
assert got["page_base"]["banners"] == [] and got["page_base"]["badges"] == []
|
|
|
|
|
|
def test_m01_logic_detail_shape() -> None:
|
|
# 기본정보 접힘 · 막힘 까닭 · 줄 쌓기 — 단가산출 상세 몸 칸 없음
|
|
assert _run()["m01"] == ["DETAILS", "DIV", "DIV:stack"]
|