mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-10-19 21:32:24 +02:00
Squash Odysseus development history
This commit is contained in:
@@ -109,7 +109,35 @@ def test_library_reply_open_carries_immutable_mailbox_context():
|
||||
assert "return onEmailClick({ ...options, mailboxContext });" in library_source
|
||||
assert "mailboxContext?.messageFolder || _currentFolder" in inbox_source
|
||||
assert "mailboxContextIsCurrent()" in inbox_source
|
||||
assert "if (!isCurrentOpen()) return;\n let activeSid = await _createEmailChat" in inbox_source
|
||||
reply_branch = inbox_source[
|
||||
inbox_source.index("const reuseExisting = mode !== 'forward'"):
|
||||
inbox_source.index("const createReplyDoc =", inbox_source.index("const reuseExisting = mode !== 'forward'"))
|
||||
]
|
||||
assert reply_branch.index("if (!isCurrentOpen()) return;") < reply_branch.index("_createEmailChat(data")
|
||||
assert "let activeSid = sessionModule?.getCurrentSessionId?.() || '';" in reply_branch
|
||||
assert "_createEmailChat(data);" in reply_branch
|
||||
assert "forceNew: !aiSuggestedBody" not in reply_branch
|
||||
|
||||
|
||||
def test_attachment_warning_only_checks_authored_reply_text():
|
||||
source = (_REPO / "static/js/document.js").read_text(encoding="utf-8")
|
||||
helper = source[source.index("function _bodyMentionsAttachment"):source.index("\n\n function _clearMissingAttachmentWarnings", source.index("function _bodyMentionsAttachment"))]
|
||||
|
||||
assert "_emailReplyOwnText(text)" in helper
|
||||
assert "text.split(/^>|^On .* wrote:/m)" not in helper
|
||||
|
||||
|
||||
def test_email_send_saves_recovery_draft_before_send_and_closes_only_on_success():
|
||||
source = (_REPO / "static/js/document.js").read_text(encoding="utf-8")
|
||||
send = source[source.index("async function _sendEmail"):source.index("\n\n async function _saveDraft", source.index("async function _sendEmail"))]
|
||||
|
||||
assert "async function _saveEmailDraftForRecovery" in source
|
||||
assert send.index("_saveEmailDraftForRecovery({") < send.index("fetch(`${API_BASE}/api/email/send`")
|
||||
success_branch = send[send.index("if (data.success) {"):]
|
||||
assert "closeLibrary()" in success_branch
|
||||
assert send.index("closeLibrary()") > send.index("const res = await sendRequest")
|
||||
assert "Draft kept in Drafts." in send
|
||||
assert "recoveryDraft.draft_uid" in send
|
||||
|
||||
|
||||
@pytest.mark.skipif(not _HAS_NODE, reason="node binary not on PATH")
|
||||
|
||||
Reference in New Issue
Block a user