Skip to content

Commit

Permalink
Add tests for DOMStateStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Dec 9, 2015
1 parent 9f7e046 commit 009cbc3
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions modules/__tests__/DOMStateStorage-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import expect from 'expect'
import { saveState, readState } from '../DOMStateStorage'

describe('dom state storage', function () {
it('saves and reads state data', function () {
saveState('key1', { id: 1 })
expect(readState('key1')).toEqual({ id: 1 })

saveState('key1', null)
expect(readState('key1')).toEqual(null)

saveState('key2', { id: 2 })
expect(readState('key2')).toEqual({ id: 2 })

expect(readState('key3')).toEqual(null)
})
})

0 comments on commit 009cbc3

Please sign in to comment.