Skip to content

Commit

Permalink
fix: replaced unrelevant keys in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohmn committed Jun 28, 2022
1 parent cf09e9f commit 1b45b82
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/components/FeaturedTreesSlider/test.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,42 @@ describe('Featured Trees Slider', () => {
const trees = [
{
id: '115059',
photo_url: 'https://picsum.photos/id/10/208',
image_url: 'https://picsum.photos/id/10/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/1037/208',
image_url: 'https://picsum.photos/id/1037/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/106/208',
image_url: 'https://picsum.photos/id/106/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/107/208',
image_url: 'https://picsum.photos/id/107/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/108/208',
image_url: 'https://picsum.photos/id/108/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/109/208',
image_url: 'https://picsum.photos/id/109/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/111/208',
image_url: 'https://picsum.photos/id/111/208',
species: 'Palm Tree',
},
{
id: '115059',
photo_url: 'https://picsum.photos/id/112/208',
image_url: 'https://picsum.photos/id/112/208',
species: 'Palm Tree',
},
];
Expand Down
4 changes: 2 additions & 2 deletions src/models/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,20 @@ const fixCountryNames = (countries) =>
return country;
});


// For places that display a small size of pictures, we should use our image API to load it.
// https://dev-k8s.treetracker.org/images/img/:domain/:params/:image
// E.g.,
// https://dev-k8s.treetracker.org/images/img/treetracker-dev-images.s3.eu-central-1.amazonaws.com/w=300,h=400,r=90/2020.05.19.15.41.53_37.421998333333335_-122.08400000000002_c36747a4-101f-43ff-9a91-45b3cb9bfd01_IMG_20200515_141055_7587706704717292658.jpg
// Params are width (pixels), height (pixels) and rotation (degrees).
const getThumbnailImageUrls = (imageUrl, width = 400, height = 400) => {
if (!imageUrl) return '';
const imageUrlArr = imageUrl.split('/');
const domain = imageUrlArr[imageUrlArr.length - 2];
const imagePath = imageUrlArr[imageUrlArr.length - 1];
const paramUrl = `w=${width},h=${height}`;
const thumbNailImageUrl = `https://dev-k8s.treetracker.org/images/img/${domain}/${paramUrl}/${imagePath}`;
return thumbNailImageUrl;
}
};

const debounce = (func, timeout = 50) => {
let debouncedFunc = null;
Expand Down

0 comments on commit 1b45b82

Please sign in to comment.