-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fabab9a
commit 90fe3e1
Showing
42 changed files
with
242 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { AUTH0_ADMIN_STRATEGY_NAME, Auth0Options, ExtraParams } from '../../type | |
import { Profile } from 'passport-auth0'; | ||
import { getAuth0AdminStrategy } from '../../admin'; | ||
|
||
describe('Auth0 admin strategy verify callback', function() { | ||
describe('Auth0 admin strategy verify callback', function () { | ||
const existsEmail = '[email protected]'; | ||
const existsEmailWithProviderKey = '[email protected]'; | ||
const existsEmailWithWrongProviderKey = '[email protected]'; | ||
|
@@ -63,7 +63,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
} as MedusaContainer; | ||
}); | ||
|
||
describe('when strict is set to admin', function() { | ||
describe('when strict is set to admin', function () { | ||
beforeEach(() => { | ||
const Auth0AdminStrategy = getAuth0AdminStrategy('test'); | ||
auth0AdminStrategy = new Auth0AdminStrategy( | ||
|
@@ -75,7 +75,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
clientSecret: 'fake', | ||
admin: { callbackUrl: '/fakeCallbackUrl' }, | ||
} as Auth0Options, | ||
'admin', | ||
'admin' | ||
); | ||
}); | ||
|
||
|
@@ -92,7 +92,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -130,7 +130,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
}); | ||
}); | ||
|
||
describe('when strict is set for store only', function() { | ||
describe('when strict is set for store only', function () { | ||
beforeEach(() => { | ||
const Auth0AdminStrategy = getAuth0AdminStrategy('test'); | ||
auth0AdminStrategy = new Auth0AdminStrategy( | ||
|
@@ -142,7 +142,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
clientSecret: 'fake', | ||
admin: { callbackUrl: '/fakeCallbackUrl' }, | ||
} as Auth0Options, | ||
'store', | ||
'store' | ||
); | ||
}); | ||
|
||
|
@@ -159,7 +159,7 @@ describe('Auth0 admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ import { AUTH0_STORE_STRATEGY_NAME, Auth0Options, ExtraParams } from '../../type | |
import { Profile } from 'passport-auth0'; | ||
import { getAuth0StoreStrategy } from '../../store'; | ||
|
||
describe('Auth0 store strategy verify callback', function() { | ||
describe('Auth0 store strategy verify callback', function () { | ||
const existsEmail = '[email protected]'; | ||
const existsEmailWithMeta = '[email protected]'; | ||
const existsEmailWithMetaAndProviderKey = '[email protected]'; | ||
|
@@ -37,12 +37,12 @@ describe('Auth0 store strategy verify callback', function() { | |
resolve: <T>(name: string): T => { | ||
const container_ = { | ||
manager: { | ||
transaction: function(cb) { | ||
transaction: function (cb) { | ||
return cb(); | ||
}, | ||
}, | ||
customerService: { | ||
withTransaction: function() { | ||
withTransaction: function () { | ||
return this; | ||
}, | ||
create: createFn, | ||
|
@@ -93,7 +93,7 @@ describe('Auth0 store strategy verify callback', function() { | |
} as MedusaContainer; | ||
}); | ||
|
||
describe('when strict is set to store', function() { | ||
describe('when strict is set to store', function () { | ||
beforeEach(() => { | ||
const Auth0StoreStrategy = getAuth0StoreStrategy('test'); | ||
auth0StoreStrategy = new Auth0StoreStrategy( | ||
|
@@ -105,7 +105,7 @@ describe('Auth0 store strategy verify callback', function() { | |
clientSecret: 'fake', | ||
store: { callbackUrl: '/fakeCallbackUrl' }, | ||
} as Auth0Options, | ||
'store', | ||
'store' | ||
); | ||
}); | ||
|
||
|
@@ -122,7 +122,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test3', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -146,7 +146,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
expect(updateFn).toHaveBeenCalledTimes(1); | ||
}); | ||
|
@@ -160,7 +160,7 @@ describe('Auth0 store strategy verify callback', function() { | |
.validate(req, accessToken, refreshToken, extraParams, profile) | ||
.catch((err) => err); | ||
expect(err).toEqual( | ||
new Error(`Customer with email ${existsEmailWithMetaButWrongProviderKey} already exists`), | ||
new Error(`Customer with email ${existsEmailWithMetaButWrongProviderKey} already exists`) | ||
); | ||
}); | ||
|
||
|
@@ -177,13 +177,13 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test', | ||
}), | ||
}) | ||
); | ||
expect(createFn).toHaveBeenCalledTimes(1); | ||
}); | ||
}); | ||
|
||
describe('when strict is set to admin', function() { | ||
describe('when strict is set to admin', function () { | ||
beforeEach(() => { | ||
const Auth0StoreStrategy = getAuth0StoreStrategy('test'); | ||
auth0StoreStrategy = new Auth0StoreStrategy( | ||
|
@@ -195,7 +195,7 @@ describe('Auth0 store strategy verify callback', function() { | |
clientSecret: 'fake', | ||
store: { callbackUrl: '/fakeCallbackUrl' }, | ||
} as Auth0Options, | ||
'admin', | ||
'admin' | ||
); | ||
}); | ||
|
||
|
@@ -212,7 +212,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test3', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -225,7 +225,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -238,7 +238,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
expect(updateFn).toHaveBeenCalledTimes(1); | ||
}); | ||
|
@@ -252,7 +252,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test4', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -269,7 +269,7 @@ describe('Auth0 store strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test', | ||
}), | ||
}) | ||
); | ||
expect(createFn).toHaveBeenCalledTimes(1); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ import { AUTH_PROVIDER_KEY, IStrategy } from '../../../../types'; | |
import { AZURE_ADMIN_STRATEGY_NAME, AzureAuthOptions } from '../../types'; | ||
import { getAzureAdminStrategy } from '../../admin'; | ||
|
||
describe('Azure AD admin strategy verify callback', function() { | ||
describe('Azure AD admin strategy verify callback', function () { | ||
const existsEmail = '[email protected]'; | ||
const existsEmailWithProviderKey = '[email protected]'; | ||
const existsEmailWithWrongProviderKey = '[email protected]'; | ||
|
@@ -57,7 +57,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
} as MedusaContainer; | ||
}); | ||
|
||
describe('when strict is set to admin', function() { | ||
describe('when strict is set to admin', function () { | ||
beforeEach(() => { | ||
const AzureAdminStrategy = getAzureAdminStrategy('test'); | ||
azureAdminStrategy = new AzureAdminStrategy( | ||
|
@@ -74,7 +74,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
allowHttpForRedirectUrl: true, | ||
}, | ||
} as AzureAuthOptions, | ||
'admin', | ||
'admin' | ||
); | ||
}); | ||
|
||
|
@@ -91,7 +91,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -123,7 +123,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
}); | ||
}); | ||
|
||
describe('when strict is set to store', function() { | ||
describe('when strict is set to store', function () { | ||
beforeEach(() => { | ||
const AzureAdminStrategy = getAzureAdminStrategy('test'); | ||
azureAdminStrategy = new AzureAdminStrategy( | ||
|
@@ -140,7 +140,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
allowHttpForRedirectUrl: true, | ||
}, | ||
} as AzureAuthOptions, | ||
'store', | ||
'store' | ||
); | ||
}); | ||
|
||
|
@@ -157,7 +157,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test2', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -170,7 +170,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
@@ -183,7 +183,7 @@ describe('Azure AD admin strategy verify callback', function() { | |
expect(data).toEqual( | ||
expect.objectContaining({ | ||
id: 'test3', | ||
}), | ||
}) | ||
); | ||
}); | ||
|
||
|
Oops, something went wrong.