@fluentui-react-native/tester 0.155.4 → 0.156.0

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 (30) hide show
  1. package/CHANGELOG.json +73 -1
  2. package/CHANGELOG.md +25 -2
  3. package/ios/Podfile.lock +235 -235
  4. package/lib/E2E/src/FocusZone/pages/FocusZonePageObject.d.ts.map +1 -1
  5. package/lib/E2E/src/FocusZone/pages/FocusZonePageObject.js +75 -35
  6. package/lib/E2E/src/FocusZone/pages/FocusZonePageObject.js.map +1 -1
  7. package/lib/E2E/src/common/BasePage.d.ts +4 -12
  8. package/lib/E2E/src/common/BasePage.d.ts.map +1 -1
  9. package/lib/E2E/src/common/BasePage.js +85 -89
  10. package/lib/E2E/src/common/BasePage.js.map +1 -1
  11. package/lib/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.d.ts.map +1 -1
  12. package/lib/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.js +102 -12
  13. package/lib/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.js.map +1 -1
  14. package/lib/fluent-tester/src/testPages.js +1 -1
  15. package/lib/fluent-tester/src/testPages.js.map +1 -1
  16. package/lib-commonjs/E2E/src/FocusZone/pages/FocusZonePageObject.d.ts.map +1 -1
  17. package/lib-commonjs/E2E/src/FocusZone/pages/FocusZonePageObject.js +75 -35
  18. package/lib-commonjs/E2E/src/FocusZone/pages/FocusZonePageObject.js.map +1 -1
  19. package/lib-commonjs/E2E/src/common/BasePage.d.ts +4 -12
  20. package/lib-commonjs/E2E/src/common/BasePage.d.ts.map +1 -1
  21. package/lib-commonjs/E2E/src/common/BasePage.js +85 -89
  22. package/lib-commonjs/E2E/src/common/BasePage.js.map +1 -1
  23. package/lib-commonjs/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.d.ts.map +1 -1
  24. package/lib-commonjs/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.js +100 -10
  25. package/lib-commonjs/fluent-tester/src/TestComponents/NativeDatePicker/NativeDatePickerTest.js.map +1 -1
  26. package/lib-commonjs/fluent-tester/src/testPages.js +1 -1
  27. package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
  28. package/package.json +9 -9
  29. package/src/TestComponents/NativeDatePicker/NativeDatePickerTest.tsx +126 -9
  30. package/src/testPages.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { Switch, View } from 'react-native';
2
+ import { Platform, Switch, View } from 'react-native';
3
3
 
4
4
  import { Text } from '@fluentui/react-native';
5
5
  import { Button } from '@fluentui-react-native/button';
@@ -11,7 +11,114 @@ import { stackStyle, commonTestStyles as commonStyles } from '../Common/styles';
11
11
  import type { PlatformStatus, TestSection } from '../Test';
12
12
  import { Test } from '../Test';
13
13
 
