diff --git a/src/services/utils.spec.ts b/src/services/utils.spec.ts index 9986f5dc2..6ead22576 100644 --- a/src/services/utils.spec.ts +++ b/src/services/utils.spec.ts @@ -21,7 +21,27 @@ describe.todo("#isElectron", () => {}); describe.todo("#hash", () => {}); -describe.todo("#isEmptyOrWhitespace", () => {}); +describe("#isEmptyOrWhitespace", () => { + + const testCases: TestCase[] = [ + ["w/ 'null' it should return true", [null], true], + ["w/ 'null' it should return true", [null], true], + ["w/ undefined it should return true", [undefined], true], + ["w/ empty string '' it should return true", [""], true], + ["w/ single whitespace string ' ' it should return true", [" "], true], + ["w/ multiple whitespace string ' ' it should return true", [" "], true], + ["w/ non-empty string ' t ' it should return false", [" t "], false], + ]; + + testCases.forEach(testCase => { + const [desc, fnParams, expected] = testCase; + it(desc, () => { + const result = utils.isEmptyOrWhitespace(...fnParams); + expect(result).toStrictEqual(expected); + }) + }) + +}); describe.todo("#sanitizeSqlIdentifier", () => {});