describe("GA auto Testing", function() { var spy; var assert = sinon.assert; // var data = 3; beforeEach(function() { spy = sinon.spy(window, "ga"); }); afterEach(function() { spy.restore(); }); it('Choi ngay Homepage', function() { $('.atg_playnow').click(); assert.called(spy); assert.calledWith(spy, 'send', 'event', 'PlayNow', 'Button Image', 'Homepage', '1' ); });it('Dang ky Homepage', function() { $('.atg_dangky').click(); assert.called(spy); assert.calledWith(spy, 'send', 'event', 'Dang ky', 'Button Image', 'Homepage', '1' ); });it('Nap the Homepage', function() { $('.atg_napthe').click(); assert.called(spy); assert.calledWith(spy, 'send', 'event', 'Nap the', 'Button Image', 'Homepage', '1' ); });});