Remove promotion at start of description #46

Merged
olaven merged 1 commits from remove-first-promotion into main 2025-09-30 11:54:09 +00:00
2 changed files with 11 additions and 3 deletions

View File

@ -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");
});

View File

@ -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 {