|
| 1 | +'use strict'; |
| 2 | + |
| 3 | +describe('ep_embedded_hyperlinks2', function () { |
| 4 | + beforeEach(async function () { |
| 5 | + await helper.aNewPad(); |
| 6 | + this.timeout(60000); |
| 7 | + }); |
| 8 | + |
| 9 | + it('has correct links after copy and paste', async function() { |
| 10 | + // FIXME use clipboard API |
| 11 | + const html = '<span class="url-beta.etherpad.com/"><a href="http://beta.etherpad.com/">1link, </a></span>\ |
| 12 | +<span class="b url-beta.etherpad.com/"><a href="http://beta.etherpad.com/"><b>2bold</b></a></span>\ |
| 13 | +<span class="url-beta.etherpad.com/"><a href="http://beta.etherpad.com/">, 3link</a></span>' |
| 14 | + helper.linesDiv()[0].html(html); |
| 15 | + await helper.waitForPromise(() => helper.commits.length === 1); |
| 16 | + |
| 17 | + await helper.waitForPromise(() => { |
| 18 | + const lineText = helper.textLines()[0]; |
| 19 | + const firstSpan = helper.linesDiv()[0][0].children[0]; |
| 20 | + const secondSpan = helper.linesDiv()[0][0].children[1]; |
| 21 | + const thirdSpan = helper.linesDiv()[0][0].children[2]; |
| 22 | + |
| 23 | + return lineText === '1link, 2bold, 3link' && |
| 24 | + firstSpan.children[0].getAttribute('href') === 'http://beta.etherpad.com/' && |
| 25 | + secondSpan.children[0].getAttribute('href') === 'http://beta.etherpad.com/' && |
| 26 | + thirdSpan.children[0].getAttribute('href') === 'http://beta.etherpad.com/' && |
| 27 | + firstSpan.classList.contains('url-beta.etherpad.com/') && |
| 28 | + !firstSpan.classList.contains('url-') && |
| 29 | + secondSpan.classList.contains('url-beta.etherpad.com/') && |
| 30 | + !secondSpan.classList.contains('url-') && |
| 31 | + thirdSpan.classList.contains('url-beta.etherpad.com/') && |
| 32 | + !thirdSpan.classList.contains('url-') && |
| 33 | + secondSpan.classList.contains('b'); |
| 34 | + }); |
| 35 | + }); |
| 36 | + |
| 37 | +}); |
0 commit comments