From 009cbc37ddd96ce91a72bebbeb03d828ae3cb490 Mon Sep 17 00:00:00 2001 From: Toru Kobayashi Date: Wed, 9 Dec 2015 12:08:55 +0900 Subject: [PATCH] Add tests for DOMStateStorage --- modules/__tests__/DOMStateStorage-test.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/__tests__/DOMStateStorage-test.js diff --git a/modules/__tests__/DOMStateStorage-test.js b/modules/__tests__/DOMStateStorage-test.js new file mode 100644 index 000000000..3fda9e950 --- /dev/null +++ b/modules/__tests__/DOMStateStorage-test.js @@ -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) + }) +})