X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/7234259fa025569d6a7682aa6c74fdcfb3ca7e17..7b4405539ac7c11a11b5259b4f968e1289f0b2a7:/modules/documentCanvas/tests/canvas.test.js?ds=sidebyside diff --git a/modules/documentCanvas/tests/canvas.test.js b/modules/documentCanvas/tests/canvas.test.js index 57ad625..35f0d85 100644 --- a/modules/documentCanvas/tests/canvas.test.js +++ b/modules/documentCanvas/tests/canvas.test.js @@ -118,8 +118,8 @@ define([ ); }); - test('list', function() { - var c = new canvas.Canvas('
Alice
has
a cat
'); + test('create list from existing nodes', function() { + var c = new canvas.Canvas('
Alice
has
a cat
some text
'); var div1 = c.getNode({tag:'div'})[0]; var div2 = c.getNode({tag:'div'})[1]; @@ -127,14 +127,37 @@ define([ assert.xmlEqual(c.toXML(), '\
\ -
\ -
Alice
\ -
has
\ -
a cat
\ +
\ +
Alice
\ +
has
\ +
a cat
\
\ +
some text
\
'); }); + + test('remove list', function() { + var xml = '\ +
\ +
\ +
Alice
\ +
has
\ +
a cat
\ +
\ +
some text
\ +
'; + var c = new canvas.Canvas(xml); + var item = c.getNode({klass: 'item'})[1]; + c.removeList({pointer: item}); + assert.xmlEqual(c.toXML(), '\ +
\ +
Alice
\ +
has
\ +
a cat
\ +
some text
\ +
'); + }); }); }); \ No newline at end of file