Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1831949
commit 8107ce8
Showing
3 changed files
with
30 additions
and
7 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
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,17 @@ | ||
|
||
import { parseDID } from "../../src/utils/did"; | ||
|
||
|
||
describe("removeDIDFromAddress", () => { | ||
it("should remove DID from address if present", async () => { | ||
const didAddress = 'did:ethr:0x395569900f9e60819fd5521a9aC044a1B2a849DC8' | ||
const address = parseDID(didAddress); | ||
expect(address).toStrictEqual(didAddress.split(':')[2]); | ||
}); | ||
|
||
it("should not attempt to remove did from address if it is not present", async () => { | ||
const didAddress = '0x395569900f9e60819fd5521a9aC044a1B2a849DC8' | ||
const address = parseDID(didAddress); | ||
expect(address).toStrictEqual(didAddress); | ||
}); | ||
}) |