Remove promotion at start of description #46
|
|
@ -47,3 +47,12 @@ Deno.test("generated rss contains promo with link to donations page", () => {
|
||||||
"First promotion should come before the second",
|
"First promotion should come before the second",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Deno.test("first promotion is removed", () => {
|
||||||
|
const series = testUtils.generateSeries();
|
||||||
|
const feed = rss.assembleFeed(series);
|
||||||
|
const indexOfFirstPromotion = feed.indexOf(
|
||||||
|
"NRSS er avhengig av din Vipps-støtte",
|
||||||
|
);
|
||||||
|
assertEquals(indexOfFirstPromotion, -1, "First promotion should be removed");
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -53,11 +53,10 @@ function assembleFeed(series: Series): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
function descriptionWithDonationPromotion(description: string): string {
|
function descriptionWithDonationPromotion(description: string): string {
|
||||||
const firstPromotion = `⬇️NRSS er avhengig av din Vipps-støtte⬇️`;
|
const promotion =
|
||||||
const secondPromotion =
|
|
||||||
`Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`;
|
`Takk for at du bruker NRSS 🙏🌟 Vurder å støtte utviklingen via Vipps med omtrent det samme som prisen på en kaffekopp. Se mer på https://nrss.deno.dev/`;
|
||||||
|
|
||||||
return `${firstPromotion}\n\n${description}\n\n${secondPromotion}`;
|
return `${description}\n\n${promotion}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
function assembleEpisode(episode: Episode, seriesId: Series["id"]): Tag {
|
function assembleEpisode(episode: Episode, seriesId: Series["id"]): Tag {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue