-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Bunch of style properties fixes and TreeDump utility updates #3793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
3d188ef
cd32886
d2ab520
4e8a582
f86d041
1807354
2df337e
f9882a6
3f987ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "type": "prerelease", | ||
| "comment": "Fix cornerRadius issue for TextInput and some updates to TreeDump", | ||
| "packageName": "react-native-windows", | ||
| "email": "[email protected]", | ||
| "commit": "d2ab5205ec27f1784a54a82236c54b9c13531412", | ||
| "date": "2019-12-17T21:09:02.950Z" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,4 +3,5 @@ | |
| /build | ||
| /reports | ||
| /dist | ||
| /windows/ReactUWPTestApp/Bundle/ | ||
| /windows/ReactUWPTestApp/Bundle/ | ||
| msbuild.binlog | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /** | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import { Switch, CheckBox, TextInput, View, StyleSheet, Button } from 'react-native'; | ||
| import {DatePicker, Picker} from 'react-native-windows'; | ||
| import React, { useState } from 'react'; | ||
| import {SHOWBORDER_ON_CONTROLSTYLE, TREE_DUMP_RESULT} from './Consts'; | ||
| import {TreeDumpControl} from './TreeDump' | ||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
| padding: 20 | ||
| }, | ||
| regularBorder: { | ||
| height: 50, | ||
| backgroundColor: 'rgba(225,225,225,0.2)', | ||
| borderWidth:1, | ||
| borderColor: '#ff00ff55', | ||
| marginBottom: 10, | ||
| padding: 10, | ||
| color: '#fff' | ||
| }, | ||
| roundBorder: { | ||
| height: 50, | ||
| backgroundColor: 'rgba(0,0,0,0.2)', | ||
| marginBottom: 10, | ||
| padding: 10, | ||
| color: '#000', | ||
| borderRadius: 10.0, | ||
| borderWidth:10, | ||
| borderColor: '#00ff0055', | ||
| }, | ||
| buttonText: { | ||
| color: '#fff', | ||
| textAlign: 'center', | ||
| fontWeight: '700', | ||
| borderRadius: 10.0, | ||
| }, | ||
| treeDumpControl: { | ||
| height: 150, | ||
| width: 500, | ||
| margin: 10, | ||
| }, | ||
| }); | ||
|
|
||
| export function ControlStylePage() { | ||
|
||
| const [showRoundBorder, setShowRoundBorder] = useState(false); | ||
|
|
||
| const onPressShowRoundBorder = () => { | ||
| var previousState = showRoundBorder; | ||
| setShowRoundBorder(!previousState); | ||
| } | ||
|
|
||
| return ( | ||
| <View> | ||
| <View testID={'ControlStyleView'}> | ||
| <Switch style={showRoundBorder? styles.roundBorder :styles.regularBorder} thumbColor='blue'/> | ||
| <CheckBox style={showRoundBorder? styles.roundBorder :styles.regularBorder} /> | ||
| <TextInput style={showRoundBorder? styles.roundBorder :styles.regularBorder} | ||
| placeholder='TextBox' | ||
| placeholderTextColor='rgba(225,225,225,0.7)' | ||
| editable={false} /> | ||
|
|
||
| <TextInput style={showRoundBorder? styles.roundBorder :styles.regularBorder} | ||
| placeholder='Password' | ||
| placeholderTextColor='rgba(225,225,225,0.7)' | ||
| secureTextEntry = {true} | ||
| editable={false}/> | ||
| <DatePicker style={showRoundBorder? styles.roundBorder :styles.regularBorder}/> | ||
| <Picker style={showRoundBorder? styles.roundBorder :styles.regularBorder}/> | ||
| </View> | ||
|
|
||
| <Button title= {showRoundBorder?"Hide Round Border":"Show Round Border"} | ||
| onPress={onPressShowRoundBorder} | ||
| testID={SHOWBORDER_ON_CONTROLSTYLE}/> | ||
|
|
||
| <TreeDumpControl style={styles.treeDumpControl} dumpID={showRoundBorder?'ControlStyleRoundBorder':'ControlStyleRegularBorder'} uiaID={'ControlStyleView'} testID={TREE_DUMP_RESULT} /> | ||
|
|
||
| </View >); | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,10 +3,10 @@ | |
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import {StyleSheet, View, Image, Button, requireNativeComponent} from 'react-native' | ||
| import {StyleSheet, View, Image, Button} from 'react-native' | ||
| import React, { useState } from 'react'; | ||
| import { TREE_DUMP_RESULT, SHOW_IMAGE_BORDER, IMAGE_CONTAINER } from './Consts'; | ||
| const TreeDumpControl = requireNativeComponent('TreeDumpControl'); | ||
| import { SHOW_IMAGE_BORDER, IMAGE_CONTAINER, TREE_DUMP_RESULT } from './Consts'; | ||
| import {TreeDumpControl} from './TreeDump' | ||
|
||
|
|
||
| const styles = StyleSheet.create({ | ||
| container: { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| import { requireNativeComponent } from 'react-native'; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copyright #Closed |
||
| export const TreeDumpControl = requireNativeComponent('TreeDumpControl'); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
the filename to be TreeDumpControl.ts? #Closed |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /** | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import { BasePage, By } from './BasePage'; | ||
| import { SHOWBORDER_ON_CONTROLSTYLE } from '../../app/Consts'; | ||
|
|
||
| class TextInputStyleTestPage extends BasePage { | ||
|
||
| backToHomePage() { | ||
| this.homeButton.click(); | ||
| this.waitForPageLoaded(); | ||
| } | ||
|
|
||
| isPageLoaded() { | ||
| return super.isPageLoaded(); | ||
| } | ||
|
|
||
| toggleControlBorder() { | ||
| this._controlBorder.click(); | ||
| } | ||
|
|
||
| private get _controlBorder() { | ||
| return By(SHOWBORDER_ON_CONTROLSTYLE); | ||
| } | ||
| } | ||
|
|
||
| export default new TextInputStyleTestPage(); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /** | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import HomePage from '../pages/HomePage'; | ||
| import ControlStyleTestPage from '../pages/ControlStylePage'; | ||
| import assert from 'assert'; | ||
|
|
||
| beforeAll(() => { | ||
| HomePage.backToHomePage(); | ||
| HomePage.clickAndGotoControlStylePage(); | ||
| }); | ||
|
|
||
| describe('ControlStyleTest', () => { | ||
| /* Test case #1: Controls style with regular border */ | ||
| it('ControlStyleTestWithRegularBorder', () => { | ||
| const result = ControlStyleTestPage.getTreeDumpResult(); | ||
| assert( | ||
| result, | ||
| '#1. Dump comparison for Control style with regular border!' | ||
| ); | ||
| }); | ||
|
|
||
| /* Test case #2: Click button once, update controls style and round border*/ | ||
| it('ControlStyleTestWithRoundBorder', () => { | ||
| ControlStyleTestPage.toggleControlBorder(); | ||
| const result = ControlStyleTestPage.getTreeDumpResult(); | ||
| assert(result, '#2. Dump comparison for Control style with round border!'); | ||
| }); | ||
|
|
||
| /* Test case #3: Click button one more, return to #1*/ | ||
| it('ControlStyleTestWithRegularBorder #2', () => { | ||
| ControlStyleTestPage.toggleControlBorder(); | ||
| const result = ControlStyleTestPage.getTreeDumpResult(); | ||
| assert( | ||
| result, | ||
| '#3. Second dump comparison for Control style with regular border!' | ||
| ); | ||
| }); | ||
| }); |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add spaces
{ DatePicker.. }
apply to other import too #Closed