mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add Fantom test for Text.selectable (#53168)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53168 # Changelog: [Internal]- Adds Fantom test for `Text.selectable` prop. Reviewed By: andrewdacenko Differential Revision: D79885301 fbshipit-source-id: d66895397ee0bbcfedc3f744ae8138d2741b2b1e
This commit is contained in:
1 parent
5b9063ed70
commit
afb6294335
1 file changed
+34
@@ -183,6 +183,40 @@ describe('<Text>', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('selectable', () => {
|
||||
it(`can be set to "true"`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text selectable={true}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph selectable={'true'}>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
|
||||
it(`has 'false' as default`, () => {
|
||||
const root = Fantom.createRoot();
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
|
||||
Fantom.runTask(() => {
|
||||
root.render(<Text selectable={false}>{TEST_TEXT}</Text>);
|
||||
});
|
||||
|
||||
expect(root.getRenderedOutput({props: ['selectable']}).toJSX()).toEqual(
|
||||
<rn-paragraph>{TEST_TEXT}</rn-paragraph>,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('style', () => {
|
||||
describe('writingDirection', () => {
|
||||
it('propagates to mounting layer', () => {
|
||||
|
||||
Reference in new issue
Block a user