-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mobile] - RichText - Use parsed font size values when comparing new …
…changes (#37951) * Mobile - RichText - Use parsed font size values when comparing new changes to avoid not matching values that generate a render loop * Mobile - E2E - Move typography test to full tests instead of canary * Mobile - RichText - Avoid using the fontSize value from the props if there's a font size set from the styles * Mobile - E2E - Remove test and move some test cases into the current integration tests * Mobile - RichTest - Update tests
- Loading branch information
Gerardo Pacheco
authored
Jan 14, 2022
1 parent
4b80bb3
commit e7eb6d8
Showing
3 changed files
with
166 additions
and
24 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
65 changes: 65 additions & 0 deletions
65
packages/rich-text/src/test/__snapshots__/index.native.js.snap
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,65 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`<RichText/> Font Size renders component with style and font size 1`] = ` | ||
"<!-- wp:paragraph {\\"style\\":{\\"color\\":{\\"text\\":\\"#fcb900\\"},\\"typography\\":{\\"fontSize\\":35.56}}} --> | ||
<p class=\\"has-text-color\\" style=\\"color:#fcb900;font-size:35.56px\\">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed imperdiet ut nibh vitae ornare. Sed auctor nec augue at blandit.</p> | ||
<!-- /wp:paragraph -->" | ||
`; | ||
exports[`<RichText/> Font Size should update the font size when style prop with font size property is provided 1`] = ` | ||
<View> | ||
<TextInput | ||
accessibilityLabel="Text input. Empty" | ||
activeFormats={Array []} | ||
blockType={ | ||
Object { | ||
"tag": "div", | ||
} | ||
} | ||
disableEditingMenu={false} | ||
fontFamily="serif" | ||
fontSize={12} | ||
isMultiline={false} | ||
maxImagesWidth={200} | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
onContentSizeChange={[Function]} | ||
onFocus={[Function]} | ||
onKeyDown={[Function]} | ||
onPaste={[Function]} | ||
onSelectionChange={[Function]} | ||
placeholderTextColor="gray" | ||
triggerKeyCodes={Array []} | ||
value="" | ||
/> | ||
</View> | ||
`; | ||
|
||
exports[`<RichText/> Font Size should update the font size with decimals when style prop with font size property is provided 1`] = ` | ||
<View> | ||
<TextInput | ||
accessibilityLabel="Text input. Empty" | ||
activeFormats={Array []} | ||
blockType={ | ||
Object { | ||
"tag": "div", | ||
} | ||
} | ||
disableEditingMenu={false} | ||
fontFamily="serif" | ||
fontSize={13} | ||
isMultiline={false} | ||
maxImagesWidth={200} | ||
onBlur={[Function]} | ||
onChange={[Function]} | ||
onContentSizeChange={[Function]} | ||
onFocus={[Function]} | ||
onKeyDown={[Function]} | ||
onPaste={[Function]} | ||
onSelectionChange={[Function]} | ||
placeholderTextColor="gray" | ||
triggerKeyCodes={Array []} | ||
value="" | ||
/> | ||
</View> | ||
`; |
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