Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
29 changes: 29 additions & 0 deletions tests/unit/join-button-hiding.test.js
Original file line number Diff line number Diff line change
@@ -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");
});
});
Loading