forked from mirrors/gecko-dev
Bug 1895534 - Add unit test for pocketFeedParameters Nimbus variable. r=amy,home-newtab-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D209708
This commit is contained in:
parent
618f1268a4
commit
2f36d75c2a
1 changed files with 16 additions and 0 deletions
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Reference in a new issue