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 d5b2a5ab7efcad070c34a5870a369aee2423d3fc
parent b6c9df24444b80cf966166963080b3c6ed499ce7
Author: Henry Unite <unitehenry@gmail.com>
Date:   Fri, 11 Sep 2020 15:01:05 -0400

insert list testing

Diffstat:
Mdemo/src/test.js | 54++++++++++++++++++++++++++++++++++++------------------
1 file changed, 36 insertions(+), 18 deletions(-)

diff --git a/demo/src/test.js b/demo/src/test.js @@ -13,23 +13,8 @@ function node(content) { return node; } -/* Editor Tests */ -describe('Editor Initilization', () => { - it('should of been created', () => { - assert.exists(getEditor().editor, 'Editor is created'); - }); - - it('should have a body', () => { - assert.exists(getEditor().body, 'Editor contains a body'); - }); - - it('should have a toolbar', () => { - assert.exists(getEditor().toolbar, 'Editor contains a body'); - }); -}); - -/* Quality Assurance Tests */ -describe('Quality Assurance', () => { +/* Regression Tests */ +describe('Regression Tests', () => { it('should insert a link that will open in a new window', () => { const se = getEditor(); const { editor, body } = se; @@ -64,6 +49,39 @@ describe('Quality Assurance', () => { }); -}) + it('should create an ordered list with no content', () => { + const se = getEditor(); + se.toolbar.querySelector('#toolbar-insertOrderedList').click(); + + assert.exists(se.body.querySelector('ol'), 'an ordered list was created'); + se.clearContent(); + + }); + + it('should create an unordered list with no content', () => { + const se = getEditor(); + se.toolbar.querySelector('#toolbar-insertUnorderedList').click(); + + assert.exists(se.body.querySelector('ul'), 'an unordered list was created'); + se.clearContent(); + + }); + +}); + +/* Internal Tests */ +describe('Editor Initilization', () => { + it('should of been created', () => { + assert.exists(getEditor().editor, 'Editor is created'); + }); + + it('should have a body', () => { + assert.exists(getEditor().body, 'Editor contains a body'); + }); + + it('should have a toolbar', () => { + assert.exists(getEditor().toolbar, 'Editor contains a body'); + }); +}); mocha.run();