Fix strategy checklist print closing too early.
Stop auto-closing the print tab on afterprint (short checklist pages were especially fragile), load print HTML via fetch into a blank window, and use CSS checkboxes instead of Unicode ballot boxes. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -33,16 +33,19 @@ class TestHubStrategyLib(unittest.TestCase):
|
||||
def test_export_html_contains_checklist(self):
|
||||
html = build_export_html("gate")
|
||||
self.assertIn("Gate", html)
|
||||
self.assertIn("☐", html)
|
||||
self.assertIn('class="box"', html)
|
||||
self.assertNotIn("☐", html)
|
||||
|
||||
def test_print_html_doc_and_checklist(self):
|
||||
doc = build_print_html("binance", "doc")
|
||||
cl = build_print_html("binance", "checklist")
|
||||
self.assertIn("window.print", doc)
|
||||
self.assertIn("window.print", cl)
|
||||
self.assertNotIn("window.close", cl)
|
||||
self.assertIn("币安", doc)
|
||||
self.assertIn("开仓检查清单", cl)
|
||||
self.assertIn("☐", cl)
|
||||
self.assertIn('class="box"', cl)
|
||||
self.assertIn("本账户仅做多", cl)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user