* fix: add table CSS to .msg-body for readable bordered tables in chat (fixes #341) * fix: remove accidentally included ui.js and test_issue342.py from CSS-only PR * docs: combine v0.50.11 CHANGELOG entries, bump version badge * fix: restore ui.js from master (autolink already landed in #346) * fix: restore test_issue342.py deleted by cleanup commit (already on master) --------- Co-authored-by: Nathan Esquenazi <nesquena@gmail.com>
This commit is contained in:
34
tests/test_issue341.py
Normal file
34
tests/test_issue341.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""Tests for GitHub issue #341: .msg-body table CSS styles."""
|
||||
import os
|
||||
|
||||
CSS_PATH = os.path.join(os.path.dirname(__file__), "..", "static", "style.css")
|
||||
|
||||
|
||||
def _read_css():
|
||||
with open(CSS_PATH, "r") as f:
|
||||
return f.read()
|
||||
|
||||
|
||||
def test_msg_body_table_css_present():
|
||||
css = _read_css()
|
||||
assert ".msg-body table" in css, ".msg-body table rule missing from style.css"
|
||||
assert "border-collapse:collapse" in css, "border-collapse:collapse missing from style.css"
|
||||
|
||||
|
||||
def test_msg_body_table_th_td_present():
|
||||
css = _read_css()
|
||||
assert ".msg-body th" in css, ".msg-body th rule missing from style.css"
|
||||
assert ".msg-body td" in css, ".msg-body td rule missing from style.css"
|
||||
|
||||
|
||||
def test_msg_body_table_tr_stripe_present():
|
||||
css = _read_css()
|
||||
assert ".msg-body tr:nth-child(even)" in css, ".msg-body tr:nth-child(even) rule missing from style.css"
|
||||
|
||||
|
||||
def test_msg_body_light_theme_overrides():
|
||||
css = _read_css()
|
||||
assert ':root[data-theme="light"] .msg-body th' in css, \
|
||||
'Light-theme override for .msg-body th missing from style.css'
|
||||
assert ':root[data-theme="light"] .msg-body td' in css, \
|
||||
'Light-theme override for .msg-body td missing from style.css'
|
||||
Reference in New Issue
Block a user