diff --git a/tests/empty.html b/tests/empty.html new file mode 100644 index 0000000..7b7b378 --- /dev/null +++ b/tests/empty.html @@ -0,0 +1,10 @@ + + + + + Empty HTML Document + + + + + \ No newline at end of file diff --git a/tests/helpers/changeExtensionTooltip.spec.js b/tests/helpers/changeExtensionTooltip.spec.js index 952aba4..52f5657 100644 --- a/tests/helpers/changeExtensionTooltip.spec.js +++ b/tests/helpers/changeExtensionTooltip.spec.js @@ -1,3 +1,8 @@ +var chai = require('chai'); +var chrome = require('sinon-chrome'); +var sinon = require('sinon-chai'); +var expect = chai.expect; + import changeExtensionTooltip from '../../assets/js/helpers/changeExtensionTooltip'; describe('changeExtensionTooltip', function() { @@ -6,10 +11,8 @@ describe('changeExtensionTooltip', function() { }); it('should change the extension tooltip', function() { - // Need to attach the spy first - spyOn(chrome.browserAction, 'setTitle'); changeExtensionTooltip('WakaTime'); expect(chrome.browserAction.setTitle).toHaveBeenCalledWith({title: 'Wakatime'}); - // sinon.assert.calledWithMatch(chrome.browserAction.setTitle, {title: 'WakaTime'}); + sinon.assert.calledWithMatch(chrome.browserAction.setTitle, {title: 'WakaTime'}); }); }); \ No newline at end of file