From a90a5cba08fdf6c0ceb95101c275108a152a3aed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:37 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- .../newtab/test/unit/lib/DiscoveryStreamFeed.test.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'browser/components/newtab/test/unit/lib/DiscoveryStreamFeed.test.js') diff --git a/browser/components/newtab/test/unit/lib/DiscoveryStreamFeed.test.js b/browser/components/newtab/test/unit/lib/DiscoveryStreamFeed.test.js index e10a4cbc04..72fc6bd0b8 100644 --- a/browser/components/newtab/test/unit/lib/DiscoveryStreamFeed.test.js +++ b/browser/components/newtab/test/unit/lib/DiscoveryStreamFeed.test.js @@ -3467,6 +3467,22 @@ describe("DiscoveryStreamFeed", () => { "https://bffApi/desktop/v1/recommendations?locale=$locale®ion=$region&count=30" ); }); + it("should update the new feed url with pocketFeedParameters", async () => { + globals.set("NimbusFeatures", { + pocketNewtab: { + getVariable: sandbox.stub(), + }, + }); + global.NimbusFeatures.pocketNewtab.getVariable + .withArgs("pocketFeedParameters") + .returns("&enableRankingByRegion=1"); + await feed.loadLayout(feed.store.dispatch); + const { layout } = feed.store.getState().DiscoveryStream; + assert.equal( + layout[0].components[2].feed.url, + "https://bffApi/desktop/v1/recommendations?locale=$locale®ion=$region&count=30&enableRankingByRegion=1" + ); + }); it("should fetch proper data from getComponentFeed", async () => { const fakeCache = {}; sandbox.stub(feed.cache, "get").returns(Promise.resolve(fakeCache)); -- cgit v1.2.3