forked from bevacqua/woofmark
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bold texts loosing formatting after converting to markdown and ba…
…ck to wysiwyg (#15) * fix bold texts loosing formatting * add test for bold formatting * remove unrelated test * fix emphasized texts loosing formatting * remove test.html file
- Loading branch information
1 parent
e9e7bb4
commit e6f56ea
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const timeout = process.env.SLOWMO ? 130000 : 40000; | ||
const fs = require('fs'); | ||
beforeAll(async () => { | ||
path = fs.realpathSync('file://../index.html'); | ||
await page.goto('file://' + path, {waitUntil: 'domcontentloaded'}); | ||
}); | ||
|
||
describe('bold module work as expected', () => { | ||
|
||
test('bold text does not loose formatting after converting to markdown and back to rich', async () => { | ||
await page.evaluate(() => document.querySelector('.wk-wysiwyg').innerHTML = ''); | ||
|
||
await page.waitForSelector('.wk-wysiwyg'); | ||
await page.keyboard.type(' not using bold ', {delay: 160}); | ||
await page.keyboard.down('Control'); | ||
await page.keyboard.press('KeyB'); | ||
await page.keyboard.up('Control'); | ||
await page.keyboard.type('using bold ', {delay: 160}); | ||
await page.keyboard.down('Control'); | ||
await page.keyboard.press('KeyB'); | ||
await page.keyboard.up('Control'); | ||
await page.keyboard.type('using new line', {delay: 160}); | ||
|
||
await page.keyboard.down('Control'); | ||
await page.keyboard.press('KeyM'); | ||
await page.keyboard.up('Control'); | ||
await page.keyboard.type('writing in markdown mode', {delay: 160}); | ||
await page.keyboard.down('Control'); | ||
await page.keyboard.press('KeyP'); | ||
await page.keyboard.up('Control'); | ||
await page.keyboard.type('back writing in wysiwyg mode', {delay: 160}); | ||
|
||
const stringIsIncluded = await page.evaluate(() => document.querySelector('.wk-wysiwyg').innerHTML.includes('**using bold **')); | ||
expect(stringIsIncluded).toBe(false); | ||
|
||
}, timeout); | ||
}); |