Skip to content

Commit

Permalink
voice boost button test added
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianE00 committed May 10, 2024
1 parent 9916007 commit dcfc90d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions worker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ describe('defaultButton', () => {

});


describe('bassBoost', () => {
it('[BASS BOOST BUTTON] should send a message when clicked', async() => {
const bassBoost = document.createElement('button');
Expand All @@ -155,3 +156,17 @@ describe('bassBoost', () => {
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ type: 'testGet' });
});
});

describe('voiceBoost', () => {
it('[VOICE BOOST BUTTON] should send a message when clicked', async() => {
const voiceBoost = document.createElement('button');
voiceBoost.addEventListener('click', async () => {
console.log("[POPUP] Voice Boost clicked");
await chrome.runtime.sendMessage({ type: 'testSave' });
});

voiceBoost.click();
await new Promise(resolve => setTimeout(resolve, 0));
expect(chrome.runtime.sendMessage).toHaveBeenCalledWith({ type: 'testSave' });
});
});

0 comments on commit dcfc90d

Please sign in to comment.