Skip to content

Commit 82629a7

Browse files
committed
fix waf requests telemtry test
1 parent 482d1ce commit 82629a7

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

packages/dd-trace/test/appsec/telemetry/waf.spec.js

+2-13
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ describe('Appsec Waf Telemetry metrics', () => {
272272

273273
appsecTelemetry.incrementWafRequestsMetric(req)
274274

275-
expect(count).to.have.been.calledOnceWithExactly('waf.requests', {
275+
expect(count).to.have.been.calledWithExactly('waf.input_truncated', { truncation_reason: 1 })
276+
expect(count).to.have.been.calledWithExactly('waf.requests', {
276277
request_blocked: true,
277278
block_failure: true,
278279
rule_triggered: true,
@@ -283,18 +284,6 @@ describe('Appsec Waf Telemetry metrics', () => {
283284
waf_version: wafVersion,
284285
event_rules_version: rulesVersion
285286
})
286-
expect(count).to.have.been.calledOnce
287-
expect(count.firstCall.args[1]).to.deep.equal({
288-
block_failure: true,
289-
input_truncated: true,
290-
request_blocked: true,
291-
rate_limited: true,
292-
rule_triggered: true,
293-
waf_error: true,
294-
waf_timeout: true,
295-
waf_version: '0.0.1',
296-
event_rules_version: '0.0.2'
297-
})
298287
})
299288

300289
it('should not fail if req has no previous tag', () => {

0 commit comments

Comments
 (0)