diff --git a/worker.test.js b/worker.test.js index c7ca548..4ea10e3 100644 --- a/worker.test.js +++ b/worker.test.js @@ -100,6 +100,7 @@ describe('containsTab', () => { // getCurrentTab tests describe('getCurrentTab', () => { + // test 1 it('should return the current tab', async () => { const mockTab = { id: 1, url: 'http://exmaple.com' }; chrome.tabs.query.mockResolvedValue([mockTab]); @@ -107,5 +108,14 @@ describe('getCurrentTab', () => { expect(chrome.tabs.query).toHaveBeenCalledWith({ active: true, currentWindow: true}); expect(tab).toEqual(mockTab); }); + + // test 2 + it('should return the current tab', async () => { + const mockTab = { id: 1, url: 'https://christianewing.com' }; + chrome.tabs.query.mockResolvedValue([mockTab]); + const tab = await getCurrentTab(); + expect(chrome.tabs.query).toHaveBeenCalledWith({ active: true, currentWindow: true}); + expect(tab).toEqual(mockTab); + }); });