mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-05 03:09:23 +00:00
Add to Image tests
This commit is contained in:
+15
-4
@@ -132,6 +132,17 @@ exports[`components/Image prop "draggable" 1`] = `
|
|||||||
</div>
|
</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`] = `
|
exports[`components/Image prop "resizeMode" value "contain" 1`] = `
|
||||||
<div
|
<div
|
||||||
class="css-view-1dbjc4n r-flexBasis-1mlwlqe r-overflow-1udh08x r-zIndex-417010"
|
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
|
<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"
|
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
|
<svg
|
||||||
style="position: absolute; height: 0px; visibility: hidden; width: 0px;"
|
style="position: absolute; height: 0px; visibility: hidden; width: 0px;"
|
||||||
>
|
>
|
||||||
<defs>
|
<defs>
|
||||||
<filter
|
<filter
|
||||||
id="tint-53"
|
id="tint-54"
|
||||||
>
|
>
|
||||||
<feflood
|
<feflood
|
||||||
flood-color="blue"
|
flood-color="blue"
|
||||||
@@ -366,7 +377,7 @@ exports[`components/Image prop "style" supports "tintcolor" property (convert to
|
|||||||
>
|
>
|
||||||
<div
|
<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"
|
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
|
<img
|
||||||
alt=""
|
alt=""
|
||||||
@@ -379,7 +390,7 @@ exports[`components/Image prop "style" supports "tintcolor" property (convert to
|
|||||||
>
|
>
|
||||||
<defs>
|
<defs>
|
||||||
<filter
|
<filter
|
||||||
id="tint-52"
|
id="tint-53"
|
||||||
>
|
>
|
||||||
<feflood
|
<feflood
|
||||||
flood-color="red"
|
flood-color="red"
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ describe('components/Image', () => {
|
|||||||
expect(container.firstChild).toMatchSnapshot();
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('prop "nativeID"', () => {
|
||||||
|
const { container } = render(<Image nativeID="nativeID" />);
|
||||||
|
expect(container.firstChild).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
describe('prop "onLoad"', () => {
|
describe('prop "onLoad"', () => {
|
||||||
test('is called after image is loaded from network', () => {
|
test('is called after image is loaded from network', () => {
|
||||||
jest.useFakeTimers();
|
jest.useFakeTimers();
|
||||||
|
|||||||
Reference in New Issue
Block a user