-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2216 from metriport/master
BACKMERGE
- Loading branch information
Showing
3 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { stripUrnPrefix } from "../urn"; | ||
|
||
beforeEach(() => { | ||
jest.restoreAllMocks(); | ||
}); | ||
|
||
describe("stripUrnPrefix", () => { | ||
it("returns empty string when gets undefined", async () => { | ||
const res = stripUrnPrefix(undefined); | ||
expect(res).toEqual(""); | ||
}); | ||
|
||
it("returns string when gets number", async () => { | ||
const original = 123; | ||
const res = stripUrnPrefix(original); | ||
expect(res).toEqual("123"); | ||
}); | ||
|
||
it("returns stripped string when gets urn:oid", async () => { | ||
const original = "urn:oid:2.16.840.1.113883.3.9621"; | ||
const res = stripUrnPrefix(original); | ||
expect(res).toEqual("2.16.840.1.113883.3.9621"); | ||
}); | ||
|
||
it("returns stripped string when gets urn:uuid", async () => { | ||
const original = "urn:uuid:2.16.840.1.113883.3.9621"; | ||
const res = stripUrnPrefix(original); | ||
expect(res).toEqual("2.16.840.1.113883.3.9621"); | ||
}); | ||
|
||
it("returns string when its a normal oid", async () => { | ||
const original = "2.16.840.1.113883.3.9621"; | ||
const res = stripUrnPrefix(original); | ||
expect(res).toEqual("2.16.840.1.113883.3.9621"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters