Skip to content

Commit 52c53fa

Browse files
committed
test(unit): tighten pubkey buffer and UUID assertions per review
1 parent 227790f commit 52c53fa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

test/unit/repositories/invoice-repository.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ describe('InvoiceRepository', () => {
247247
const { id: _id, ...invoiceWithoutId } = testInvoice
248248
const sql = repository.upsert(invoiceWithoutId as Invoice).toString()
249249

250-
expect(sql).to.include('insert into "invoices"')
250+
expect(sql).to.match(/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/)
251251
})
252252

253253
it('encodes pubkey as hex buffer in SQL', () => {
254254
const sql = repository.upsert(testInvoice).toString()
255255

256-
expect(sql).to.include(pubkeyHex)
256+
expect(sql).to.include(`X'${pubkeyHex}'`)
257257
})
258258

259259
it('includes all required invoice fields', () => {

test/unit/repositories/user-repository.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ describe('UserRepository', () => {
262262
it('encodes pubkey as hex buffer in SQL', () => {
263263
const sql = repository.setVanished(pubkeyHex, false).toString()
264264

265-
expect(sql).to.include(pubkeyHex)
265+
expect(sql).to.include(`X'${pubkeyHex}'`)
266266
})
267267
})
268268

0 commit comments

Comments
 (0)