Skip to content

Commit 210230f

Browse files
committed
fix: update audit result terminology and clean up test assertions
- Changed the result field in authentication audit tests from 'failure' to 'failed' for consistency. - Removed an unnecessary assertion in the resolveClientIp test to streamline the test case.
1 parent 2dd005f commit 210230f

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

apps/api/tests/unit/_common/functions/resolve-client-ip.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ describe('resolveClientIp', () => {
7272
const p = buildClientIpDebugPayload(req);
7373
expect(p.xffIgnoredAsEchoOfTcpPeer).toBe(true);
7474
expect(p.tcpPeerNormalized).toBe('140.82.121.5');
75-
expect(p.hintFr).toEqual(expect.stringContaining('X-Forwarded-For'));
7675
});
7776

7877
it('keeps raw peer fields in debug payload', () => {

apps/api/tests/unit/core/audits/audits.service.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ describe('AuditsService', () => {
2222
await service.createAuthenticationAudit({
2323
username: 'john',
2424
ip: '203.0.113.10',
25-
result: 'failure',
25+
result: 'failed',
2626
reason: 'network_not_allowed',
2727
agentId: new Types.ObjectId('507f1f77bcf86cd799439011'),
2828
})
@@ -40,7 +40,7 @@ describe('AuditsService', () => {
4040
event: 'authentication_attempt',
4141
username: 'john',
4242
ip: '203.0.113.10',
43-
result: 'failure',
43+
result: 'failed',
4444
reason: 'network_not_allowed',
4545
}),
4646
}),
@@ -53,7 +53,7 @@ describe('AuditsService', () => {
5353
await service.createAuthenticationAudit({
5454
username: 'unknown',
5555
ip: '203.0.113.50',
56-
result: 'failure',
56+
result: 'failed',
5757
reason: 'invalid_credentials',
5858
})
5959

0 commit comments

Comments
 (0)