REFACTOR: Use the new format for acceptance tests. (#97)

This commit is contained in:
Roman Rizzi 2020-12-29 13:01:26 -03:00 committed by GitHub
parent 4131f8403a
commit 4bf6420b91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 237 additions and 237 deletions

View File

@ -1,9 +1,9 @@
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers"; import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import groupFixtures from "fixtures/group-fixtures"; import groupFixtures from "fixtures/group-fixtures";
acceptance("AdSense", { acceptance("AdSense", function(needs) {
loggedIn: true, needs.user();
settings: { needs.settings({
no_ads_for_groups: "47", no_ads_for_groups: "47",
no_ads_for_categories: "1", no_ads_for_categories: "1",
adsense_publisher_code: "MYADSENSEID", adsense_publisher_code: "MYADSENSEID",
@ -19,8 +19,8 @@ acceptance("AdSense", {
adsense_nth_post_code: 6, adsense_nth_post_code: 6,
adsense_topic_above_post_stream_code: "above_post_stream_ad_unit", 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: { needs.site({
house_creatives: { house_creatives: {
settings: { settings: {
topic_list_top: "", topic_list_top: "",
@ -31,7 +31,6 @@ acceptance("AdSense", {
}, },
creatives: {}, creatives: {},
}, },
},
}); });
test("correct number of ads should show", async (assert) => { test("correct number of ads should show", async (assert) => {
@ -102,3 +101,4 @@ test("can omit ads based on category", async (assert) => {
"it should render 0 ads" "it should render 0 ads"
); );
}); });
});

View File

@ -1,9 +1,9 @@
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers"; import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import groupFixtures from "fixtures/group-fixtures"; import groupFixtures from "fixtures/group-fixtures";
acceptance("DFP Ads", { acceptance("DFP Ads", function(needs) {
loggedIn: true, needs.user();
settings: { needs.settings({
no_ads_for_groups: "47", no_ads_for_groups: "47",
no_ads_for_categories: "1", no_ads_for_categories: "1",
dfp_publisher_id: "MYdfpID", dfp_publisher_id: "MYdfpID",
@ -19,8 +19,8 @@ acceptance("DFP Ads", {
dfp_nth_post_code: 6, dfp_nth_post_code: 6,
dfp_topic_above_post_stream_code: "list_top_ad_unit", 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: { needs.site({
house_creatives: { house_creatives: {
settings: { settings: {
topic_list_top: "", topic_list_top: "",
@ -31,7 +31,6 @@ acceptance("DFP Ads", {
}, },
creatives: {}, creatives: {},
}, },
},
}); });
test("correct number of ads should show", async (assert) => { test("correct number of ads should show", async (assert) => {
@ -95,3 +94,4 @@ test("can omit ads based on category", async (assert) => {
"it should render 0 ads" "it should render 0 ads"
); );
}); });
});

View File

@ -1,12 +1,12 @@
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers"; import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
acceptance("House Ads", { acceptance("House Ads", function (needs) {
loggedIn: true, needs.user();
settings: { needs.settings({
no_ads_for_categories: "1", no_ads_for_categories: "1",
house_ads_after_nth_post: 6, house_ads_after_nth_post: 6,
}, });
site: { needs.site({
house_creatives: { house_creatives: {
settings: { settings: {
topic_list_top: "Topic List", topic_list_top: "Topic List",
@ -24,7 +24,6 @@ acceptance("House Ads", {
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) => {
@ -92,3 +91,4 @@ test("correct ads show", async (assert) => {
"no ad above category topic list because category is in no_ads_for_categories" "no ad above category topic list because category is in no_ads_for_categories"
); );
}); });
});

View File

@ -1,8 +1,8 @@
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers"; import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
acceptance("Mixed Ads", { acceptance("Mixed Ads", function(needs) {
loggedIn: true, needs.user();
settings: { needs.settings({
house_ads_after_nth_post: 6, house_ads_after_nth_post: 6,
house_ads_frequency: 50, house_ads_frequency: 50,
dfp_publisher_id: "MYdfpID", dfp_publisher_id: "MYdfpID",
@ -16,8 +16,8 @@ acceptance("Mixed Ads", {
dfp_mobile_post_bottom_code: "mobile_post_bottom_ad_unit", dfp_mobile_post_bottom_code: "mobile_post_bottom_ad_unit",
dfp_mobile_post_bottom_ad_size: "300*250 - medium rectangle", dfp_mobile_post_bottom_ad_size: "300*250 - medium rectangle",
dfp_nth_post_code: 6, dfp_nth_post_code: 6,
}, });
site: { needs.site({
house_creatives: { house_creatives: {
settings: { settings: {
topic_list_top: "Topic List", topic_list_top: "Topic List",
@ -35,7 +35,6 @@ acceptance("Mixed Ads", {
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) => {
@ -57,3 +56,4 @@ test("correct ads show", async (assert) => {
"it should render ad above topic list" "it should render ad above topic list"
); );
}); });
});