mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-28 21:32:05 +00:00
Initial Move from Azure DevOps to GitHub
This commit is contained in:
30
src/Utils/StringUtils.test.ts
Normal file
30
src/Utils/StringUtils.test.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { StringUtils } from "./StringUtils";
|
||||
|
||||
describe("StringUtils", () => {
|
||||
describe("stripSpacesFromString()", () => {
|
||||
it("should strip all spaces from input string", () => {
|
||||
const transformedString: string = StringUtils.stripSpacesFromString("a b c");
|
||||
expect(transformedString).toBe("abc");
|
||||
});
|
||||
|
||||
it("should return original string if input string has no spaces", () => {
|
||||
const transformedString: string = StringUtils.stripSpacesFromString("abc");
|
||||
expect(transformedString).toBe("abc");
|
||||
});
|
||||
|
||||
it("should return null if input is null", () => {
|
||||
const transformedString: string = StringUtils.stripSpacesFromString(null);
|
||||
expect(transformedString).toBeNull();
|
||||
});
|
||||
|
||||
it("should return undefined if input is undefiend", () => {
|
||||
const transformedString: string = StringUtils.stripSpacesFromString(undefined);
|
||||
expect(transformedString).toBe(undefined);
|
||||
});
|
||||
|
||||
it("should return empty string if input is an empty string", () => {
|
||||
const transformedString: string = StringUtils.stripSpacesFromString("");
|
||||
expect(transformedString).toBe("");
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user