style(라이브): 오른쪽 달력 글자 굵게, 방송 있는 날 점 표시
- 공용 erp-datepop mountRange 에 dayClass 옵션(없으면 예전 그대로) - 달력 화면이 보는 달 ±1년의 방송 날짜를 넘기고, 그 날에 초록 점 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,15 @@ function check(name, cond, extra) {
|
||||
await p.waitForTimeout(100);
|
||||
check("디파발리 = 빨강·이름·말풍선", (await day("2026-11-08").getAttribute("class")).includes("has-hol") && (await day("2026-11-08").getAttribute("title")) === "디파발리");
|
||||
check("대체휴일 표시", (await day("2026-11-09").innerText()).includes("대체휴일") && (await day("2026-11-09").getAttribute("title")) === "디파발리 대체", await day("2026-11-09").innerText());
|
||||
const marked = await p.locator("#lv-side-cal .has-live").evaluateAll(function (els) { return els.map(function (e) { return e.dataset.iso; }); });
|
||||
// 2026-11 달력은 11/1(일)부터라 10/30 칸은 없음, 12/3 = 다음 달 칸
|
||||
check("방송 있는 날 = 점(다른 달 날짜 포함)", JSON.stringify(marked) === JSON.stringify(["2026-11-05", "2026-11-20", "2026-12-03"]), marked);
|
||||
const dot = await day("2026-11-20").evaluate(function (el) { const c = getComputedStyle(el, "::after"); return c.width + "|" + c.backgroundColor; });
|
||||
check("점 모양", dot === "6px|rgb(22, 163, 74)", dot);
|
||||
const bold = await p.evaluate(function () {
|
||||
return ["#lv-side-cal .pj-dp-title", "#lv-side-cal .pj-dp-wd", '#lv-side-cal [data-iso="2026-11-17"]'].map(function (s) { return getComputedStyle(document.querySelector(s)).fontWeight; });
|
||||
});
|
||||
check("오른쪽 달력 글자 굵게", bold.every(function (w) { return +w >= 700; }), bold);
|
||||
await p.screenshot({ path: path.join(__dirname, ".out", "live_side_cal.png") });
|
||||
|
||||
await day("2026-11-17").click();
|
||||
|
||||
@@ -43,6 +43,9 @@ class Fake:
|
||||
def ad_spends(self, start, end):
|
||||
return {}
|
||||
|
||||
def broadcast_days(self, start, end):
|
||||
return ["2026-10-30", "2026-11-05", "2026-11-20", "2026-12-03"] # 오른쪽 달력 점 — 다른 달 날짜도
|
||||
|
||||
def account_choices(self):
|
||||
return ["MainAccount"]
|
||||
|
||||
|
||||
@@ -400,6 +400,9 @@ class Fake:
|
||||
return []
|
||||
def ad_spends(self, start, end):
|
||||
return {}
|
||||
def broadcast_days(self, start, end):
|
||||
assert (start.isoformat(), end.isoformat()) == ("2025-10-31", "2027-12-02"), (start, end) # 보는 달 ±1년
|
||||
return ["2026-11-05"]
|
||||
def account_choices(self):
|
||||
return []
|
||||
main.app.state.live_store = Fake()
|
||||
@@ -412,6 +415,7 @@ def body(c):
|
||||
page = c.get("/live/calendar?month=2026-11").text
|
||||
assert 'id="lv-side-cal"' in page and "/static/erp-datepop.js" in page
|
||||
assert names(page)["2026-11-09"] == "디파발리 대체"
|
||||
assert '<script type="application/json" id="lv-live-days">["2026-11-05"]</script>' in page
|
||||
c.cookies.set("live_lang", "en")
|
||||
assert names(c.get("/live/calendar?month=2026-11").text)["2026-11-09"] == "Deepavali (Replacement)"
|
||||
print("OK")
|
||||
@@ -529,6 +533,7 @@ def body(c):
|
||||
c.post("/live/broadcasts", data={**show, "id": bid, "sales_amount": "48", "start_time": "12:00", "end_time": "14:00", "broadcast_date": "2031-03-05"})
|
||||
cal = c.get("/live/calendar?month=2031-03").text
|
||||
assert "날짜로 이동" not in cal and "토요일" in cal and "12:00 - 14:00" in cal and "2시간 (기본 RM50)" in cal
|
||||
assert '"2031-03-05"' in cal.split('id="lv-live-days">')[1].split("</script>")[0] # 오른쪽 달력 점
|
||||
assert '<span class="lv-card-name">S%s<small>@siti.%s</small></span>' % (tag, tag) in cal and "RM54.80" in cal and ">4.80</b>" in cal
|
||||
|
||||
# ── 영문: 화면 세 개 모두 한글 없음(입력한 데이터 제외)·날짜·오류·권한 문구 ──
|
||||
|
||||
Reference in New Issue
Block a user