Fix some bugs with svgutils.js. Add a couple tiny tests to selector_test.html

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1880 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2010-12-02 17:14:24 +00:00
parent 8b19adc777
commit 3b1b46f874
3 changed files with 49 additions and 13 deletions

View File

@@ -63,7 +63,10 @@
})
);
sandbox.appendChild(svgroot);
}
function setUpWithInit() {
setUp();
svgedit.select.init(mockConfig, mockFactory);
}
@@ -89,12 +92,20 @@
});
test('Test Selector DOM structure', function() {
expect(20);
expect(24);
setUp();
ok(svgroot);
ok(svgroot.hasChildNodes());
// Verify non-existence of Selector DOM nodes
equals(svgroot.childNodes.length, 1);
equals(svgroot.childNodes.item(0), svgcontent);
ok(!svgroot.querySelector('#selectorParentGroup'));
svgedit.select.init(mockConfig, mockFactory);
equals(svgroot.childNodes.length, 3);
// Verify existence of canvas background.
@@ -108,6 +119,7 @@
// Verify existence of selectorParentGroup.
var spg = svgroot.childNodes.item(2);
ok(spg);
equals(svgroot.querySelector('#selectorParentGroup'), spg);
equals(spg.id, 'selectorParentGroup');
equals(spg.tagName, 'g');