1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { requirePasswordLogin } from './login-panel';
7 describe('<LoginPanel />', () => {
8 describe('requirePasswordLogin', () => {
9 it('should return false if no config specified', () => {
14 const result = requirePasswordLogin(config);
17 expect(result).toBeFalsy();
20 it('should return false if no config.clusterConfig specified', () => {
25 const result = requirePasswordLogin(config);
28 expect(result).toBeFalsy();
31 it('should return false if no config.clusterConfig.Login specified', () => {
38 const result = requirePasswordLogin(config);
41 expect(result).toBeFalsy();
44 it('should return false if no config.clusterConfig.Login.LDAP and config.clusterConfig.Login.PAM specified', () => {
53 const result = requirePasswordLogin(config);
56 expect(result).toBeFalsy();
59 it('should return false if config.clusterConfig.Login.LDAP.Enable and config.clusterConfig.Login.PAM.Enable not specified', () => {
71 const result = requirePasswordLogin(config);
74 expect(result).toBeFalsy();
77 it('should return value from config.clusterConfig.Login.LDAP.Enable', () => {
91 const result = requirePasswordLogin(config);
94 expect(result).toBeTruthy();
97 it('should return value from config.clusterConfig.Login.PAM.Enable', () => {
111 const result = requirePasswordLogin(config);
114 expect(result).toBeTruthy();
117 it('should return false for not specified config option config.clusterConfig.Login.NOT_EXISTING.Enable', () => {
130 const result = requirePasswordLogin(config);
133 expect(result).toBeFalsy();