Fix TextInput-cursorPlacement test

Summary:
Changelog:
[Internal] -  In internal e2e testing, json.stringify is unstable and will occasionally re-order keys. Fix so it's consistent across tests

Reviewed By: kacieb

Differential Revision: D28397174

fbshipit-source-id: 0f2db697d245654c88c3dff3d083bc82890d4bc1
This commit is contained in:
Luna Wei 2021-05-18 18:17:44 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 6b713f519f
Коммит ec2dc9e4f2
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -367,7 +367,7 @@ class TokenizedTextExample extends React.Component<
type SelectionExampleState = { type SelectionExampleState = {
selection: $ReadOnly<{| selection: $ReadOnly<{|
start: number, start: number,
end?: number, end: number,
|}>, |}>,
value: string, value: string,
... ...
@ -436,7 +436,8 @@ class SelectionExample extends React.Component<
</View> </View>
<View> <View>
<Text testID={`${this.props.testID}-selection`}> <Text testID={`${this.props.testID}-selection`}>
selection = {JSON.stringify(this.state.selection).replace(/"/g, '')} selection ={' '}
{`{start:${this.state.selection.start},end:${this.state.selection.end}}`}
</Text> </Text>
<Text <Text
testID={`${this.props.testID}-cursor-start`} testID={`${this.props.testID}-cursor-start`}