HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/node_modules/svg.js/spec/spec/bare.js
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 == '<title>These are some words.</title>'
        || result == '<title xmlns="http://www.w3.org/2000/svg">These are some words.</title>'
      ).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 == '<title>These are some words.</title>'
        || result == '<title xmlns="http://www.w3.org/2000/svg">These are some words.</title>'
      ).toBe(true)
    })
  })
})