Clean up domain a bit
tests / tests (push) Failing after 5m5s

This commit is contained in:
Jon Staab
2026-06-18 12:49:13 -07:00
parent 0a08057786
commit 925f540640
6 changed files with 154 additions and 190 deletions
+11 -11
View File
@@ -26,7 +26,7 @@ describe("Profile", () => {
tags: [["alt", "profile"]],
})
const profile = Profile.parse(event)
const profile = await Profile.parse(event)
expect(profile.values.name).toBe("alice")
expect(profile.hasName()).toBe(true)
@@ -41,27 +41,27 @@ describe("Profile", () => {
})
it("derives lnurl from a lud16 address", () => {
const profile = Profile.make({lud16: "alice@example.com"})
const profile = Profile.init({lud16: "alice@example.com"})
expect(profile.values.lnurl).toBeTruthy()
})
it("set merges and re-derives values", () => {
const profile = Profile.make({name: "alice"})
it("gets and sets values by key", () => {
const profile = Profile.init({name: "alice"})
profile.set({about: "hello"})
profile.set("about", "hello")
expect(profile.values.name).toBe("alice")
expect(profile.values.about).toBe("hello")
expect(profile.get("name")).toBe("alice")
expect(profile.get("about")).toBe("hello")
})
it("display falls back to a shortened npub", () => {
const profile = Profile.parse(makeEvent({content: "{}"}))
it("display falls back to a shortened npub", async () => {
const profile = await Profile.parse(makeEvent({content: "{}"}))
expect(profile.display()).toBe(displayPubkey(pubkey))
})
it("throws on the wrong kind", () => {
expect(() => Profile.parse(makeEvent({kind: NOTE}))).toThrow()
it("throws on the wrong kind", async () => {
await expect(Profile.parse(makeEvent({kind: NOTE}))).rejects.toThrow()
})
})