Skip to content

Commit

Permalink
fix: correctly display watch/blacklist button text
Browse files Browse the repository at this point in the history
  • Loading branch information
double-beep authored Jul 11, 2024
1 parent 842b38d commit b0bec6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dom_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getButton(action: 'watch' | 'blacklist'): HTMLAnchorElement {
const button = document.createElement('a');
button.classList.add(`fire-extra-${action}`);
button.style.display = 'none';
button.innerHTML = '!!/${action}';
button.innerHTML = `!!/${action}`;

return button;
}
Expand Down
14 changes: 13 additions & 1 deletion test/dom_utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
getTag,
getResultsContainer,
updateMsCounts,
updateSeCount
updateSeCount,
getWatchBlacklistButtons
} from '../src/dom_utils';
import { helpers } from '../src/index';

Expand All @@ -27,6 +28,17 @@ describe('DOM utils', () => {
expect(resultsContainer).not.to.be.null;
});

it('should correctly return the container of !!/watch and !!/blacklist buttons', () => {
const container = getWatchBlacklistButtons();
const [watch, blacklist] = [...container.children];

expect(watch.innerHTML).to.equal('!!/watch');
expect(watch.className).to.equal('fire-extra-watch');

expect(blacklist.innerHTML).to.equal('!!/blacklist');
expect(blacklist.className).to.equal('fire-extra-blacklist');
});

it('should get a tag in metasmoke\'s style', () => {
['shortener', 'ip', 'whitelisted', 'stuff-up'].forEach(tagName => {
const tag = getTag(tagName);
Expand Down

0 comments on commit b0bec6c

Please sign in to comment.