Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanLiu0235 committed Mar 2, 2018
1 parent addbac5 commit a087325
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ test('children reorder', () => {
}, {
key: 3,
text: '3'
}, {
key: undefined,
text: 'undefined'
}, {
key: 1,
text: '1'
Expand All @@ -131,19 +134,31 @@ test('children reorder', () => {
'<li>2</li>' +
'<li>4</li>' +
'<li>3</li>' +
'<li>undefined</li>' +
'<li>1</li>' +
'</ol>'
)

// remove last one
vm.del(3)
// remove first one
vm.del(2)
expect(document.body.innerHTML).toBe(
'<ol>' +
'<li>2</li>' +
'<li>4</li>' +
'<li>3</li>' +
'<li>undefined</li>' +
'<li>1</li>' +
'</ol>'
)

// remove last one
vm.del(1)
expect(document.body.innerHTML).toBe(
'<ol>' +
'<li>4</li>' +
'<li>3</li>' +
'<li>undefined</li>' +
'</ol>'
)
})

test('attrs update', () => {
Expand Down

0 comments on commit a087325

Please sign in to comment.