diff --git a/js&css/extension/www.youtube.com/appearance/details/details.css b/js&css/extension/www.youtube.com/appearance/details/details.css index db85f60fb..f76b34895 100644 --- a/js&css/extension/www.youtube.com/appearance/details/details.css +++ b/js&css/extension/www.youtube.com/appearance/details/details.css @@ -27,7 +27,9 @@ html[it-subscribe='transparent'] #subscribe-button button {background-color:rgba html[it-subscribe='remove_label'] #subscribe-button button .yt-spec-button-shape-next__button-text-content, html[it-subscribe='hidden'] #subscribe-button, html[it-join='remove_label'] #sponsor-button button .yt-spec-button-shape-next__button-text-content, +html[it-join='remove_label'] ytd-sponsorships-offer-module-renderer button .yt-spec-button-shape-next__button-text-content, html[it-join='hidden'] #sponsor-button, +html[it-join='hidden'] ytd-sponsorships-offer-module-renderer, html[it-purchase='remove_label'] #purchase-button button .yt-spec-button-shape-next__button-text-content, html[it-purchase='hidden'] #purchase-button, html[it-youtubeDetailButtons='remove_labels'] #menu button div:nth-child(2), diff --git a/tests/unit/join-button-hiding.test.js b/tests/unit/join-button-hiding.test.js new file mode 100644 index 000000000..0541ec80c --- /dev/null +++ b/tests/unit/join-button-hiding.test.js @@ -0,0 +1,29 @@ +// Test for Issue #3669: Join button not hiding when set to Hidden + +const fs = require('fs'); +const path = require('path'); + +describe('Join Button Hiding (#3669)', () => { + let detailsCssContent; + + beforeAll(() => { + const filePath = path.join(__dirname, '../../js&css/extension/www.youtube.com/appearance/details/details.css'); + detailsCssContent = fs.readFileSync(filePath, 'utf8'); + }); + + test('should hide legacy #sponsor-button', () => { + expect(detailsCssContent).toContain("html[it-join='hidden'] #sponsor-button"); + }); + + test('should hide new ytd-sponsorships-offer-module-renderer', () => { + expect(detailsCssContent).toContain("html[it-join='hidden'] ytd-sponsorships-offer-module-renderer"); + }); + + test('should remove label from legacy #sponsor-button', () => { + expect(detailsCssContent).toContain("html[it-join='remove_label'] #sponsor-button button .yt-spec-button-shape-next__button-text-content"); + }); + + test('should remove label from new sponsorships renderer', () => { + expect(detailsCssContent).toContain("html[it-join='remove_label'] ytd-sponsorships-offer-module-renderer button .yt-spec-button-shape-next__button-text-content"); + }); +});