ether / ep_comments_page

Comments in Etherpad - No Longer Highly Experimental, now highly awesome!
Apache License 2.0
45 stars 48 forks source link

HTML export backend tests failing #180

Closed ilmartyrk closed 3 years ago

ilmartyrk commented 3 years ago

HTML export tests are failing. Etherpad version 1.8.7 node v10.22.1


  1) export comments to HTML
       when pad text has one comment
         returns HTML with comment class:
     Error: Comment not exported. Regex used: <span .*class=['|"].*comment c-1234.*['|"].*>this is c-1234, html exported: <!DOCTYPE HTML><html><body><span data-comment="c-1234">this is c-1234</span><br><br></body></html>
      at api.get.expect (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/static/tests/backend/specs/api/exportHTML.js:46:21)
      at Test._assertFunction (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:283:11)
      at Test.assert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:173:18)
      at localAssert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:131:12)
      at /home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:128:5
      at Test.Request.callback (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:716:12)
      at parser (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:916:18)
      at IncomingMessage.res.on (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/parsers/json.js:19:7)
      at IncomingMessage.EventEmitter.emit (domain.js:448:20)
      at endReadableNT (_stream_readable.js:1145:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)

  2) export comments to HTML
       when pad text has two comments in a single line
         returns HTML with two comments spans:
     Error: Comment not exported. Regex used: <span .*class=['|"].*comment c-1234.*['|"].*>this is c-1234.*<span .*class=['|"].*comment c-82a3.*['|"].*>this is c-82a3, html exported: <!DOCTYPE HTML><html><body><span data-comment="c-1234">this is c-1234<span data-comment="c-82a3">this is c-82a3</span></span><br><br></body></html>
      at api.get.expect (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/static/tests/backend/specs/api/exportHTML.js:71:21)
      at Test._assertFunction (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:283:11)
      at Test.assert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:173:18)
      at localAssert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:131:12)
      at /home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:128:5
      at Test.Request.callback (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:716:12)
      at parser (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:916:18)
      at IncomingMessage.res.on (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/parsers/json.js:19:7)
      at IncomingMessage.EventEmitter.emit (domain.js:448:20)
      at endReadableNT (_stream_readable.js:1145:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)

  3) export comments to HTML
       when pad text has part with comment and part without it
         returns HTML with part with comment and part without it:
     Error: Comment not exported. Regex used: no comment here <span .*class=['|"].*comment c-2342.*['|"].*>this is c-2342, html exported: <!DOCTYPE HTML><html><body>no comment here <span data-comment="c-2342">this is c-2342</span><br><br></body></html>
      at api.get.expect (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/static/tests/backend/specs/api/exportHTML.js:173:21)
      at Test._assertFunction (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:283:11)
      at Test.assert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:173:18)
      at localAssert (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:131:12)
      at /home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/supertest/lib/test.js:128:5
      at Test.Request.callback (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:716:12)
      at parser (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/index.js:916:18)
      at IncomingMessage.res.on (/home/ilmar/etherpad-lite-origin/etherpad-lite/node_modules/ep_comments_page/node_modules/superagent/lib/node/parsers/json.js:19:7)
      at IncomingMessage.EventEmitter.emit (domain.js:448:20)
      at endReadableNT (_stream_readable.js:1145:12)
      at process._tickCallback (internal/process/next_tick.js:63:19)
ilmartyrk commented 3 years ago

So found out that the issue is caused by this line as the tests don't add comments but use html with comment html. When commented out, all tests pass.