1
0
mirror of synced 2026-08-05 09:56:55 +00:00

DEV: apply coding standards (#91)

This commit is contained in:
Joffrey JAFFEUX
2020-09-04 13:24:14 +02:00
committed by GitHub
parent 88e2bab0d6
commit 30dad0281d
36 changed files with 1288 additions and 712 deletions
+10 -10
View File
@@ -18,7 +18,7 @@ acceptance("AdSense", {
adsense_mobile_post_bottom_ad_size: "300*250 - medium rectangle",
adsense_nth_post_code: 6,
adsense_topic_above_post_stream_code: "above_post_stream_ad_unit",
adsense_topic_above_post_stream_ad_sizes: "728*90 - leaderboard"
adsense_topic_above_post_stream_ad_sizes: "728*90 - leaderboard",
},
site: {
house_creatives: {
@@ -27,14 +27,14 @@ acceptance("AdSense", {
topic_above_post_stream: "",
topic_above_suggested: "",
post_bottom: "",
after_nth_post: 20
after_nth_post: 20,
},
creatives: {}
}
}
creatives: {},
},
},
});
test("correct number of ads should show", async assert => {
test("correct number of ads should show", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/280"); // 20 posts
@@ -69,7 +69,7 @@ test("correct number of ads should show", async assert => {
);
});
test("no ads for trust level 3", async assert => {
test("no ads for trust level 3", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 3 });
await visit("/t/280");
assert.equal(
@@ -79,11 +79,11 @@ test("no ads for trust level 3", async assert => {
);
});
test("can omit ads based on groups", async assert => {
test("can omit ads based on groups", async (assert) => {
updateCurrentUser({
staff: false,
trust_level: 1,
groups: [groupFixtures["/groups/discourse.json"].group]
groups: [groupFixtures["/groups/discourse.json"].group],
});
await visit("/t/280");
assert.equal(
@@ -93,7 +93,7 @@ test("can omit ads based on groups", async assert => {
);
});
test("can omit ads based on category", async assert => {
test("can omit ads based on category", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/28830");
assert.equal(
+10 -10
View File
@@ -18,7 +18,7 @@ acceptance("DFP Ads", {
dfp_mobile_post_bottom_ad_size: "300*250 - medium rectangle",
dfp_nth_post_code: 6,
dfp_topic_above_post_stream_code: "list_top_ad_unit",
dfp_topic_above_post_stream_ad_sizes: "728*90 - leaderboard"
dfp_topic_above_post_stream_ad_sizes: "728*90 - leaderboard",
},
site: {
house_creatives: {
@@ -27,14 +27,14 @@ acceptance("DFP Ads", {
topic_above_post_stream: "",
topic_above_suggested: "",
post_bottom: "",
after_nth_post: 20
after_nth_post: 20,
},
creatives: {}
}
}
creatives: {},
},
},
});
test("correct number of ads should show", async assert => {
test("correct number of ads should show", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/280"); // 20 posts
const ads = find(".google-dfp-ad.dfp-ad-post-bottom");
@@ -62,7 +62,7 @@ test("correct number of ads should show", async assert => {
);
});
test("no ads for trust level 3", async assert => {
test("no ads for trust level 3", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 3 });
await visit("/t/280");
assert.equal(
@@ -72,11 +72,11 @@ test("no ads for trust level 3", async assert => {
);
});
test("can omit ads based on groups", async assert => {
test("can omit ads based on groups", async (assert) => {
updateCurrentUser({
staff: false,
trust_level: 1,
groups: [groupFixtures["/groups/discourse.json"].group]
groups: [groupFixtures["/groups/discourse.json"].group],
});
await visit("/t/280");
assert.equal(
@@ -86,7 +86,7 @@ test("can omit ads based on groups", async assert => {
);
});
test("can omit ads based on category", async assert => {
test("can omit ads based on category", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/28830");
assert.equal(
@@ -4,7 +4,7 @@ acceptance("House Ads", {
loggedIn: true,
settings: {
no_ads_for_categories: "1",
house_ads_after_nth_post: 6
house_ads_after_nth_post: 6,
},
site: {
house_creatives: {
@@ -13,7 +13,7 @@ acceptance("House Ads", {
topic_above_post_stream: "Above Post Stream",
topic_above_suggested: "Above Suggested",
post_bottom: "Post",
after_nth_post: 6
after_nth_post: 6,
},
creatives: {
"Topic List": "<div class='h-topic-list'>TOPIC LIST</div>",
@@ -21,13 +21,13 @@ acceptance("House Ads", {
"<div class='h-above-post-stream'>ABOVE POST STREAM</div>",
"Above Suggested":
"<div class='h-above-suggested'>ABOVE SUGGESTED</div>",
Post: "<div class='h-post'>BELOW POST</div>"
}
}
}
Post: "<div class='h-post'>BELOW POST</div>",
},
},
},
});
test("correct ads show", async assert => {
test("correct ads show", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/280"); // 20 posts
@@ -15,7 +15,7 @@ acceptance("Mixed Ads", {
dfp_post_bottom_ad_sizes: "728*90 - leaderboard",
dfp_mobile_post_bottom_code: "mobile_post_bottom_ad_unit",
dfp_mobile_post_bottom_ad_size: "300*250 - medium rectangle",
dfp_nth_post_code: 6
dfp_nth_post_code: 6,
},
site: {
house_creatives: {
@@ -24,7 +24,7 @@ acceptance("Mixed Ads", {
topic_above_post_stream: "Above Post Stream",
topic_above_suggested: "Above Suggested",
post_bottom: "Post",
after_nth_post: 6
after_nth_post: 6,
},
creatives: {
"Topic List": "<div class='h-topic-list'>TOPIC LIST</div>",
@@ -32,13 +32,13 @@ acceptance("Mixed Ads", {
"<div class='h-above-post-stream'>ABOVE POST STREAM</div>",
"Above Suggested":
"<div class='h-above-suggested'>ABOVE SUGGESTED</div>",
Post: "<div class='h-post'>BELOW POST</div>"
}
}
}
Post: "<div class='h-post'>BELOW POST</div>",
},
},
},
});
test("correct ads show", async assert => {
test("correct ads show", async (assert) => {
updateCurrentUser({ staff: false, trust_level: 1 });
await visit("/t/280"); // 20 posts