14
- const NativeDatePickerMainTest: React.FunctionComponent = () => {
14
+ const NativeDatePickerAndroidUsage: React.FunctionComponent = () => {
15
+ const today = new Date();
16
+ const [startDate, setStartDate] = React.useState<Date>(today);
17
+ const [endDate, setEndDate] = React.useState<Date>(today);
18
+
19
+ return (
20
+ <Stack style={stackStyle}>
21
+ <Text variant="headerStandard">Selected Start Date/Time</Text>
22
+ <Text variant="subheaderStandard">
23
+ {startDate?.toString()} {'\n'}
24
+ </Text>
25
+
26
+ <Text variant="headerStandard">Selected End Date/Time</Text>
27
+ <Text variant="subheaderStandard">
28
+ {endDate?.toString() ?? 'N/A'} {'\n'}
29
+ </Text>
30
+
31
+ <Button
32
+ content="Date Picker"
33
+ onClick={() => {
34
+ NativeDatePicker.present({
35
+ mode: 'date',
36
+ startDate: startDate,
37
+ endDate: endDate,
38
+ callback: (date1: string, date2: string) => {
39
+ console.warn(`${date1} - ${date2}`);
40
+ setStartDate(NativeDatePicker.parseISOString(date1));
41
+ },
42
+ });
43
+ }}
44
+ />
45
+ <Text variant="headerStandard">Ranged Datepicker</Text>
46
+ <View style={{ flexDirection: 'row' }}>
47
+ <Button
48
+ content="Start Date"
49
+ onClick={() => {
50
+ NativeDatePicker.present({
51
+ mode: 'dateRange',
52
+ dateRangeMode: 'start',
53
+ startDate: startDate,
54
+ endDate: endDate,
55
+ callback: (date1: string, date2: string) => {
56
+ console.warn(`${date1} - ${date2}`);
57
+ setStartDate(NativeDatePicker.parseISOString(date1));
58
+ setEndDate(NativeDatePicker.parseISOString(date2));
59
+ },
60
+ });
61
+ }}
62
+ />
63
+
64
+ <Button
65
+ content="End Date"
66
+ onClick={() => {
67
+ NativeDatePicker.present({
68
+ mode: 'dateRange',
69
+ dateRangeMode: 'end',
70
+ startDate: startDate,
71
+ endDate: endDate,
72
+ callback: (date1: string, date2: string) => {
73
+ console.warn(`${date1} - ${date2}`);
74
+ setStartDate(NativeDatePicker.parseISOString(date1));
75
+ setEndDate(NativeDatePicker.parseISOString(date2));
76
+ },
77
+ });
78
+ }}
79
+ />
80
+ </View>
81
+
82
+ <Text variant="headerStandard">Date and Time</Text>
83
+ <Button
84
+ content="Date Time Picker"
85
+ onClick={() => {
86
+ NativeDatePicker.present({
87
+ mode: 'dateTime',
88
+ startDate: startDate,
89
+ endDate: endDate,
90
+ callback: (date1: string, date2: string) => {
91
+ console.warn(`${date1} - ${date2}`);
92
+ setStartDate(NativeDatePicker.parseISOString(date1));
93
+ },
94
+ });
95
+ }}
96
+ />
97
+
98
+ <Text variant="headerStandard">Ranged Date Time Picker</Text>
99
+ <View style={{ flexDirection: 'row' }}>
100
+ <Button
101
+ content="Date Time Range"
102
+ onClick={() => {
103
+ NativeDatePicker.present({
104
+ mode: 'dateTimeRange',
105
+ dateRangeMode: 'start',
106
+ startDate: startDate,
107
+ endDate: endDate,
108
+ callback: (date1: string, date2: string) => {
109
+ console.warn(`${date1} - ${date2}`);
110
+ setStartDate(NativeDatePicker.parseISOString(date1));
111
+ setEndDate(NativeDatePicker.parseISOString(date2));
112
+ },
113
+ });
114
+ }}
115
+ />
116
+ </View>
117
+ </Stack>
118
+ );
119
+ };
120
+
121
+ const NativeDatePickeriOSUsage: React.FunctionComponent = () => {
15
122
  const [startDate, setStartDate] = React.useState<Date>(new Date());
16
123
  const [endDate, setEndDate] = React.useState<Date>(null);
17
124
  const [customCalendarConfiguration, setCustomCalendarConfiguration] = React.useState(false);
@@ -230,11 +337,21 @@ const NativeDatePickerMainTest: React.FunctionComponent = () => {
230
337
  };
231
338
 
232
339
  const nativeDatePickerSections: TestSection[] = [
233
- {
234
- name: 'Native Date Picker',
235
- testID: NATIVEDATEPICKER_TESTPAGE,
236
- component: NativeDatePickerMainTest,
237
- },
340
+ ...Platform.select({
341
+ android: [
342
+ {
343
+ name: 'Native Date Picker',
344
+ component: NativeDatePickerAndroidUsage,
345
+ },
346
+ ],
347
+ default: [
348
+ {
349
+ name: 'Native Date Picker',
350
+ testID: NATIVEDATEPICKER_TESTPAGE,
351
+ component: NativeDatePickeriOSUsage,
352
+ },
353
+ ],
354
+ }),
238
355
  ];
239
356
 
240
357
  export const NativeDatePickerTest: React.FunctionComponent = () => {
@@ -243,10 +360,10 @@ export const NativeDatePickerTest: React.FunctionComponent = () => {
243
360
  uwpStatus: 'N/A',
244
361
  iosStatus: 'Experimental',
245
362
  macosStatus: 'N/A',
246
- androidStatus: 'N/A',
363
+ androidStatus: 'Experimental',
247
364
  };
248
365
 
249
- const description = 'A Native date picker component using the Fluent Design System. Currently only implemented on iOS.';
366
+ const description = 'A Native date picker component using the Fluent Design System.';
250
367
 
251
368
  return <Test name="Native Date Picker Test" description={description} sections={nativeDatePickerSections} status={status}></Test>;
252
369
  };
package/src/testPages.ts CHANGED
@@ -124,7 +124,7 @@ export const tests: TestDescription[] = [
124
124
  name: 'Date Picker (Native)',
125
125
  component: NativeDatePickerTest,
126
126
  testPageButton: HOMEPAGE_NATIVEDATEPICKER_BUTTON,
127
- platforms: ['ios'],
127
+ platforms: ['ios', 'android'],
128
128
  },
129
129
  {
130
130
  name: 'Divider',