Skip to content

Commit

Permalink
Add sessionKey to currentSession and login tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrizagidulin committed Aug 28, 2017
1 parent c9bf734 commit a82fd4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/api.spec.js
Expand Up @@ -173,7 +173,7 @@ describe('login', () => {
})
})

it('strips the hash fragment from the current URL when proiding the default redirect URL', () => {
it('strips the hash fragment from the current URL when providing the default redirect URL', () => {
nock('https://localhost/')
// try to log in with WebID-TLS
.head('/')
Expand Down Expand Up @@ -208,6 +208,7 @@ describe('login', () => {
describe('currentSession', () => {
it('can find the current session if stored', () => {
saveSession(window.localStorage)({
sessionKey,
authType: 'WebID-OIDC',
idp: 'https://localhost',
webId: 'https://person.me/#me',
Expand Down Expand Up @@ -285,6 +286,7 @@ describe('currentSession', () => {
expect(session.webId).toBe('https://person.me/#me')
expect(session.accessToken).toBe(expectedAccessToken)
expect(session.idToken).toBe(expectedIdToken)
expect(session.sessionKey).toBeTruthy()
expect(getSession(window.localStorage)).toEqual(session)
expect(window.location.hash).toBe('')
})
Expand Down Expand Up @@ -366,6 +368,7 @@ describe('logout', () => {
expect(session.webId).toBe('https://person.me/#me')
expect(session.accessToken).toBe(expectedAccessToken)
expect(session.idToken).toBe(expectedIdToken)
expect(session.sessionKey).toBeTruthy()
expect(window.location.hash).toBe('')
expect(getSession(window.localStorage)).toEqual(session)
})
Expand Down

0 comments on commit a82fd4f

Please sign in to comment.