Skip to content

Commit

Permalink
test(client): Trying to fix tests on IE
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jan 22, 2016
1 parent 83d18a8 commit cb018f7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/client/stringify.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,21 +64,24 @@ describe('stringify', function () {
it('should serialize html', function () {
var div = document.createElement('div')

assert.deepEqual(stringify(div), '<div></div>')
assert.deepEqual(stringify(div).trim(), '<div></div>')

div.innerHTML = 'some <span>text</span>'
assert.deepEqual(stringify(div), '<div>some <span>text</span></div>')
})

it('should serialize DOMParser objects', function () {
var parser = new DOMParser()
var doc = parser.parseFromString('<test></test>', 'application/xml')
assert.deepEqual(stringify(doc), '<test></test>')
if (DOMParser) {
// Test only works in IE 9 and above
var parser = new DOMParser()
var doc = parser.parseFromString('<test></test>', 'application/xml')
assert.deepEqual(stringify(doc), '<test></test>')
}
})

it('should serialize across iframes', function () {
var div = document.createElement('div')
assert.deepEqual(__karma__.stringify(div), '<div></div>')
assert.deepEqual(__karma__.stringify(div).trim(), '<div></div>')

assert.deepEqual(__karma__.stringify([1, 2]), '[1, 2]')
})
Expand Down

0 comments on commit cb018f7

Please sign in to comment.