@fluentui-react-native/tester 0.55.1 → 0.56.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.json +246 -1
  2. package/CHANGELOG.md +58 -2
  3. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  4. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  5. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +45 -1
  6. package/lib/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  7. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  8. package/lib/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  9. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  10. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  11. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  12. package/lib/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  13. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  14. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +23 -15
  15. package/lib/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  16. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  17. package/lib/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  18. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  19. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +16 -4
  20. package/lib/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  21. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  22. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +9 -3
  23. package/lib/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  24. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  25. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  26. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js +1 -0
  27. package/lib/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  28. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts +12 -0
  29. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.d.ts.map +1 -1
  30. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js +44 -0
  31. package/lib-commonjs/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.js.map +1 -1
  32. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js +35 -0
  33. package/lib-commonjs/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.js.map +1 -1
  34. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts +3 -3
  35. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.d.ts.map +1 -1
  36. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js +3 -3
  37. package/lib-commonjs/FluentTester/TestComponents/ActivityIndicator/consts.js.map +1 -1
  38. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.d.ts.map +1 -1
  39. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js +22 -14
  40. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonHOCTestSection.js.map +1 -1
  41. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.d.ts.map +1 -1
  42. package/lib-commonjs/FluentTester/TestComponents/Button/ButtonSizeTestSection.js.map +1 -1
  43. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.d.ts.map +1 -1
  44. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js +16 -4
  45. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.js.map +1 -1
  46. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.d.ts.map +1 -1
  47. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js +8 -2
  48. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.js.map +1 -1
  49. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts +1 -0
  50. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.d.ts.map +1 -1
  51. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js +2 -1
  52. package/lib-commonjs/FluentTester/TestComponents/CheckboxExperimental/consts.js.map +1 -1
  53. package/package.json +18 -19
  54. package/src/E2E/CheckboxExperimental/pages/ExperimentalCheckboxPageObject.ts +63 -0
  55. package/src/E2E/CheckboxExperimental/specs/ExperimentalCheckbox.spec.win.ts +48 -2
  56. package/src/E2E/README.md +7 -0
  57. package/src/FluentTester/TestComponents/ActivityIndicator/consts.ts +3 -3
  58. package/src/FluentTester/TestComponents/Button/ButtonHOCTestSection.tsx +25 -16
  59. package/src/FluentTester/TestComponents/Button/ButtonSizeTestSection.tsx +0 -1
  60. package/src/FluentTester/TestComponents/CheckboxExperimental/CheckboxTest.tsx +21 -10
  61. package/src/FluentTester/TestComponents/CheckboxExperimental/E2ECheckboxExperimentalTest.tsx +13 -0
  62. package/src/FluentTester/TestComponents/CheckboxExperimental/consts.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui-react-native/tester",
3
- "version": "0.55.1",
3
+ "version": "0.56.1",
4
4
  "description": "A test app to test FluentUI React Native Components during development",
5
5
  "license": "MIT",
6
6
  "author": "Microsoft <fluentuinativeowners@microsoft.com>",
