chore: perauset customer project
This commit is contained in:
12
e2e/tests/steps/audit-log.steps.ts
Normal file
12
e2e/tests/steps/audit-log.steps.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { Then } from '@cucumber/cucumber'
|
||||
import { strict as assert } from 'assert'
|
||||
import type { PerausetWorld } from '../support/world.js'
|
||||
|
||||
Then('the audit log should contain an {string} entry for table {string}', function (this: PerausetWorld, action: string, tableName: string) {
|
||||
assert.ok(this.lastBody, 'No response body')
|
||||
assert.ok(Array.isArray(this.lastBody.items), `Expected body.items to be an array, got: ${JSON.stringify(this.lastBody)}`)
|
||||
const match = this.lastBody.items.find(
|
||||
(entry: any) => entry.action === action && entry.tableName === tableName
|
||||
)
|
||||
assert.ok(match, `No audit log entry with action="${action}" for table="${tableName}" found in: ${JSON.stringify(this.lastBody.items.slice(0, 5))}`)
|
||||
})
|
||||
Reference in New Issue
Block a user