Skip to content

Commit

Permalink
tests: provide regression against #384, bloated translated image
Browse files Browse the repository at this point in the history
  • Loading branch information
jsamr committed Jul 20, 2020
1 parent 51f55bf commit 4388f7b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/__tests__/regression.384.html-bloated-image.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";
import HTML from "../HTML";
import { render } from "react-native-testing-library";
import HTMLImage from "../HTMLImage";

/**
* /~https://github.com/archriss/react-native-render-html/issues/384
**/
describe("HTML component", () => {
describe("should pass regression regarding HTML props passed to image renderer", () => {
it("translated image elements should not contain a renderers prop", () => {
const { UNSAFE_getByType } = render(<HTML renderers={{}} html='<img src="https://img.com/1"/>' />);
const image = UNSAFE_getByType(HTMLImage);
expect(image.props.renderers).toBeUndefined();
});
});
});

0 comments on commit 4388f7b

Please sign in to comment.