mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
feat(flights): show a Planespotters photo even when it names no photographer
A photo whose answer gave no photographer was dropped as no photo. It is now shown, still linked to its Planespotters page, with no credit line.
This commit is contained in:
1 parent
85b1694bad
commit
259bc1a024
6 files changed
+36
-16
No files matched your search
@@ -105,6 +105,16 @@ test('a server’s cached shape falls back to its small thumbnail when the large
|
||||
}
|
||||
});
|
||||
|
||||
test('a photo that names no photographer is still a photo, uncredited', () => {
|
||||
for (const photographer of ['', ' ', 42, undefined]) {
|
||||
assert.deepEqual(
|
||||
parsePlanespottersPhoto(photo({ photographer })),
|
||||
{ ...PHOTO, photographer: '' },
|
||||
String(photographer),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('no photo, junk, and missing fields are "no photo"', () => {
|
||||
for (const payload of [
|
||||
{ photos: [] },
|
||||
@@ -114,9 +124,6 @@ test('no photo, junk, and missing fields are "no photo"', () => {
|
||||
'nope',
|
||||
{ photos: 'nope' },
|
||||
{ photos: [null] },
|
||||
photo({ photographer: '' }),
|
||||
photo({ photographer: ' ' }),
|
||||
photo({ photographer: 42 }),
|
||||
photo({ link: '' }),
|
||||
photo({ thumbnail: null, thumbnail_large: null }),
|
||||
]) {
|
||||
|
||||
Reference in new issue
Block a user