Remove serialization from domain
This commit is contained in:
@@ -54,7 +54,7 @@ describe("MuteList", () => {
|
||||
const undecrypted = await MuteList.parse(event)
|
||||
|
||||
// We never decrypted, so the original ciphertext must survive untouched.
|
||||
const template = await undecrypted.getTemplate(signer)
|
||||
const template = await undecrypted.toTemplate(signer)
|
||||
|
||||
expect(template.content).toBe(event.content)
|
||||
})
|
||||
@@ -74,15 +74,6 @@ describe("MuteList", () => {
|
||||
expect(rumor.content).not.toBe("")
|
||||
})
|
||||
|
||||
it("serializes to JSON", async () => {
|
||||
const list = MuteList.make().addPublicly(a).addPrivately(b)
|
||||
const json = JSON.parse(JSON.stringify(list))
|
||||
|
||||
expect(json.kind).toBe(MUTES)
|
||||
expect(json.publicTags).toEqual([["p", a]])
|
||||
expect(json.privateTags).toEqual([["p", b]])
|
||||
})
|
||||
|
||||
it("throws on the wrong kind", async () => {
|
||||
const event = {kind: FOLLOWS, tags: [], content: "", pubkey: a} as TrustedEvent
|
||||
|
||||
|
||||
@@ -61,12 +61,6 @@ describe("Profile", () => {
|
||||
expect(profile.display()).toBe(displayPubkey(pubkey))
|
||||
})
|
||||
|
||||
it("serializes to JSON", () => {
|
||||
const profile = Profile.make({name: "alice"})
|
||||
|
||||
expect(JSON.parse(JSON.stringify(profile))).toEqual({name: "alice"})
|
||||
})
|
||||
|
||||
it("throws on the wrong kind", () => {
|
||||
expect(() => Profile.parse(makeEvent({kind: NOTE}))).toThrow()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user