FEATURE: support placing ads between topic list for house ads (#143)
* init * more * Pass td and colspan to component * various fixes for house ads between n topics and add a test * Make adComponents condition easier to read Co-authored-by: Jordan Vidrine <jordan@jordanvidrine.com> Co-authored-by: Penar Musaraj <pmusaraj@gmail.com> Co-authored-by: romanrizzi <rizziromanalejandro@gmail.com>
This commit is contained in:
@@ -10,23 +10,28 @@ acceptance("House Ads", function (needs) {
|
||||
needs.settings({
|
||||
no_ads_for_categories: "1",
|
||||
house_ads_after_nth_post: 6,
|
||||
house_ads_after_nth_topic: 3,
|
||||
});
|
||||
needs.site({
|
||||
house_creatives: {
|
||||
settings: {
|
||||
topic_list_top: "Topic List",
|
||||
topic_list_top: "Topic List Top",
|
||||
topic_above_post_stream: "Above Post Stream",
|
||||
topic_above_suggested: "Above Suggested",
|
||||
post_bottom: "Post",
|
||||
topic_list_between: "Between Topic List",
|
||||
after_nth_post: 6,
|
||||
after_nth_topic: 6,
|
||||
},
|
||||
creatives: {
|
||||
"Topic List": "<div class='h-topic-list'>TOPIC LIST</div>",
|
||||
"Topic List Top": "<div class='h-topic-list'>TOPIC LIST TOP</div>",
|
||||
"Above Post Stream":
|
||||
"<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>",
|
||||
"Between Topic List":
|
||||
"<div class='h-between-topic-list'>BETWEEN TOPIC LIST</div>",
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -72,6 +77,13 @@ acceptance("House Ads", function (needs) {
|
||||
"it should render ad above topic list"
|
||||
);
|
||||
|
||||
await visit("/latest");
|
||||
assert.equal(
|
||||
find(".h-between-topic-list").length,
|
||||
5,
|
||||
"it should render 5 ads"
|
||||
);
|
||||
|
||||
await visit("/t/28830");
|
||||
assert.equal(
|
||||
find(".h-above-post-stream").length,
|
||||
|
||||
Reference in New Issue
Block a user