Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/rss.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,12 @@ Deno.test("generated rss contains promo with link to donations page", () => {
"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");
});
5 changes: 2 additions & 3 deletions lib/rss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,10 @@ function assembleFeed(series: Series): string {
}

function descriptionWithDonationPromotion(description: string): string {
const firstPromotion = `⬇️NRSS er avhengig av din Vipps-støtte⬇️`;
const secondPromotion =
const promotion =
`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 {
Expand Down