27 lines
1.0 KiB
Python
27 lines
1.0 KiB
Python
"""待下单详情下单备注完整查看功能回归测试。"""
|
|
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
|
|
APP_JS = (Path(__file__).resolve().parents[1] / 'static/js/app.js').read_text(encoding='utf-8')
|
|
|
|
|
|
class PendingRemarkViewerTest(unittest.TestCase):
|
|
def test_viewer_reads_the_current_input_value(self):
|
|
self.assertIn('window.openPendingRemarkViewer = function(trigger, title)', APP_JS)
|
|
self.assertIn("var remark = input ? input.value : '';", APP_JS)
|
|
self.assertIn("overlay.querySelector('textarea').value = remark;", APP_JS)
|
|
|
|
def test_product_remark_has_full_content_button(self):
|
|
self.assertIn('aria-label="查看完整成品下单备注"', APP_JS)
|
|
self.assertIn("openPendingRemarkViewer(this,\\'成品下单备注\\')", APP_JS)
|
|
|
|
def test_material_remark_has_full_content_button(self):
|
|
self.assertIn('aria-label="查看完整包材下单备注"', APP_JS)
|
|
self.assertIn("openPendingRemarkViewer(this,\\'包材下单备注\\')", APP_JS)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|