describe('Bare', function() { describe('element()', function() { var element beforeEach(function() { element = draw.element('rect') }) it('creates an instance of SVG.Bare', function() { expect(element instanceof SVG.Bare).toBeTruthy() }) it('creates element in called parent', function() { expect(element.parent()).toBe(draw) }) it('inherits from given parent', function() { expect(draw.element('g', SVG.Container).rect).toBeTruthy() expect(draw.element('g', SVG.Container).group).toBeTruthy() }) }) describe('words()', function() { it('inserts plain text in a node', function() { var element = draw.element('title').words('These are some words.').id(null) var result = element.svg() expect( result == 'These are some words.' || result == 'These are some words.' ).toBe(true) }) it('removes all nodes before adding words', function() { var element = draw.element('title').words('These are some words.').id(null) element.words('These are some words.') var result = element.svg() expect( result == 'These are some words.' || result == 'These are some words.' ).toBe(true) }) }) })