Add to Image tests

This commit is contained in:
Nicolas Gallagher
2020-10-05 13:14:26 -07:00
parent 2276e17310
commit 5edba02319
2 changed files with 20 additions and 4 deletions
@@ -132,6 +132,17 @@ exports[`components/Image prop "draggable" 1`] = `
</div>
`;
exports[`components/Image prop "nativeID" 1`] = `
<div
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
id="nativeID"
>
<div
class="css-view-1dbjc4n r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-backgroundSize-4gszlv r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw"
/>
</div>
`;
exports[`components/Image prop "resizeMode" value "contain" 1`] = `
<div
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
@@ -317,14 +328,14 @@ exports[`components/Image prop "style" removes other unsupported View styles 1`]
>
<div
class="css-view-1dbjc4n r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-backgroundSize-4gszlv r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw"
style="filter: url(#tint-53);"
style="filter: url(#tint-54);"
/>
<svg
style="position: absolute; height: 0px; visibility: hidden; width: 0px;"
>
<defs>
<filter
id="tint-53"
id="tint-54"
>
<feflood
flood-color="blue"
@@ -366,7 +377,7 @@ exports[`components/Image prop "style" supports "tintcolor" property (convert to
>
<div
class="css-view-1dbjc4n r-backgroundColor-1niwhzg r-backgroundPosition-vvn4in r-backgroundRepeat-u6sd8q r-backgroundSize-4gszlv r-bottom-1p0dtai r-height-1pi2tsx r-left-1d2f490 r-position-u8s1d r-right-zchlnj r-top-ipm5af r-width-13qz1uu r-zIndex-1wyyakw"
style="background-image: url(https://google.com/favicon.ico); filter: url(#tint-52);"
style="background-image: url(https://google.com/favicon.ico); filter: url(#tint-53);"
/>
<img
alt=""
@@ -379,7 +390,7 @@ exports[`components/Image prop "style" supports "tintcolor" property (convert to
>
<defs>
<filter
id="tint-52"
id="tint-53"
>
<feflood
flood-color="red"
@@ -83,6 +83,11 @@ describe('components/Image', () => {
expect(container.firstChild).toMatchSnapshot();
});
test('prop "nativeID"', () => {
const { container } = render(<Image nativeID="nativeID" />);
expect(container.firstChild).toMatchSnapshot();
});
describe('prop "onLoad"', () => {
test('is called after image is loaded from network', () => {
jest.useFakeTimers();