auth0-lock
Version:
Auth0 Lock
35 lines (32 loc) • 1.07 kB
JavaScript
;
var _immutable = _interopRequireDefault(require("immutable"));
var _enterprise = require("../../../connection/enterprise");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
jest.mock('core/index', function () {
return {
connections: jest.fn()
};
});
describe('matchConnection', function () {
afterEach(function () {
return jest.resetAllMocks();
});
it('does not throw when enterprise connection has no domains configured', function () {
var _require = require('core/index'),
connections = _require.connections;
// Simulate tenant endpoint returning a connection with no domains field
connections.mockReturnValue(_immutable.default.fromJS([{
name: 'samlp-connection',
strategy: 'samlp',
type: 'enterprise'
}]));
var m = _immutable.default.fromJS({
id: '__lock__'
});
var result;
expect(function () {
result = (0, _enterprise.matchConnection)(m, 'test@example.com');
}).not.toThrow();
expect(result).toBeFalsy();
});
});