From 79a225de98fec80f74a4ceeac4aae73a43f9daf6 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Tue, 17 Oct 2023 16:30:40 +0200 Subject: [PATCH] add unit test on setProgress trackOnce : chekc that trackOnce false is trasmited in the track() call. --- test/vast_tracker.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/vast_tracker.js b/test/vast_tracker.js index db5ad9d0..056d7758 100644 --- a/test/vast_tracker.js +++ b/test/vast_tracker.js @@ -130,6 +130,25 @@ describe('VASTTracker', function () { }); }); + describe('#setProgress trackOnce', () => { + + after(()=> { + this.stub?.restore(); + }) + + it('should send firstQuartile event with trackOnce : false', () => { + this.stub = sinon.stub(this.Tracker, 'track').callsFake((eventName, params) => { + console.log("testprogress : "+eventName); + if(eventName === 'progress-23') { + params.once.should.equal(false); + + } + }); + + this.Tracker.setProgress(23, null, false); + }); + }); + describe('#setMuted', () => { before((done) => { _eventsSent = [];