Skip to content

Commit

Permalink
[change] Incorrect image test name
Browse files Browse the repository at this point in the history
As we can see by the created snapshot - the image is rendered

This is because there's no default source. In such case we
render the Image source while it loads
  • Loading branch information
kidroca committed Apr 4, 2023
1 parent e77deca commit 491b728
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ exports[`components/Image prop "source" is correctly updated when missing in ini
</div>
`;

exports[`components/Image prop "source" is not set immediately if the image has not already been loaded 1`] = `
exports[`components/Image prop "source" is set immediately if the image has already been loaded 1`] = `
<div
class="css-view-175oi2r r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
>
Expand All @@ -272,36 +272,36 @@ exports[`components/Image prop "source" is not set immediately if the image has
</div>
`;

exports[`components/Image prop "source" is set immediately if the image has already been loaded 1`] = `
exports[`components/Image prop "source" is set immediately if the image has already been loaded 2`] = `
<div
class="css-view-175oi2r r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
>
<div
class="css-view-175oi2r r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv"
style="background-image: url(https://google.com/favicon.ico);"
style="background-image: url(https://twitter.com/favicon.ico);"
/>
<img
alt=""
class="css-accessibilityImage-9pa8cd"
draggable="false"
src="https://google.com/favicon.ico"
src="https://twitter.com/favicon.ico"
/>
</div>
`;

exports[`components/Image prop "source" is set immediately if the image has already been loaded 2`] = `
exports[`components/Image prop "source" is set immediately if the image has not already been loaded there is no default source 1`] = `
<div
class="css-view-175oi2r r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
>
<div
class="css-view-175oi2r r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw r-backgroundSize-4gszlv"
style="background-image: url(https://twitter.com/favicon.ico);"
style="background-image: url(https://google.com/not-yet-loaded-image.ico);"
/>
<img
alt=""
class="css-accessibilityImage-9pa8cd"
draggable="false"
src="https://twitter.com/favicon.ico"
src="https://google.com/not-yet-loaded-image.ico"
/>
</div>
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ describe('components/Image', () => {
});
});

test('is not set immediately if the image has not already been loaded', () => {
const uri = 'https://google.com/favicon.ico';
test('is set immediately while image is loading and there is no default source', () => {
const uri = 'https://google.com/not-yet-loaded-image.ico';
const source = { uri };
const { container } = render(<Image source={source} />);
expect(container.firstChild).toMatchSnapshot();
Expand Down

0 comments on commit 491b728

Please sign in to comment.