striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit e40adb76e6b6df43515e058d084405d2e8b35df2
parent 411772cff876f9719c0d6ad8de187292df10105e
Author: yerlan <temirerlan99@gmail.com>
Date:   Fri,  2 Oct 2020 20:26:34 +0300

[R] change pruneInlineStyles test

Diffstat:
Mdemo/src/test.js | 13+++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/demo/src/test.js b/demo/src/test.js @@ -125,15 +125,20 @@ describe('Regression Tests', () => { }); - it("should remove inline styles from element", () => { + it("should change position to static", () => { const se = getEditor(); const content = node( - '<div style="position: static"></div><div style="position: static"></div>' + `<div style="position: relative"></div> + <div style="position: fixed"></div> + <div style="position: sticky"></div> + <div style="position: absolute"></div>` ); const pruned = se.pruneInlineStyles(content); - const testResult = pruned.querySelector('[style="position: static"]'); - assert.notExists(testResult, "inline styles are pruned"); + + const prunedElementsWithStyle = pruned.querySelectorAll('*[style]'); + const testArray = Array.from(prunedElementsWithStyle).filter(el=> el.style.position !== 'static') + assert.isEmpty(testArray, "inline styles are pruned"); se.clearContent(); });