@@ -27,29 +27,29 @@
27
27
  "dependencies": {
28
28
  "@fluentui-react-native/android-theme": ">=0.5.4 <1.0.0",
29
29
  "@fluentui-react-native/apple-theme": ">=0.9.10 <1.0.0",
30
- "@fluentui-react-native/badge": ">=0.0.11 <1.0.0",
31
- "@fluentui-react-native/button": ">=0.22.1 <1.0.0",
30
+ "@fluentui-react-native/badge": ">=0.0.13 <1.0.0",
31
+ "@fluentui-react-native/button": ">=0.22.4 <1.0.0",
32
32
  "@fluentui-react-native/default-theme": ">=0.9.10 <1.0.0",
33
- "@fluentui-react-native/experimental-activity-indicator": ">=0.5.12 <1.0.0",
34
- "@fluentui-react-native/experimental-avatar": ">=0.14.4 <1.0.0",
35
- "@fluentui-react-native/experimental-button": "0.15.1",
36
- "@fluentui-react-native/experimental-checkbox": "0.6.7",
33
+ "@fluentui-react-native/experimental-activity-indicator": ">=0.5.13 <1.0.0",
34
+ "@fluentui-react-native/experimental-avatar": ">=0.14.5 <1.0.0",
35
+ "@fluentui-react-native/experimental-button": "0.15.4",
36
+ "@fluentui-react-native/experimental-checkbox": "0.7.0",
37
37
  "@fluentui-react-native/experimental-native-date-picker": ">=0.4.1 <1.0.0",
38
- "@fluentui-react-native/experimental-expander": "0.3.13",
39
- "@fluentui-react-native/experimental-menu-button": ">=0.3.10 <1.0.0",
40
- "@fluentui-react-native/experimental-shimmer": "0.6.15",
41
- "@fluentui-react-native/experimental-tabs": "0.4.21",
42
- "@fluentui-react-native/experimental-text": ">=0.7.13 <1.0.0",
43
- "@fluentui-react-native/framework": ">=0.7.13 <1.0.0",
44
- "@fluentui-react-native/icon": "0.11.7",
45
- "@fluentui-react-native/interactive-hooks": ">=0.13.1 <1.0.0",
46
- "@fluentui-react-native/stack": ">=0.6.13 <1.0.0",
38
+ "@fluentui-react-native/experimental-expander": "0.3.14",
39
+ "@fluentui-react-native/experimental-menu-button": ">=0.3.13 <1.0.0",
40
+ "@fluentui-react-native/experimental-shimmer": "0.6.16",
41
+ "@fluentui-react-native/experimental-tabs": "0.4.23",
42
+ "@fluentui-react-native/experimental-text": ">=0.7.14 <1.0.0",
43
+ "@fluentui-react-native/framework": ">=0.7.14 <1.0.0",
44
+ "@fluentui-react-native/icon": "0.11.9",
45
+ "@fluentui-react-native/interactive-hooks": ">=0.13.3 <1.0.0",
46
+ "@fluentui-react-native/stack": ">=0.6.14 <1.0.0",
47
47
  "@fluentui-react-native/theme": ">=0.6.4 <1.0.0",
48
48
  "@fluentui-react-native/theme-types": ">=0.13.3 <1.0.0",
49
49
  "@fluentui-react-native/themed-stylesheet": "^1.3.2",
50
50
  "@fluentui-react-native/theming-utils": ">=0.8.10 <1.0.0",
51
51
  "@fluentui-react-native/win32-theme": ">=0.14.11 <1.0.0",
52
- "@fluentui/react-native": ">=0.27.31 <1.0.0",
52
+ "@fluentui/react-native": ">=0.27.34 <1.0.0",
53
53
  "@react-native-community/slider": "^4.2.0",
54
54
  "@react-native-menu/menu": "^0.1.2",
55
55
  "@react-native-picker/picker": "^2.2.1",
@@ -76,10 +76,9 @@
76
76
  "react-native": "^0.64.2",
77
77
  "react-native-macos": "^0.64.0",
78
78
  "react-native-svg": "^12.1.1",
79
- "react-native-svg-transformer": "^0.14.3",
79
+ "react-native-svg-transformer": "^1.0.0",
80
80
  "react-native-windows": "^0.64.0",
81
81
  "react-test-renderer": "17.0.1",
82
- "rnpm-plugin-windows": "^0.5.1-0",
83
82
  "ts-node": "^8.10.1",
84
83
  "tsconfig-paths": "^3.9.0",
85
84
  "typescript": "4.5.4",
@@ -3,10 +3,73 @@ import {
3
3
  EXPERIMENTAL_CHECKBOX_TESTPAGE,
4
4
  EXPERIMENTAL_CHECKBOX_TEST_COMPONENT,
5
5
  EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT,
6
+ EXPERIMENTAL_CHECKBOX_ON_PRESS,
6
7
  } from '../../../FluentTester/TestComponents/CheckboxExperimental/consts';
7
8
  import { BasePage, By } from '../../common/BasePage.win';
8
9
 
10
+ /* This enum gives the spec file an EASY way to interact with SPECIFIC UI elements on the page.
11
+ * The spec file should import this enum and use it when wanting to interact with different elements on the page. */
12
+ export const enum ExperimentalCheckboxSelector {
13
+ Primary, //this._primaryComponent
14
+ }
15
+
9
16
  class ExperimentalCheckboxPageObject extends BasePage {
17
+ /******************************************************************/
18
+ /**************** UI Element Interaction Methods ******************/
19
+ /******************************************************************/
20
+ isCheckboxChecked(): boolean {
21
+ return this._primaryComponent.isSelected();
22
+ }
23
+
24
+ waitForCheckboxChecked(timeout?: number): void {
25
+ browser.waitUntil(
26
+ () => {
27
+ return this.isCheckboxChecked();
28
+ },
29
+ {
30
+ timeout: timeout ?? this.waitForPageTimeout,
31
+ timeoutMsg: 'The Checkbox was not toggled correctly',
32
+ interval: 1000,
33
+ },
34
+ );
35
+ }
36
+
37
+ /* Useful in beforeEach() hook to reset the checkbox before every test */
38
+ toggleCheckboxToUnchecked(): void {
39
+ if (this.isCheckboxChecked()) {
40
+ this._primaryComponent.click();
41
+ }
42
+ }
43
+
44
+ didOnChangeCallbackFire(): boolean {
45
+ const callbackText = By(EXPERIMENTAL_CHECKBOX_ON_PRESS);
46
+ browser.waitUntil(
47
+ () => {
48
+ return callbackText.isDisplayed();
49
+ },
50
+ {
51
+ timeout: this.waitForPageTimeout,
52
+ timeoutMsg: 'The OnChange callback did not fire.',
53
+ interval: 1000,
54
+ },
55
+ );
56
+
57
+ return callbackText.isDisplayed();
58
+ }
59
+
60
+ /* Sends a Keyboarding command on a specific UI element */
61
+ sendKey(selector: ExperimentalCheckboxSelector, key: string): void {
62
+ this.getCheckboxSelector(selector).addValue(key);
63
+ }
64
+
65
+ /* Returns the correct WebDriverIO element from the Checkbox Selector */
66
+ getCheckboxSelector(selector?: ExperimentalCheckboxSelector): WebdriverIO.Element {
67
+ if (selector == ExperimentalCheckboxSelector.Primary) {
68
+ return this._primaryComponent;
69
+ }
70
+ return this._primaryComponent;
71
+ }
72
+
10
73
  /*****************************************/
11
74
  /**************** Getters ****************/
12
75
  /*****************************************/
@@ -1,11 +1,11 @@
1
1
  import NavigateAppPage from '../../common/NavigateAppPage.win';
2
- import ExperimentalCheckboxPageObject from '../pages/ExperimentalCheckboxPageObject';
2
+ import ExperimentalCheckboxPageObject, { ExperimentalCheckboxSelector } from '../pages/ExperimentalCheckboxPageObject';
3
3
  import { ComponentSelector } from '../../common/BasePage.win';
4
4
  import {
5
5
  EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL,
6
6
  EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL,
7
7
  } from '../../../FluentTester/TestComponents/CheckboxExperimental/consts';
8
- import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, CHECKBOX_A11Y_ROLE } from '../../common/consts';
8
+ import { PAGE_TIMEOUT, BOOT_APP_TIMEOUT, CHECKBOX_A11Y_ROLE, Keys } from '../../common/consts';
9
9
 
10
10
  describe('Experimental Checkbox Testing Initialization', () => {
11
11
  it('Wait for app load', () => {
@@ -28,6 +28,12 @@ describe('Experimental Checkbox Testing Initialization', () => {
28
28
  });
29
29
 
30
30
  describe('Experimental Checkbox Accessibility Testing', () => {
31
+ /* Scrolls and waits for the Checkbox to be visible on the Test Page */
32
+ beforeEach(() => {
33
+ ExperimentalCheckboxPageObject.scrollToTestElement();
34
+ ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
35
+ });
36
+
31
37
  it('Experimental Checkbox - Validate accessibilityRole is correct', () => {
32
38
  ExperimentalCheckboxPageObject.scrollToTestElement();
33
39
  ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
@@ -56,3 +62,43 @@ describe('Experimental Checkbox Accessibility Testing', () => {
56
62
  expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
57
63
  });
58
64
  });
65
+
66
+ describe('Checkbox Functional Testing', () => {
67
+ /* Scrolls and waits for the Checkbox to be visible on the Test Page AND un-checks the Checkbox */
68
+ beforeEach(() => {
69
+ ExperimentalCheckboxPageObject.scrollToTestElement();
70
+ ExperimentalCheckboxPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
71
+
72
+ ExperimentalCheckboxPageObject.toggleCheckboxToUnchecked();
73
+ });
74
+
75
+ it("Click on a Checkbox -> Validate it toggles correctly AND calls the user's onChange", () => {
76
+ /* Validate the Checkbox is initially toggled OFF */
77
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeFalsy();
78
+
79
+ /* Click on the Checkbox to toggle on */
80
+ ExperimentalCheckboxPageObject.clickComponent();
81
+ ExperimentalCheckboxPageObject.waitForCheckboxChecked(PAGE_TIMEOUT);
82
+
83
+ expect(ExperimentalCheckboxPageObject.didOnChangeCallbackFire()).toBeTruthy();
84
+
85
+ /* Validate the Checkbox is toggled ON */
86
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeTruthy();
87
+
88
+ ExperimentalCheckboxPageObject.clickComponent();
89
+
90
+ /* Validate the Checkbox is toggled OFF */
91
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeFalsy();
92
+ expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
93
+ });
94
+
95
+ it('Click the "Spacebar" on a Checkbox and verify it toggles', () => {
96
+ /* Presses the "space bar" to select the Checkbox */
97
+ ExperimentalCheckboxPageObject.sendKey(ExperimentalCheckboxSelector.Primary, Keys.Spacebar);
98
+ ExperimentalCheckboxPageObject.waitForCheckboxChecked(PAGE_TIMEOUT);
99
+
100
+ /* Validate the Checkbox is selected */
101
+ expect(ExperimentalCheckboxPageObject.isCheckboxChecked()).toBeTruthy();
102
+ expect(ExperimentalCheckboxPageObject.didAssertPopup()).toBeFalsy(ExperimentalCheckboxPageObject.ERRORMESSAGE_ASSERT);
103
+ });
104
+ });
package/src/E2E/README.md CHANGED
@@ -94,6 +94,13 @@ You'll want to make one for your component under **apps/fluent-tester/src/Fluent
94
94
 
95
95
  **You can simply copy/paste a _consts.ts_ file from another component, and just change the name of the component in the const names and the values.**
96
96
 
97
+ **This is really important!**
98
+
99
+ There are a **two specific** naming conventions we need to follow to keep in-sync with the Native side.
100
+
101
+ 1. The button that navigates to each test page - **Homepage\_'componentName'\_Button**
102
+ 2. The test page itself that lets us validate if the page loaded - **'componentName'\_TestPage**
103
+
97
104
  Now, what are Page Objects and Spec Documents?
98
105
 
99
106
  ## Page Objects
@@ -1,5 +1,5 @@
1
- export const HOMEPAGE_ACTIVITY_INDICATOR_BUTTON = 'HOMEPAGE_ACTIVITY_INDICATOR_BUTTON';
2
- export const ACTIVITY_INDICATOR_TESTPAGE = 'ACTIVITY_INDICATOR_TESTPAGE';
1
+ export const HOMEPAGE_ACTIVITY_INDICATOR_BUTTON = 'Homepage_ActivityIndicator_Button';
2
+ export const ACTIVITY_INDICATOR_TESTPAGE = 'ActivityIndicator_TestPage';
3
3
 
4
4
  /* Test ActivityIndicator 1 */
5
- export const ACTIVITY_INDICATOR_TEST_COMPONENT = 'Activity_Indicator_Test_Component'; // A component on each specific test page
5
+ export const ACTIVITY_INDICATOR_TEST_COMPONENT = 'ActivityIndicator_Test_Component'; // A component on each specific test page
@@ -1,32 +1,41 @@
1
1
  import { ButtonV1 as Button } from '@fluentui-react-native/button';
2
2
  import { Text } from '@fluentui-react-native/experimental-text';
3
- import { Icon } from '@fluentui-react-native/icon';
3
+ import { Icon, SvgIconProps } from '@fluentui-react-native/icon';
4
4
  import * as React from 'react';
5
- import { View } from 'react-native';
5
+ import { Platform, View } from 'react-native';
6
6
  import { commonTestStyles, stackStyle } from '../Common/styles';
7
+ import TestSvg from './test.svg';
8
+
9
+ const CustomText = Text.customize({ fontSize: 'header', color: 'hotpink' });
10
+ const CustomButton = Button.customize({ backgroundColor: 'pink' });
11
+ const CustomIconButton = Button.customize({ iconColor: 'yellow' });
12
+ const ComposedButton = Button.compose({
13
+ slots: {
14
+ root: View,
15
+ icon: Icon,
16
+ content: CustomText,
17
+ },
18
+ slotProps: {
19
+ content: {
20
+ style: { marginTop: -1, marginBottom: 1, marginStart: 0, marginEnd: -2 },
21
+ },
22
+ },
23
+ });
24
+ const svgProps: SvgIconProps = {
25
+ src: TestSvg,
26
+ viewBox: '0 0 500 500',
27
+ };
7
28
 
8
29
  export const ButtonHOCTest: React.FunctionComponent = () => {
9
30
  const buttonRef = React.useRef(null);
10
- const CustomText = Text.customize({ fontSize: 'header', color: 'hotpink' });
11
- const CustomButton = Button.customize({ backgroundColor: 'pink' });
12
- const ComposedButton = Button.compose({
13
- slots: {
14
- root: View,
15
- icon: Icon,
16
- content: CustomText,
17
- },
18
- slotProps: {
19
- content: {
20
- style: { marginTop: -1, marginBottom: 1, marginStart: 0, marginEnd: -2 },
21
- },
22
- },
23
- });
31
+ const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
24
32
 
25
33
  return (
26
34
  <View style={stackStyle}>
27
35
  <CustomButton style={commonTestStyles.vmargin} componentRef={buttonRef}>
28
36
  Customized Button with ref
29
37
  </CustomButton>
38
+ {svgIconsEnabled && <CustomIconButton icon={{ svgSource: svgProps }}>Customized Icon Button</CustomIconButton>}
30
39
  <Button
31
40
  style={commonTestStyles.vmargin}
32
41
  onClick={() => {
@@ -11,7 +11,6 @@ export const ButtonSizeTest: React.FunctionComponent = () => {
11
11
  viewBox: '0 0 500 500',
12
12
  };
13
13
  const svgIconsEnabled = ['ios', 'macos', 'win32', 'android'].includes(Platform.OS as string);
14
-
15
14
  return (
16
15
  <View style={[stackStyle, commonTestStyles.view]}>
17
16
  {svgIconsEnabled && (
@@ -16,16 +16,23 @@ const basicCheckbox: React.FunctionComponent = () => {
16
16
  <View>
17
17
  <Checkbox label="Unchecked checkbox (undefined)" onChange={onChangeUncontrolled} />
18
18
  <Checkbox label="Unchecked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked={false} />
19
- <Checkbox
20
- label="Checked checkbox (uncontrolled)"
21
- onChange={onChangeUncontrolled}
22
- defaultChecked={true}
23
- accessibilityLabel="Hello there"
24
- />
25
- <Checkbox label="Disabled checkbox" onChange={onChangeUncontrolled} defaultChecked={false} disabled={true} />
26
- <Checkbox label="Disabled checked checkbox" onChange={onChangeUncontrolled} defaultChecked={true} disabled={true} />
27
- <Checkbox label="Checkbox will display a tooltip" onChange={onChangeUncontrolled} tooltip="This is a tooltip" />
28
- <Checkbox label="A circular checkbox" circular onChange={onChangeUncontrolled} defaultChecked={false} />
19
+ <Checkbox label="Checked checkbox (uncontrolled)" onChange={onChangeUncontrolled} defaultChecked accessibilityLabel="Hello there" />
20
+ <Checkbox label="Disabled checkbox" disabled />
21
+ <Checkbox label="Disabled checked checkbox" defaultChecked disabled />
22
+ <Checkbox label="Checkbox will display a tooltip" tooltip="This is a tooltip" />
23
+ <Checkbox label="A circular checkbox" circular />
24
+ <Checkbox label="A circular checkbox" labelPosition="before" />
25
+ </View>
26
+ );
27
+ };
28
+
29
+ const sizeCheckbox: React.FunctionComponent = () => {
30
+ return (
31
+ <View>
32
+ <Checkbox tooltip="Medium checkbox" size="medium" />
33
+ <Checkbox tooltip="Large checkbox" size="large" />
34
+ <Checkbox label="Medium checkbox" size="medium" />
35
+ <Checkbox label="Large checkbox" size="large" />
29
36
  </View>
30
37
  );
31
38
  };
@@ -134,6 +141,10 @@ const checkboxSections: TestSection[] = [
134
141
  testID: EXPERIMENTAL_CHECKBOX_TESTPAGE,
135
142
  component: basicCheckbox,
136
143
  },
144
+ {
145
+ name: 'Size Checkboxes',
146
+ component: sizeCheckbox,
147
+ },
137
148
  {
138
149
  name: 'Other Implementations',
139
150
  component: otherCheckbox,
@@ -7,10 +7,21 @@ import {
7
7
  EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL,
8
8
  EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT,
9
9
  EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL,
10
+ EXPERIMENTAL_CHECKBOX_ON_PRESS,
10
11
  } from './consts';
11
12
  import { Stack } from '@fluentui-react-native/stack';
13
+ import { Text } from '@fluentui/react-native';
12
14
 
13
15
  export const E2ECheckboxExperimentalTest: React.FunctionComponent = () => {
16
+ const [checkboxPressed, setCheckboxPressed] = React.useState(false);
17
+
18
+ const onClick = React.useCallback(
19
+ (checked) => {
20
+ setCheckboxPressed(checked);
21
+ },
22
+ [setCheckboxPressed],
23
+ );
24
+
14
25
  return (
15
26
  <View>
16
27
  <Stack style={stackStyle}>
@@ -19,8 +30,10 @@ export const E2ECheckboxExperimentalTest: React.FunctionComponent = () => {
19
30
  disabled={false}
20
31
  label="Testing accessibilityLabel"
21
32
  testID={EXPERIMENTAL_CHECKBOX_TEST_COMPONENT}
33
+ onChange={onClick}
22
34
  />
23
35
  <Checkbox label={EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL} testID={EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT} />
36
+ {checkboxPressed ? <Text testID={EXPERIMENTAL_CHECKBOX_ON_PRESS}>Checkbox Selected</Text> : null}
24
37
  </Stack>
25
38
  </View>
26
39
  );
@@ -8,3 +8,5 @@ export const EXPERIMENTAL_CHECKBOX_ACCESSIBILITY_LABEL = 'E2E testing Experiment
8
8
  /* Test Experimental Checkbox 2 */
9
9
  export const EXPERIMENTAL_CHECKBOX_NO_A11Y_LABEL_COMPONENT = 'Experimental Checkbox_No_A11y_label_Component';
10
10
  export const EXPERIMENTAL_CHECKBOX_TEST_COMPONENT_LABEL = 'Test Experimental Checkbox2 - No Accessibility Label'; // A component on each specific test page
11
+
12
+ export const EXPERIMENTAL_CHECKBOX_ON_PRESS = 'Experimental_Checkbox_On_Press'; // For testing the press functionality on a Checkbox