Add integration tests
This commit is contained in:
@@ -253,6 +253,23 @@ async function runTests() {
|
||||
assert(md.includes('paragraph'), `Missing paragraph in: ${md}`);
|
||||
});
|
||||
|
||||
await test('typing heading prefix in wysiwyg', async () => {
|
||||
// Start fresh
|
||||
await driver.executeScript(`
|
||||
var e = window.__ribbitEditor;
|
||||
e.wysiwyg();
|
||||
e.element.innerHTML = '<p><br></p>';
|
||||
`);
|
||||
await clickEditor();
|
||||
await driver.sleep(100);
|
||||
// Type "# Hello"
|
||||
await driver.actions().sendKeys('# Hello').perform();
|
||||
await driver.sleep(100);
|
||||
const html = await getEditorHTML();
|
||||
console.log(' HTML:', html.slice(0, 200));
|
||||
assert(html.includes('<h1'), `Expected <h1> in HTML: ${html.slice(0, 200)}`);
|
||||
});
|
||||
|
||||
await test('Ctrl+B shortcut works in wysiwyg', async () => {
|
||||
// Switch to wysiwyg
|
||||
await driver.executeScript('window.__ribbitEditor.wysiwyg()');
|
||||
|
||||
Reference in New Issue
Block a user