Refine domain, integrate into app
tests / tests (push) Failing after 5m14s

This commit is contained in:
Jon Staab
2026-06-19 12:50:34 -07:00
parent 1bd62d3024
commit e2a6ef21cd
115 changed files with 1354 additions and 3176 deletions
+5 -4
View File
@@ -41,7 +41,7 @@ describe("Classified", () => {
expect(c.identifier()).toBe("abc")
expect(c.title()).toBe("Bike")
expect(c.summary()).toBe("A good bike")
expect(c.price()).toEqual({amount: 100, currency: "USD"})
expect(c.price()).toEqual({amount: 100, currency: "USD", frequency: ""})
expect(c.status()).toBe("active")
expect(c.images()).toEqual(["https://example.com/a.jpg", "https://example.com/b.jpg"])
expect(c.topics()).toEqual(["cycling"])
@@ -51,7 +51,7 @@ describe("Classified", () => {
it("defaults the price currency to SAT", async () => {
const c = await Classified.fromEvent(makeEvent({tags: [["d", "x"], ["price", "50"]]}))
expect(c.price()).toEqual({amount: 50, currency: "SAT"})
expect(c.price()).toEqual({amount: 50, currency: "SAT", frequency: ""})
})
it("round-trips with no duplicate represented tags", async () => {
@@ -84,8 +84,9 @@ describe("Classified", () => {
expect(tmpl.content).toBe("for sale")
})
it("builds from a fresh builder with an auto-generated d", async () => {
it("builds from a fresh builder", async () => {
const tmpl = await new ClassifiedBuilder()
.setIdentifier("listing1")
.setTitle("Fresh")
.setContent("desc")
.setPrice(25)
@@ -94,7 +95,7 @@ describe("Classified", () => {
.toTemplate(signer)
expect(tmpl.kind).toBe(CLASSIFIED)
expect(tmpl.tags.find(t => t[0] === "d")?.[1]).toBeTruthy()
expect(tmpl.tags).toContainEqual(["d", "listing1"])
expect(tmpl.tags).toContainEqual(["title", "Fresh"])
expect(tmpl.tags).toContainEqual(["price", "25", "SAT"])
expect(tmpl.tags).toContainEqual(["image", "https://example.com/c.jpg"])