Skip to content

Commit

Permalink
Start writing tests and implemention for cookie store
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Apr 25, 2017
1 parent 535f6a1 commit 6569e11
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/storage.js
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { default as createLocalStorageStore } from './storage/localStorage'
export { default as createCookieStore } from './storage/cookie'
12 changes: 12 additions & 0 deletions src/storage/cookie.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const createCookieStore = ({
key = 'redux-simple-auth-session'
} = {}) => ({
persist(data) {
return Promise.resolve()
},
restore() {
return Promise.resolve({})
}
})

export default createCookieStore
13 changes: 13 additions & 0 deletions test/sessionStores/cookie.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { createCookieStore } from '../../src/storage'

const defaultKey = 'redux-simple-auth-session'

describe('cookie store', () => {
describe('#persist', () => {
it('returns resolved promise', () => {
const cookieStore = createCookieStore()

expect(cookieStore.persist()).resolves
})
})
})

0 comments on commit 6569e11

Please sign in to comment.