Files
nebula.js/commands/serve/web/utils/__tests__/checkIfConnectionOptionDisabled.test.js
Ahmad Mirzaei 6454769e5b test: rename test files and update ci pipeline (#1009)
* test: deprecate `aw` and rename all jest unit tests from `.inspect` to `.test`

* test: rename jest unit tests and update ci
2022-11-18 13:26:15 +01:00

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);
});
});
});