- b_project_switch.enterProject — 공용 goToWorkflowStage 에서 부름 · 탭마다 들어온 표식이 다를 때만 - 다른 프로젝트 세션 칸(초안 · 결과 · 옛 키 · 키 마디에 번호가 든 페이지 칸) + 3D 보관함 지움 · 지금 프로젝트 · 계정 취향 그대로 - 다른 프로젝트에 저장 안 한 고침이 있으면 확인창(지우고 열기 / 남기기) · 남기기 = 그 초안만 둠 - showConfirmDialog 취소 단추 글 받는 칸(기본 「취소」) - 시험 test_290_1(진짜 TS · 가짜 저장소) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QfHKQs7J3hQELKMWQMUJEy
65 lines
2.5 KiB
Python
65 lines
2.5 KiB
Python
"""290-1 다른 프로젝트 열면 그 밖 프로젝트 캐시 지움(요구 183-1).
|
|
|
|
- 들어갈 때(공용 `goToWorkflowStage`) 다른 프로젝트 세션 칸(초안 · 결과 · 옛 키 · 페이지 칸) · 3D 보관함 지움
|
|
- 다른 프로젝트에 저장 안 한 고침이 있으면 확인창(지우고 열기 / 남기기) · 남기기 = 그 초안만 둠
|
|
- 같은 프로젝트로 다시 들어오면 아무것도 안 지움 · 지금 프로젝트 · 계정 취향(pref) 그대로
|
|
`helper_290_1_project_purge.cjs` 가 진짜 TS 를 가짜 저장소 위에서 돌림.
|
|
"""
|
|
|
|
import json
|
|
import os
|
|
import subprocess
|
|
from pathlib import Path
|
|
|
|
import pytest
|
|
|
|
ROOT = Path(__file__).resolve().parents[2]
|
|
HERE = os.path.dirname(os.path.abspath(__file__))
|
|
A, B, C = "aaaa1111", "bbbb2222", "cccc3333"
|
|
MINE = [f"aislo:draft:structures:{B}", f"aislo:result:section-detail:{B}:7"]
|
|
UNRELATED = ["aislo.otp-pending", "aislo:entered-project"]
|
|
|
|
|
|
@pytest.fixture(scope="module")
|
|
def out():
|
|
proc = subprocess.run(
|
|
["node", os.path.join(HERE, "helper_290_1_project_purge.cjs")],
|
|
capture_output=True,
|
|
text=True,
|
|
encoding="utf-8",
|
|
timeout=60,
|
|
)
|
|
assert proc.returncode == 0, proc.stderr
|
|
return json.loads(proc.stdout)
|
|
|
|
|
|
def test_지우고_열기_다른_프로젝트_모두_지움(out):
|
|
assert out["drop"]["keys"] == sorted(MINE + UNRELATED)
|
|
assert out["drop"]["purged"] == [B] # 3D 보관함도
|
|
assert out["drop"]["asked"] == [
|
|
[f"「이름-{A}」에 저장 안 한 고침이 있음 — 지우고 열기 / 남기기", "지우고 열기", "남기기"]
|
|
]
|
|
|
|
|
|
def test_남기기_그_프로젝트_초안만_둠(out):
|
|
kept = [f"aislo:draft:crossw:{A}:12", f"aislo:draft:structures:{A}", f"b06:culvertopt:{A}:12"]
|
|
assert out["keep"]["keys"] == sorted(MINE + UNRELATED + kept)
|
|
assert out["keep"]["asked"] == 1
|
|
|
|
|
|
def test_같은_프로젝트_다시_들어오면_안_지움(out):
|
|
assert out["same"]["asked"] == 0 and out["same"]["purged"] == 0
|
|
assert len(out["same"]["keys"]) == 11
|
|
|
|
|
|
def test_빈_초안은_고침_아님_취향은_둠(out):
|
|
assert out["plan"] == [A] # C 의 빈 초안({})은 묻지 않음
|
|
assert out["pref"] == "{}"
|
|
|
|
|
|
def test_공용_이동_한_곳에서_부름():
|
|
nav = (ROOT / "A00_Common/b_workflow_nav.ts").read_text(encoding="utf-8")
|
|
assert "void enterProject(" in nav and "./b_project_switch" in nav
|
|
ui = (ROOT / "ui_template/ui_template_elements.ts").read_text(encoding="utf-8")
|
|
assert 'cancelLabel = "취소"' in ui and "label: cancelLabel" in ui
|