neo4j-client-sso
Version:
Single sign-on client (frontend) library for Neo4j products
56 lines (55 loc) • 2.2 kB
JavaScript
;
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const discovery_1 = require("./discovery");
const __mocks__1 = require("./__mocks__");
describe('transform', () => {
test('without any provided sso providers', () => {
const input = [];
const output = [];
expect((0, discovery_1.transform)(input)).toEqual(output);
});
test('with one provided sso providers', () => {
const input = [__mocks__1.exampleSSOProvider4dot4Format];
const output = [__mocks__1.exampleSSOProvider];
expect((0, discovery_1.transform)(input)).toEqual(output);
});
test('with two provided sso providers', () => {
const input = [
__mocks__1.exampleSSOProvider4dot4Format,
__mocks__1.exampleSSOProvider4dot4FormatSlim
];
const output = [__mocks__1.exampleSSOProvider, __mocks__1.exampleSSOProvider4dot4FormatSlim];
expect((0, discovery_1.transform)(input)).toEqual(output);
});
test('with three provided sso providers', () => {
const input = [
__mocks__1.exampleSSOProvider4dot4Format,
__mocks__1.exampleSSOProvider4dot4FormatSlim,
__mocks__1.exampleSSOProvider4dot4FormatSlimExt
];
const output = [
__mocks__1.exampleSSOProvider,
__mocks__1.exampleSSOProvider4dot4FormatSlim,
__mocks__1.exampleSSOProvider4dot4FormatSlimExt
];
expect((0, discovery_1.transform)(input)).toEqual(output);
});
});