Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
oblakeerickson committed Jan 18, 2024
1 parent d1d3c87 commit 8900cd2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
4 changes: 3 additions & 1 deletion assets/javascripts/discourse/components/google-adsense.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,9 @@ export default AdComponent.extend({
return true;
}
return groups.some((group) =>
this.siteSettings.adsense_through_allowed_groups.map(g => g.id).includes(group.id)
this.siteSettings.adsense_through_allowed_groups
.map((g) => g.id)
.includes(group.id)
);
},

Expand Down
17 changes: 14 additions & 3 deletions test/javascripts/acceptance/adsense-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ acceptance("AdSense", function (needs) {
no_ads_for_groups: "47",
no_ads_for_categories: "1",
adsense_publisher_code: "MYADSENSEID",
adsense_through_allowed_groups: [AUTO_GROUPS.trust_level_1, AUTO_GROUPS.trust_level_2],
adsense_through_allowed_groups: [
AUTO_GROUPS.trust_level_1,
AUTO_GROUPS.trust_level_2,
],
adsense_topic_list_top_code: "list_top_ad_unit",
adsense_topic_list_top_ad_sizes: "728*90 - leaderboard",
adsense_mobile_topic_list_top_code: "mobile_list_top_ad_unit",
Expand All @@ -40,7 +43,11 @@ acceptance("AdSense", function (needs) {
});

test("correct number of ads should show", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1, groups: [AUTO_GROUPS.trust_level_1] });
updateCurrentUser({
staff: false,
trust_level: 1,
groups: [AUTO_GROUPS.trust_level_1],
});
await visit("/t/280"); // 20 posts

assert
Expand All @@ -65,7 +72,11 @@ acceptance("AdSense", function (needs) {
});

test("no ads for trust level 3", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 3, groups: [AUTO_GROUPS.trust_level_3] });
updateCurrentUser({
staff: false,
trust_level: 3,
groups: [AUTO_GROUPS.trust_level_3],
});
await visit("/t/280");
assert
.dom(".google-adsense.adsense-post-bottom")
Expand Down

0 comments on commit 8900cd2

Please sign in to comment.