ether / ep_headings2

Headings Plugin for Etherpad
Apache License 2.0
16 stars 19 forks source link

Fix backend tests to resolve `Resolution method is overspecified.` #129

Closed yacchin1205 closed 4 months ago

yacchin1205 commented 4 months ago

The backend test of etherpad-lite was outputting the error like below:

  5) ep_headings2 - export headings to HTML
       when pad text has one Heading
         returns ok:
     Error: Resolution method is overspecified. Specify a callback *or* return a Promise; not both.
      at Test.assert (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:172:8)
      at localAssert (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:120:14)
      at /home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/supertest@7.0.0/node_modules/supertest/lib/test.js:125:7
      at callback (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/index.js:887:12)
      at <anonymous> (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/index.js:1165:18)
      at IncomingMessage.<anonymous> (/home/runner/work/etherpad-lite/etherpad-lite/node_modules/.pnpm/superagent@9.0.2/node_modules/superagent/src/node/parsers/json.js:19:7)
      at IncomingMessage.emit (node:events:531:35)
      at IncomingMessage.emit (node:domain:488:12)
      at endReadableNT (node:internal/streams/readable:1696:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

This is the same cause as the ep_font_size error, so I fixed this.

yacchin1205 commented 4 months ago

The following errors are found and I will attempt to resolve them.

  2) ep_headings2 - export headings to HTML
       when pad text has multiple Headings and align tags
         returns HTML with Multiple Headings HTML tags:
     Error: No H1 tag detected
      at Context.<anonymous> (/home/ubuntu/etherpad-lite/node_modules/.pnpm/ep_headings2@0.2.62/node_modules/ep_headings2/static/tests/backend/specs/exportHTML.js:118:17)
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
yacchin1205 commented 4 months ago

Details of the No H1 tag detected error are as follows. I revised the expected pattern, as it looks functional.

Expected: <h1 style=\'text-align:left\'>Hello world</h1> Actual: <h1 style=\'text-align:left\'>Hello world</h1> (Actual has one more blank than Expected.)