HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/node_modules/renderkid/test/tools.coffee
tools = require '../src/tools'

describe "tools", ->
  describe "quote()", ->
    it "should convert html special strings to their entities", ->
      tools.quote(" abc<>\"\n")
      .should.equal '&sp;abc&lt;&gt;&quot;<br />'

  describe "stringToDom()", ->
    it "should work", ->
      tools.stringToDom('<a> text<a1>text</a1> text <a2>text</a2><a3>text</a3>text</a>text')

  describe "objectToDom()", ->
    it "should work", ->
      tools.objectToDom({a: 'text'})

    it "should have quoted text nodes", ->
      tools.objectToDom({a: '&<> "'})[0].children[0]
      .data.should.equal '&amp;&lt;&gt;&sp;&quot;'