chore: perauset customer project

This commit is contained in:
e2e
2026-07-11 08:35:17 +02:00
commit 37eea09bf0
293 changed files with 28412 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import { Given, When } from '@cucumber/cucumber'
import { strict as assert } from 'assert'
import type { PerausetWorld } from '../support/world.js'
import { openDb } from '../support/db.js'
Given('a test notification exists for the current user', async function (this: PerausetWorld) {
const userId = await this.getSessionUserId()
const db = openDb()
try {
const row = db
.prepare(
`INSERT INTO notification (user_id, type, title, body)
VALUES (?, 'test', 'Test Notification', 'This is a test notification')
RETURNING notification_id`
)
.get(userId) as { notification_id: string }
;(this as any).notificationId = row.notification_id
} finally {
db.close()
}
})
When('I mark the notification as read', async function (this: PerausetWorld) {
const notificationId = (this as any).notificationId
assert.ok(notificationId, 'No notification ID stored')
await this.post(`/notifications/${notificationId}/read`, {
notificationId,
})
})