fix: 실적 표 칸 풍선 도움말 제거 · 댓글 사진 창 기본 맞춤(창에 꽉 차게)
- [실적] 매출 실적·광고비 표 몸통 칸(입력 칸·날짜 칸·광고비 줄)의 title 풍선 도움말 제거(저장 뒤에도 안 붙임), 열 머리글은 그대로 - [프로젝트] 댓글 사진 이미지 창: 처음 = 맞춤, 창 크기 = 사진 비율이라 가장자리 검은 공간 없이 꽉 참, 막대는 사진 위에 뜸, 창 크기를 바꿔도 맞춤 상태면 다시 맞춤(확대·끌기 뒤엔 그대로) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// 실제 브라우저 — 업무 창 댓글에 붙은 사진을 누르면 내려받지 않고 이미지 창(별도 브라우저 창)이 열린다(2026-10-22).
|
||||
// 처음 100%(창보다 커도), 끌어서 이동, 휠 확대·축소, [원본 보기] = 100% 로, [다운로드] = 첨부 다운로드 주소. Ctrl+클릭은 예전처럼 링크.
|
||||
// 처음 = 맞춤으로 창에 꽉 참(가장자리 검은 공간 없음, 창 크기를 바꿔도 맞춤 유지), 끌어서 이동, 휠 확대·축소, [원본 보기] = 100%,
|
||||
// [다운로드] = 첨부 다운로드 주소. Ctrl+클릭은 예전처럼 링크. (2026-10-22 — 처음 100% 에서 맞춤으로 바꿈)
|
||||
// python tests/js/render_project.py
|
||||
// NODE_PATH=<playwright 경로> PJ_TEST_BROWSER=<Chrome 경로> node tests/js/comment_image_viewer.browser.test.js
|
||||
const assert = require("node:assert/strict");
|
||||
@@ -74,15 +75,28 @@ const server = http.createServer(async (req, res) => {
|
||||
ok("누르면 내려받지 않고 이미지 창이 열림", downloads.length === 0 && pop !== page);
|
||||
const st = () => pop.evaluate(() => ({ pct: document.getElementById("pct").textContent, tr: document.getElementById("img").style.transform,
|
||||
title: document.title, w: innerWidth, h: innerHeight }));
|
||||
// 사진이 창을 꽉 채우나 — 사진 사각형이 창의 한 축을 꽉 채우고 다른 축도 비율대로(이 창은 1600×1000 = 사진과 같은 비율이라 둘 다)
|
||||
const filled = () => pop.evaluate(() => { const r = document.getElementById("img").getBoundingClientRect();
|
||||
return { l: Math.round(r.left), t: Math.round(r.top), w: Math.round(r.width), h: Math.round(r.height), W: innerWidth, H: innerHeight }; });
|
||||
const s0 = await st();
|
||||
ok("처음 100%(사진 1600×1000 이 창보다 커도), 창 제목 = 파일 이름", s0.pct === "100%" && s0.title === "photo.png" && (s0.w < 1600 || s0.h < 1000), s0);
|
||||
const f0 = await filled();
|
||||
ok("처음 = 맞춤, 사진이 창에 꽉 참(가장자리 검은 공간 없음), 창 제목 = 파일 이름",
|
||||
s0.title === "photo.png" && f0.l === 0 && f0.t === 0 && f0.w === f0.W && f0.h === f0.H, { s0: s0, f0: f0 });
|
||||
await pop.setViewportSize({ width: 800, height: 500 });
|
||||
await pop.waitForTimeout(100);
|
||||
const f1 = await filled();
|
||||
ok("창 크기를 바꿔도 맞춤 유지(꽉 참)", f1.l === 0 && f1.t === 0 && f1.w === 800 && f1.h === 500 && (await st()).pct === "50%", f1);
|
||||
await pop.setViewportSize({ width: 1600, height: 1000 });
|
||||
await pop.waitForTimeout(100);
|
||||
await pop.click("#one");
|
||||
const s0b = await st();
|
||||
const box = await pop.locator("#stage").boundingBox();
|
||||
await pop.mouse.move(box.x + box.width / 2, box.y + box.height / 2);
|
||||
await pop.mouse.down();
|
||||
await pop.mouse.move(box.x + box.width / 2 + 150, box.y + box.height / 2 + 80, { steps: 5 });
|
||||
await pop.mouse.up();
|
||||
const s1 = await st();
|
||||
ok("끌면 이미지가 움직임(100% 그대로)", s1.tr !== s0.tr && s1.pct === "100%", { before: s0.tr, after: s1.tr });
|
||||
ok("끌면 이미지가 움직임(100% 그대로)", s1.tr !== s0b.tr && s1.pct === "100%", { before: s0b.tr, after: s1.tr });
|
||||
await pop.mouse.wheel(0, -300);
|
||||
const s2 = await st();
|
||||
await pop.mouse.wheel(0, 600);
|
||||
@@ -91,7 +105,14 @@ const server = http.createServer(async (req, res) => {
|
||||
await pop.click("#one");
|
||||
ok("[원본 보기] = 100% 로", (await st()).pct === "100%" && (await pop.locator("#one").textContent()).trim() === "원본 보기");
|
||||
await pop.click("#fit");
|
||||
ok("[맞춤] = 창에 맞춤(100% 아래)", parseInt((await st()).pct, 10) < 100);
|
||||
const fz = await filled();
|
||||
ok("[맞춤] = 다시 창에 꽉 참", fz.l === 0 && fz.t === 0 && fz.w === fz.W && fz.h === fz.H, fz);
|
||||
await pop.mouse.move(800, 400); // 막대 위가 아니라 사진 위에서 휠
|
||||
await pop.mouse.wheel(0, -300);
|
||||
await pop.setViewportSize({ width: 1200, height: 900 });
|
||||
await pop.waitForTimeout(100);
|
||||
ok("확대한 뒤엔 창 크기를 바꿔도 맞춤으로 돌아가지 않음", (await st()).pct !== "75%");
|
||||
await pop.setViewportSize({ width: 1600, height: 1000 });
|
||||
const dlHref = await pop.getAttribute("#dl", "href");
|
||||
ok("[다운로드] = 첨부 다운로드 주소", /\/project\/api\/attachments\/7\/download$/.test(dlHref || ""), dlHref);
|
||||
const [download] = await Promise.all([pop.waitForEvent("download"), pop.click("#dl")]);
|
||||
|
||||
@@ -35,6 +35,11 @@ async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
r.fulfill({ status: 200, contentType: "text/html; charset=utf-8", body: page(file) });
|
||||
});
|
||||
await p.goto("http://perf.test/performance/");
|
||||
// 칸 풍선 도움말 없음(2026-10-22) — 표 몸통 칸(날짜·금액·광고비 줄)과 그 안 어디에도 title 이 없다(열 머리글은 그대로)
|
||||
const tips = await p.evaluate(function () {
|
||||
return Array.from(document.querySelectorAll(".perf-main tbody [title]")).map(function (n) { return n.tagName + ":" + n.getAttribute("title"); });
|
||||
});
|
||||
check(label + " 표 칸에 풍선 도움말(title) 없음", tips.length === 0, tips.slice(0, 5));
|
||||
const td = '[data-manual-code="' + code + '"][data-date="' + day + '"]';
|
||||
// 표를 스크롤하면 열린 메뉴는 닫힌다(사람은 스크롤한 뒤 우클릭) — 오른쪽 끝 열(기타광고비)은 먼저 보이게 스크롤해 둔다
|
||||
const show = async function (sel) { await p.locator(sel).scrollIntoViewIfNeeded(); await p.waitForTimeout(80); };
|
||||
@@ -81,6 +86,7 @@ async function memoFlow(browser, file, kind, code, day, hasMemo, label) {
|
||||
await p.click(".perf-ctx button.is-danger");
|
||||
await p.waitForFunction(function (sel) { return !document.querySelector(sel).classList.contains("has-memo"); }, td);
|
||||
check(label + " 메모 삭제 → 빈 메모로 저장, 표시 사라짐", puts[puts.length - 1].memo === "");
|
||||
check(label + " 저장한 뒤에도 칸에 풍선 도움말 없음", !(await p.getAttribute(td, "title")));
|
||||
// 칸 왼쪽 클릭은 예전처럼 금액 입력
|
||||
await p.click(td);
|
||||
check(label + " 칸 클릭은 그대로 금액 입력", !!(await p.$(td + " .perf-manual-input")));
|
||||
|
||||
Reference in New Issue
Block a user