v0.0.6
This commit is contained in:
1 parent
52d5f1745a
commit
1234aae646
19 files changed
+145
-16
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -119,7 +119,7 @@ def test_backend_skin_contract_and_version():
|
||||
for value in ["rustbox", "roundcube-classic", "roundcube-larry", "roundcube-elastic", "clean", "gmail", "proton", "zoho", "outlook", "minimal", "graphite", "high-contrast", "fastmail", "apple-mail", "yahoo", "hey", "nord"]:
|
||||
assert f'"{value}"' in db_source
|
||||
cargo = (ROOT / "Cargo.toml").read_text()
|
||||
assert 'version = "0.0.5"' in cargo
|
||||
assert 'version = "0.0.6"' in cargo
|
||||
config = (ROOT / "src/config.rs").read_text()
|
||||
assert "pub default_theme: String" in config
|
||||
assert '"system" | "dark" | "light"' in config
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
def read(path):
|
||||
return (ROOT / path).read_text()
|
||||
|
||||
def test_release_version():
|
||||
assert 'version = "0.0.6"' in read("Cargo.toml")
|
||||
assert "# RustBox 0.0.6" in read("README.md")
|
||||
|
||||
def test_realtime_contract():
|
||||
ws = read("src/realtime/ws.rs")
|
||||
js = read("src/web/js/80-settings-realtime.js")
|
||||
assert '"type": "heartbeat"' in ws
|
||||
assert "Heartbeat timeout" in js
|
||||
assert "2 ** attempt" in js
|
||||
assert "resyncRealtimeState" in js
|
||||
assert "realtimeSeenEvents" in js
|
||||
assert "realtimePollTimer" in js
|
||||
assert "realtimeRefreshEvents" in js
|
||||
|
||||
def test_upload_progress_is_not_toast_driven():
|
||||
compose = read("src/web/js/50-compose.js")
|
||||
block = compose[compose.index("async function uploadComposeFiles"):compose.index("function previewMarkdown")]
|
||||
assert "progressToast(" not in block
|
||||
assert "setComposeUploadProgress" in block
|
||||
assert "AbortController" in block
|
||||
|
||||
def test_fullscreen_reader_contract():
|
||||
html = read("src/web/index.html")
|
||||
reader = read("src/web/js/40-messages-reader.js")
|
||||
menu = read("src/web/js/60-mail-actions-search.js")
|
||||
css = read("src/web/css/30-mail.css")
|
||||
assert 'id="reader-fullscreen"' in html
|
||||
assert "Open full screen" in menu
|
||||
assert "message-fullscreen-action" in reader
|
||||
assert "reader-fullscreen" in reader
|
||||
assert "history.pushState" in reader
|
||||
assert "reader-pane.reader-fullscreen" in css
|
||||
assert ".reader-pane.reader-fullscreen .message-body" in css
|
||||
assert "max-width: none" in css
|
||||
|
||||
def test_mobile_reader_contract():
|
||||
css = read("src/web/css/30-mail.css")
|
||||
responsive = read("src/web/css/60-responsive.css")
|
||||
bindings = read("src/web/js/95-bindings-boot.js")
|
||||
assert ".toolbar-menu-popover button" in css
|
||||
assert ".attachment-item .attachment-button" in css
|
||||
assert "min-height: 34px" in responsive
|
||||
assert 'bottom: "8px"' not in bindings
|
||||
assert 'rect.bottom + 5' in bindings
|
||||
|
||||
def test_message_links_can_open_new_tabs_from_sandbox():
|
||||
reader = read("src/web/js/40-messages-reader.js")
|
||||
assert 'iframe.setAttribute("sandbox", "allow-popups allow-popups-to-escape-sandbox")' in reader
|
||||
|
||||
|
||||
def test_extended_color_presets_contract():
|
||||
html = read("src/web/index.html")
|
||||
css = read("src/web/css/00-tokens.css")
|
||||
backend = read("src/db/display_preferences.rs")
|
||||
presets = ["emerald", "lime", "sky", "navy", "plum", "magenta", "copper", "sand"]
|
||||
for preset in presets:
|
||||
assert f'<option value="{preset}">' in html
|
||||
assert f'html[data-color-preset="{preset}"]' in css
|
||||
assert f'"{preset}"' in backend
|
||||
Reference in new issue
Block a user