UNPKG

neo4j-client-sso

Version:

Single sign-on client (frontend) library for Neo4j products

54 lines (53 loc) 2.03 kB
/* * 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. */ import { transform } from './discovery'; import { exampleSSOProvider, exampleSSOProvider4dot4Format, exampleSSOProvider4dot4FormatSlim, exampleSSOProvider4dot4FormatSlimExt } from './__mocks__'; describe('transform', () => { test('without any provided sso providers', () => { const input = []; const output = []; expect(transform(input)).toEqual(output); }); test('with one provided sso providers', () => { const input = [exampleSSOProvider4dot4Format]; const output = [exampleSSOProvider]; expect(transform(input)).toEqual(output); }); test('with two provided sso providers', () => { const input = [ exampleSSOProvider4dot4Format, exampleSSOProvider4dot4FormatSlim ]; const output = [exampleSSOProvider, exampleSSOProvider4dot4FormatSlim]; expect(transform(input)).toEqual(output); }); test('with three provided sso providers', () => { const input = [ exampleSSOProvider4dot4Format, exampleSSOProvider4dot4FormatSlim, exampleSSOProvider4dot4FormatSlimExt ]; const output = [ exampleSSOProvider, exampleSSOProvider4dot4FormatSlim, exampleSSOProvider4dot4FormatSlimExt ]; expect(transform(input)).toEqual(output); }); });