Files
Aislo/resources/tester/test_m02_hopyo_screen.py
T
eomsangdonandClaude Sonnet 5.5 41d2b11014 test(837-1): 불러오기 층 고정에 걸린 낡은 시험 고침 — 층 권한 403 → 경로 층 무시 200
- test_m02_hopyo_excel: 역할 표 · 마스터 폴더 시험을 「늘 개인 층 · 마스터 폴더 증가 0」 로 갈음
- test_m02_hopyo_grid: 남의 개인 층 403 → 주인 글 무시 200
- test_m02_hopyo_screen: 층 고름 글 대조 → 층 고름 없음

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 14:17:18 +09:00

59 lines
3.8 KiB
Python

"""일위대가 실무자료 화면(PLAN 324-4 · 718-1 · 785-4) — 좌측 판 자리 · 권한 · 불러오기 본 칸 · [끝내기] · 떠남.
옛 확인 창 · 고르기 창 · [로직 추가] 「실무 호표」 · 엑셀 보기 모달 시험은 785-7 에서 지움(판정 화면 = `test_642_6_screen`).
"""
import os
from pathlib import Path
HERE = os.path.dirname(os.path.abspath(__file__))
M02 = Path(HERE).parents[1] / "M02_MasterTemplete"
def _text(name: str) -> str:
return (M02 / name).read_text(encoding="utf-8")
def test_좌측_판_자리와_권한():
side = _text("M02_MasterTemplete_UI_Side.ts")
assert 'import { buildHopyoSection } from "./M02_MasterTemplete_Hopyo_Side";' in side
host = side.split('className: "m02-side__lists ui-sidebar-panel"')[1]
# 716-3 차례 — 일위대가 › 구조물 조합 › 구분선 › 일위대가 불러오기 › 도면 양식
order = ("precomboSec,", "summary,", "createDivider(),", "section(hopyo.title, hopyo.body),")
assert [host.index(k) for k in order] == sorted(host.index(k) for k in order)
assert host.index("section(hopyo.title, hopyo.body),") < host.index("drawing,")
assert "canWrite: opt.canWrite," not in side # 옛 [별칭 장부] 걷음(815-2)
assert "hopyo.paint();" in side.split("function paint(): void {")[1]
hopyo_side = _text("M02_MasterTemplete_Hopyo_Side.ts")
# 718-1 · 785-4 — 제목 = 화면 글 키 · [불러오기] = 구조물 조합 층 단추 꼴 → 바로 파일 고르기 → 본 칸 불러오기 보기
assert 'L("M02_HopyoImport")' in hopyo_side and "일위대가 실무자료" not in hopyo_side
start = hopyo_side.split("const start = createButton({")[1].split("start.title")[0]
assert 'label: "불러오기"' in start and 'start.classList.add("m02-layers__btn");' in start
assert "buildHopyoImport({" in hopyo_side and "Hopyo_Wizard" not in hopyo_side
assert not (M02 / "M02_MasterTemplete_Hopyo_Wizard.ts").exists() # 가운데 상세 페이지 없음
assert "uploadHopyo(" in hopyo_side and "openHopyoSheet" not in hopyo_side
assert "buildHopyoLedger" not in hopyo_side and "data-hopyo-ledger" not in hopyo_side
assert not (M02 / "M02_MasterTemplete_Hopyo_Ledger.ts").exists() # 옛 [별칭 장부] 걷음(815-2)
imp = _text("M02_MasterTemplete_Hopyo_Import.ts")
assert 'accept: ".xls,.xlsx,.estx,.stc"' in hopyo_side # 810-3 · 814-1 원파일도
assert "input.hidden = true;" in hopyo_side
choose = hopyo_side.split("async function choose()")[1].split("input.addEventListener")[0]
assert "input.click();" in choose # 누름 하나 — 바로 파일 고르기 창
assert "writableLayers" not in imp + hopyo_side # 837-1 층 고름 걷음 — 늘 개인 층
assert "uploadHopyo(MINE, file)" in hopyo_side
for gone in ("wantSangeun", "STEPS", "second(", "steps.set", "data-hopyo-sangeun"):
assert gone not in imp + hopyo_side, gone # 중간 걸음 · 단가산출 체크 없음
def test_372_2_저장은_개인_층에_삭제는_화면_층_권한():
"""718-1 — 만들 층 = 올린 층 · [끝내기] 로 올린 파일 지움 → 빈 본 칸(785-4: 엑셀 보기 [삭제] 걷음) ·
743-1 — 떠남(화면 바뀜 · 페이지 닫음) = 쥔 파일 지움."""
imp = _text("M02_MasterTemplete_Hopyo_Import.ts")
open_ = imp.split("m.buildHopyoSheet({")[1].split("});")[0]
assert "target: scope," in open_ and "canWrite: true," in open_
assert "onDeleted" not in imp and "dropButton" not in _text("M02_MasterTemplete_Hopyo_Sheet.ts")
assert "a.onEnded();" in imp and "held = false;" in imp
assert 'addEventListener("pagehide", leave)' in imp and " leave,\n" in imp
panel = _text("M02_MasterTemplete_Hopyo_Side.ts")
assert panel.count("open?.imp?.leave()") == 1 and panel.count("open.imp?.leave()") == 1