Skip to content

Commit

Permalink
Add and update test
Browse files Browse the repository at this point in the history
  • Loading branch information
chuckh committed Sep 14, 2016
1 parent 0a8afc7 commit 415be1e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
1 change: 0 additions & 1 deletion polymer-quill.html
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ <h2>Standard Toolbar, Hide Results, Default height (100px), Save as HTML</h2>
// Set initial content
if (this.storeAs === 'delta') {
quill.setContents(JSON.parse(this.content),'api');

} else { // HTML
quill.root.innerHTML = this.content;
}
Expand Down
26 changes: 22 additions & 4 deletions test/polymer-quill_test.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,35 @@
</head>
<body>

<test-fixture id="basic">
<test-fixture id="delta">
<template>
<polymer-quill></polymer-quill>
<polymer-quill
content='{"ops":[{"insert":"Hello World! - Store as Delta"},{"attributes":{"header":2},"insert":"\n"}]}'
class='full'
store-as="delta"
save-interval="1000"
toolbar-type="full"
show-results>
</polymer-quill>
</template>
</test-fixture>

<test-fixture id="html">
<template>
<polymer-quill content="<h2>Hello World! - Store as HTML</h2>" store-as="html"></polymer-quill>
</template>
</test-fixture>

<script>
suite('polymer-quill', function() {

test('instantiating the element works', function() {
var element = fixture('basic');
test('instantiating the element works Delta', function() {
var element = fixture('delta');
assert.equal(element.is, 'polymer-quill');
});

test('instantiating the element works HTML', function() {
var element = fixture('html');
assert.equal(element.is, 'polymer-quill');
});

Expand Down

0 comments on commit 415be1e

Please sign in to comment.