mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-23 11:42:21 +00:00
fix(recent-imagery): preserve frozen response accessors
This commit is contained in:
1 parent
b2a6aa4d9f
commit
6b216b3534
2 files changed
+25
-7
No files matched your search
@@ -683,6 +683,23 @@ test('frozen responses retain availability', async () => {
|
||||
assert.ok((await response.blob()).size);
|
||||
});
|
||||
|
||||
test('frozen native Response retains status and text methods', async () => {
|
||||
const source = createRecentImagerySource({
|
||||
thumbnailUrl: () => 'https://example.invalid/',
|
||||
fetchImpl: async () =>
|
||||
Object.freeze(
|
||||
new Response('image', {
|
||||
status: 200,
|
||||
headers: { 'Data-Present': 'true' },
|
||||
}),
|
||||
),
|
||||
});
|
||||
const response = await source.getThumbnail(FIJI_CANDIDATE, EAST_HALF);
|
||||
assert.equal(response.status, 200);
|
||||
assert.equal(await response.text(), 'image');
|
||||
assert.deepEqual(response.presentBoxes, [EAST_HALF]);
|
||||
});
|
||||
|
||||
test('removes previous drape when evidence changes from unknown to empty', () => {
|
||||
const renderer = createRecentImageryRenderer({ cesium: fakeCesium() });
|
||||
const globe = fakeCollection();
|
||||
|
||||
Reference in new issue
Block a user