зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1735724 - Add unit test for 200 OK with empty tiles array response from Contile. r=nanj
Differential Revision: https://phabricator.services.mozilla.com/D129088
This commit is contained in:
Родитель
bde393a961
Коммит
bcf621c781
|
@ -2136,6 +2136,22 @@ describe("Top Sites Feed", () => {
|
|||
assert.ok(!feed._contile.sites.length);
|
||||
});
|
||||
|
||||
it("should handle empty payload properly from Contile", async () => {
|
||||
fetchStub.resolves({
|
||||
ok: true,
|
||||
status: 200,
|
||||
json: () =>
|
||||
Promise.resolve({
|
||||
tiles: [],
|
||||
}),
|
||||
});
|
||||
|
||||
const fetched = await feed._contile._fetchSites();
|
||||
|
||||
assert.ok(fetched);
|
||||
assert.ok(!feed._contile.sites.length);
|
||||
});
|
||||
|
||||
it("should handle no content properly from Contile", async () => {
|
||||
fetchStub.resolves({ ok: true, status: 204 });
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче