diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers.js | 8 | ||||
-rw-r--r-- | spec/spec/elements/Text.js | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/spec/helpers.js b/spec/helpers.js index b5b29c3..5a2568a 100644 --- a/spec/helpers.js +++ b/spec/helpers.js @@ -154,7 +154,9 @@ export function buildFixtures() { div.style.position = 'absolute' div.style.top = 0 div.style.left = 0 - } catch (e) {} + } catch (e) { + // + } div.appendChild(fixtures()) body.appendChild(div) @@ -172,7 +174,9 @@ export function buildCanvas() { div.style.position = 'absolute' div.style.top = 0 div.style.left = 0 - } catch (e) {} + } catch (e) { + // + } body.appendChild(div) } diff --git a/spec/spec/elements/Text.js b/spec/spec/elements/Text.js index b0c5a9a..f088618 100644 --- a/spec/spec/elements/Text.js +++ b/spec/spec/elements/Text.js @@ -53,12 +53,14 @@ describe('Text.js', () => { expect(text.text()).toBe('Hello World\nHow is it\ngoing') }) - it('returns the correct text with newlines and skips textPaths', () => { + it('returns the correct text with newlines and skips textPaths and descriptive elements', () => { const path = new Path() const text = new Text() const textPath = text.text('Hello World\nHow is it\ngoing').path(path) textPath.children().addTo(text) text.add(new TextPath(), 3) + text.add(SVG('<title>MyText</title>')) + expect(text.text()).toBe('Hello World\nHow is it\ngoing') }) @@ -113,6 +115,7 @@ describe('Text.js', () => { t.tspan('Hello World').newLine() t.tspan('How is it').newLine() t.tspan('going').newLine() + t.add('<title>My Text</title>') }) const dy = text.get(1).dy() |