aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec/text.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/spec/text.js')
-rw-r--r--spec/spec/text.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/spec/spec/text.js b/spec/spec/text.js
index 2b0454f..61533de 100644
--- a/spec/spec/text.js
+++ b/spec/spec/text.js
@@ -151,12 +151,12 @@ describe('Text', function() {
it('adds content in a nested tspan', function() {
text.text('It is a bear!')
expect(text.node.childNodes[0].nodeType).toBe(1)
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('It is a bear!')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('It is a bear!')
})
it('adds content in a nested tspan even with an empty string', function() {
text.text('')
expect(text.node.childNodes[0].nodeType).toBe(1)
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('')
})
it('creates multiple lines with a newline separated string', function() {
text.text('It is\nJUST\na bear!')
@@ -177,9 +177,9 @@ describe('Text', function() {
add.plain('hut')
})
expect(text.node.childNodes[0].nodeType).toBe(1)
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('mastaba')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('mastaba')
expect(text.node.childNodes[1].nodeType).toBe(3)
- expect(text.node.childNodes[1].nodeValue).toBe('hut')
+ expect(text.node.childNodes[1].data).toBe('hut')
})
})
@@ -187,12 +187,12 @@ describe('Text', function() {
it('adds content without a tspan', function() {
text.plain('It is a bear!')
expect(text.node.childNodes[0].nodeType).toBe(3)
- expect(text.node.childNodes[0].nodeValue).toBe('It is a bear!')
+ expect(text.node.childNodes[0].data).toBe('It is a bear!')
})
it('clears content before adding new content', function() {
text.plain('It is not a bear!')
expect(text.node.childNodes.length).toBe(1)
- expect(text.node.childNodes[0].nodeValue).toBe('It is not a bear!')
+ expect(text.node.childNodes[0].data).toBe('It is not a bear!')
})
it('restores the content from the dom', function() {
text.plain('Just plain text!')
@@ -204,12 +204,12 @@ describe('Text', function() {
it('adds content in a tspan', function() {
text.tspan('It is a bear!')
expect(text.node.childNodes[0].nodeType).toBe(1)
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('It is a bear!')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('It is a bear!')
})
it('clears content before adding new content', function() {
text.tspan('It is not a bear!')
expect(text.node.childNodes.length).toBe(1)
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('It is not a bear!')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('It is not a bear!')
})
})
@@ -257,28 +257,28 @@ describe('Text', function() {
text.clear().build(true)
text.plain('A great piece!')
text.plain('Another great piece!')
- expect(text.node.childNodes[0].nodeValue).toBe('A great piece!')
- expect(text.node.childNodes[1].nodeValue).toBe('Another great piece!')
+ expect(text.node.childNodes[0].data).toBe('A great piece!')
+ expect(text.node.childNodes[1].data).toBe('Another great piece!')
})
it('enables adding multiple tspan nodes when given true', function() {
text.clear().build(true)
text.tspan('A great piece!')
text.tspan('Another great piece!')
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('A great piece!')
- expect(text.node.childNodes[1].childNodes[0].nodeValue).toBe('Another great piece!')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('A great piece!')
+ expect(text.node.childNodes[1].childNodes[0].data).toBe('Another great piece!')
})
it('disables adding multiple plain text nodes when given false', function() {
text.clear().build(true)
text.plain('A great piece!')
text.build(false).plain('Another great piece!')
- expect(text.node.childNodes[0].nodeValue).toBe('Another great piece!')
+ expect(text.node.childNodes[0].data).toBe('Another great piece!')
expect(text.node.childNodes[1]).toBe(undefined)
})
it('disables adding multiple tspan nodes when given false', function() {
text.clear().build(true)
text.tspan('A great piece!')
text.build(false).tspan('Another great piece!')
- expect(text.node.childNodes[0].childNodes[0].nodeValue).toBe('Another great piece!')
+ expect(text.node.childNodes[0].childNodes[0].data).toBe('Another great piece!')
expect(text.node.childNodes[1]).toBe(undefined)
})
})