5
5
* @format
6
6
*/
7
7
8
- // import {dumpVisualTree} from '@react-native-windows/automation-commands';
8
+ import { dumpVisualTree } from '@react-native-windows/automation-commands' ;
9
9
import { goToComponentExample } from './RNTesterNavigation' ;
10
10
import { verifyNoErrorLogs } from './Helpers' ;
11
11
import { app } from '@react-native-windows/automation' ;
@@ -22,48 +22,44 @@ afterEach(async () => {
22
22
} ) ;
23
23
24
24
describe ( 'Button Tests' , ( ) => {
25
- test ( 'Control' , ( ) => {
26
- expect ( true ) . toBe ( true ) ;
25
+ test ( 'Buttons have default styling' , async ( ) => {
26
+ const component = await app . findElementByTestID ( 'button_default_styling' ) ;
27
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
28
+ const dump = await dumpVisualTree ( 'button_default_styling' ) ;
29
+ expect ( dump ) . toMatchSnapshot ( ) ;
30
+ } ) ;
31
+ test ( 'Buttons can have custom colors' , async ( ) => {
32
+ const component = await app . findElementByTestID ( 'cancel_button' ) ;
33
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
34
+ const dump = await dumpVisualTree ( 'cancel_button' ) ;
35
+ expect ( dump ) . toMatchSnapshot ( ) ;
36
+ } ) ;
37
+ test ( 'Buttons can be disabled' , async ( ) => {
38
+ const component = await app . findElementByTestID ( 'disabled_button' ) ;
39
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
40
+ const dump = await dumpVisualTree ( 'disabled_button' ) ;
41
+ expect ( dump ) . toMatchSnapshot ( ) ;
42
+ } ) ;
43
+ test ( 'Buttons can have accessibility labels' , async ( ) => {
44
+ const component = await app . findElementByTestID (
45
+ 'accessibilityLabel_button' ,
46
+ ) ;
47
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
48
+ const dump = await dumpVisualTree ( 'accessibilityLabel_button' ) ;
49
+ expect ( dump ) . toMatchSnapshot ( ) ;
50
+ } ) ;
51
+ test ( 'Buttons can have accessibility states' , async ( ) => {
52
+ const component = await app . findElementByTestID (
53
+ 'accessibilityState_button' ,
54
+ ) ;
55
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
56
+ const dump = await dumpVisualTree ( 'accessibilityState_button' ) ;
57
+ expect ( dump ) . toMatchSnapshot ( ) ;
58
+ } ) ;
59
+ test ( 'Buttons can have accessibility props' , async ( ) => {
60
+ const component = await app . findElementByTestID ( 'accessibility_props' ) ;
61
+ await component . waitForDisplayed ( { timeout : 5000 } ) ;
62
+ const dump = await dumpVisualTree ( 'accessibility_props' ) ;
63
+ expect ( dump ) . toMatchSnapshot ( ) ;
27
64
} ) ;
28
- // Disable until tests pass CI
29
- // test('Buttons have default styling', async () => {
30
- // const component = await app.findElementByTestID('button_default_styling');
31
- // await component.waitForDisplayed({timeout: 5000});
32
- // const dump = await dumpVisualTree('button_default_styling');
33
- // expect(dump).toMatchSnapshot();
34
- // });
35
- // test('Buttons can have custom colors', async () => {
36
- // const component = await app.findElementByTestID('cancel_button');
37
- // await component.waitForDisplayed({timeout: 5000});
38
- // const dump = await dumpVisualTree('cancel_button');
39
- // expect(dump).toMatchSnapshot();
40
- // });
41
- // test('Buttons can be disabled', async () => {
42
- // const component = await app.findElementByTestID('disabled_button');
43
- // await component.waitForDisplayed({timeout: 5000});
44
- // const dump = await dumpVisualTree('disabled_button');
45
- // expect(dump).toMatchSnapshot();
46
- // });
47
- // test('Buttons can have accessibility labels', async () => {
48
- // const component = await app.findElementByTestID(
49
- // 'accessibilityLabel_button',
50
- // );
51
- // await component.waitForDisplayed({timeout: 5000});
52
- // const dump = await dumpVisualTree('accessibilityLabel_button');
53
- // expect(dump).toMatchSnapshot();
54
- // });
55
- // test('Buttons can have accessibility states', async () => {
56
- // const component = await app.findElementByTestID(
57
- // 'accessibilityState_button',
58
- // );
59
- // await component.waitForDisplayed({timeout: 5000});
60
- // const dump = await dumpVisualTree('accessibilityState_button');
61
- // expect(dump).toMatchSnapshot();
62
- // });
63
- // test('Buttons can have accessibility props', async () => {
64
- // const component = await app.findElementByTestID('accessibility_props');
65
- // await component.waitForDisplayed({timeout: 5000});
66
- // const dump = await dumpVisualTree('accessibility_props');
67
- // expect(dump).toMatchSnapshot();
68
- // });
69
65
} ) ;
0 commit comments