-
-
Notifications
You must be signed in to change notification settings - Fork 591
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: provide regression against #344, CSS Text inline inheritance …
…override
- Loading branch information
Showing
2 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/__tests__/regression.344.css-inline-inheritance-override.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { StyleSheet } from "react-native"; | ||
import HTML from "../index"; | ||
import { render } from "react-native-testing-library"; | ||
|
||
/** | ||
* https://github.com/archriss/react-native-render-html/issues/344 | ||
*/ | ||
// Skipped because a fix will require an important refactoring | ||
// eslint-disable-next-line jest/no-disabled-tests | ||
describe.skip("HTML component should pass regression #344", () => { | ||
it("when anchors nested in paragraphs have their tagStyles overriden by inline inheritance", () => { | ||
const tagsStyles = { | ||
p: { | ||
color: "red", | ||
}, | ||
a: { | ||
color: "green", | ||
}, | ||
}; | ||
const { getByTestId } = render( | ||
<HTML | ||
tagsStyles={tagsStyles} | ||
html='<p><img src="https://img.com/1"/>foo<a>bar</a></p>' | ||
/> | ||
); | ||
const text = getByTestId("a-renderer"); | ||
expect(StyleSheet.flatten(text.props.style)).toMatchObject({ | ||
color: "green", | ||
}); | ||
}); | ||
}); |