mirror of
https://github.com/qlik-oss/nebula.js.git
synced 2026-05-24 16:00:16 -04:00
* test: deprecate `aw` and rename all jest unit tests from `.inspect` to `.test` * test: rename jest unit tests and update ci
51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
import { checkIfConnectionOptionDisabled } from '../checkIfConnectionOptionDisabled';
|
|
|
|
describe('checkIfConnectionOptionDisabled()', () => {
|
|
let label = '';
|
|
let info = {};
|
|
|
|
test('should return false if there was no info', () => {
|
|
info = null;
|
|
label = 'some-label';
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(false);
|
|
});
|
|
|
|
test('should return false if none of isWebIntegrationIdProvided or isClientIdProvided provided', () => {
|
|
info = {};
|
|
label = 'some-label';
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(false);
|
|
});
|
|
|
|
describe('isWebIntegrationIdProvided', () => {
|
|
test('should return false if labelKey was web-integration-id', () => {
|
|
label = 'Web Integration Id';
|
|
info = { isWebIntegrationIdProvided: true };
|
|
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(false);
|
|
});
|
|
|
|
test('should return true otherwise', () => {
|
|
label = 'Some Other Key';
|
|
info = { isWebIntegrationIdProvided: true };
|
|
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(true);
|
|
});
|
|
});
|
|
|
|
describe('isClientIdProvided', () => {
|
|
test('should return false if labelKey was web-integration-id', () => {
|
|
label = 'Client Id';
|
|
info = { isClientIdProvided: true };
|
|
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(false);
|
|
});
|
|
|
|
test('should return true otherwise', () => {
|
|
label = 'Some Other Key';
|
|
info = { isClientIdProvided: true };
|
|
|
|
expect(checkIfConnectionOptionDisabled({ label, info })).toBe(true);
|
|
});
|
|
});
|
|
});
|