@fluentui-react-native/tester 0.151.0 → 0.151.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 (87) hide show
  1. package/CHANGELOG.json +36 -1
  2. package/CHANGELOG.md +12 -2
  3. package/lib/E2E/src/Chip/consts.d.ts +7 -0
  4. package/lib/E2E/src/Chip/consts.d.ts.map +1 -0
  5. package/lib/E2E/src/Chip/consts.js +7 -0
  6. package/lib/E2E/src/Chip/consts.js.map +1 -0
  7. package/lib/E2E/src/index.consts.d.ts +1 -0
  8. package/lib/E2E/src/index.consts.d.ts.map +1 -1
  9. package/lib/E2E/src/index.consts.js +1 -0
  10. package/lib/E2E/src/index.consts.js.map +1 -1
  11. package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  12. package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.js +13 -6
  13. package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.js.map +1 -1
  14. package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts +3 -0
  15. package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts.map +1 -0
  16. package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js +26 -0
  17. package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js.map +1 -0
  18. package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts +3 -0
  19. package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts.map +1 -0
  20. package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js +47 -0
  21. package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js.map +1 -0
  22. package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts +3 -0
  23. package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts.map +1 -0
  24. package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.js +52 -0
  25. package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.js.map +1 -0
  26. package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts +3 -0
  27. package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts.map +1 -0
  28. package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.js +31 -0
  29. package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.js.map +1 -0
  30. package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts +3 -0
  31. package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts.map +1 -0
  32. package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.js +17 -0
  33. package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.js.map +1 -0
  34. package/lib/fluent-tester/src/TestComponents/Chip/index.d.ts +2 -0
  35. package/lib/fluent-tester/src/TestComponents/Chip/index.d.ts.map +1 -0
  36. package/lib/fluent-tester/src/TestComponents/Chip/index.js +2 -0
  37. package/lib/fluent-tester/src/TestComponents/Chip/index.js.map +1 -0
  38. package/lib/fluent-tester/src/testPages.d.ts.map +1 -1
  39. package/lib/fluent-tester/src/testPages.js +7 -0
  40. package/lib/fluent-tester/src/testPages.js.map +1 -1
  41. package/lib-commonjs/E2E/src/Chip/consts.d.ts +7 -0
  42. package/lib-commonjs/E2E/src/Chip/consts.d.ts.map +1 -0
  43. package/lib-commonjs/E2E/src/Chip/consts.js +10 -0
  44. package/lib-commonjs/E2E/src/Chip/consts.js.map +1 -0
  45. package/lib-commonjs/E2E/src/index.consts.d.ts +1 -0
  46. package/lib-commonjs/E2E/src/index.consts.d.ts.map +1 -1
  47. package/lib-commonjs/E2E/src/index.consts.js +1 -0
  48. package/lib-commonjs/E2E/src/index.consts.js.map +1 -1
  49. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
  50. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.js +13 -6
  51. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.js.map +1 -1
  52. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts +3 -0
  53. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts.map +1 -0
  54. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js +31 -0
  55. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js.map +1 -0
  56. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts +3 -0
  57. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts.map +1 -0
  58. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js +52 -0
  59. package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js.map +1 -0
  60. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts +3 -0
  61. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts.map +1 -0
  62. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.js +57 -0
  63. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.js.map +1 -0
  64. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts +3 -0
  65. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts.map +1 -0
  66. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.js +36 -0
  67. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.js.map +1 -0
  68. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts +3 -0
  69. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts.map +1 -0
  70. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.js +21 -0
  71. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.js.map +1 -0
  72. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.d.ts +2 -0
  73. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.d.ts.map +1 -0
  74. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.js +5 -0
  75. package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.js.map +1 -0
  76. package/lib-commonjs/fluent-tester/src/testPages.d.ts.map +1 -1
  77. package/lib-commonjs/fluent-tester/src/testPages.js +7 -0
  78. package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
  79. package/package.json +4 -3
  80. package/src/TestComponents/Badge/BadgeTest.tsx +16 -6
  81. package/src/TestComponents/Badge/CounterBadgeTest.android.tsx +30 -0
  82. package/src/TestComponents/Badge/PresenceBadgeTest.android.tsx +55 -0
  83. package/src/TestComponents/Chip/ChipDefault.tsx +117 -0
  84. package/src/TestComponents/Chip/ChipTest.tsx +39 -0
  85. package/src/TestComponents/Chip/E2EChipTest.tsx +36 -0
  86. package/src/TestComponents/Chip/index.ts +1 -0
  87. package/src/testPages.ts +7 -0
@@ -0,0 +1,117 @@
1
+ /* eslint-disable @typescript-eslint/no-var-requires */
2
+ import React, { useCallback } from 'react';
3
+ import { StyleSheet, View, ToastAndroid } from 'react-native';
4
+
5
+ import { Chip } from '@fluentui-react-native/chip';
6
+ import type { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
7
+ import { Switch } from '@fluentui-react-native/switch';
8
+ import { Text } from '@fluentui-react-native/text';
9
+
10
+ import { svgProps } from '../Common/iconExamples';
11
+
12
+ export const ChipDefault: React.FunctionComponent = () => {
13
+ const [showCloseIcon, setShowCloseIcon] = React.useState<boolean>(false);
14
+ const toggleActivityState = useCallback((_e: InteractionEvent, isActive: boolean) => setShowCloseIcon(isActive), []);
15
+ const showToast = () => {
16
+ ToastAndroid.show('Close icon clicked!', ToastAndroid.SHORT);
17
+ };
18
+
19
+ return (
20
+ <View>
21
+ <Switch label={'Show Close Icon'} defaultChecked={showCloseIcon} onChange={toggleActivityState} />
22
+ <View style={styles.rowStyle}>
23
+ <Chip size="small" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
24
+ Neutral
25
+ </Chip>
26
+ <Chip size="medium" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
27
+ Neutral
28
+ </Chip>
29
+ </View>
30
+ <View style={styles.rowStyle}>
31
+ <Chip size="small" style={styles.rowGap} disabled showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
32
+ Disabled
33
+ </Chip>
34
+ <Chip size="medium" icon={{ svgSource: svgProps }} disabled showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
35
+ Disabled
36
+ </Chip>
37
+ </View>
38
+ <View style={styles.rowStyle}>
39
+ <Chip size="small" chipColor="brand" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
40
+ Brand
41
+ </Chip>
42
+ <Chip size="medium" chipColor="brand" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
43
+ Brand
44
+ </Chip>
45
+ </View>
46
+ <View style={styles.rowStyle}>
47
+ <Chip size="small" chipColor="danger" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
48
+ Danger
49
+ </Chip>
50
+ <Chip size="medium" chipColor="danger" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
51
+ Danger
52
+ </Chip>
53
+ </View>
54
+ <View style={styles.rowStyle}>
55
+ <Chip size="small" chipColor="severe" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
56
+ Severe
57
+ </Chip>
58
+ <Chip size="medium" chipColor="severe" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
59
+ Severe
60
+ </Chip>
61
+ </View>
62
+ <View style={styles.rowStyle}>
63
+ <Chip size="small" chipColor="warning" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
64
+ Warning
65
+ </Chip>
66
+ <Chip size="medium" chipColor="warning" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
67
+ Warning
68
+ </Chip>
69
+ </View>
70
+ <View style={styles.rowStyle}>
71
+ <Chip size="small" chipColor="success" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
72
+ Success
73
+ </Chip>
74
+ <Chip size="medium" chipColor="success" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
75
+ Success
76
+ </Chip>
77
+ </View>
78
+ <Text>Search Bar Chip</Text>
79
+ <View style={styles.rowStyle}>
80
+ <Chip searchBar size="small" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
81
+ Chip
82
+ </Chip>
83
+ <Chip searchBar size="medium" icon={{ svgSource: svgProps }} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
84
+ Chip
85
+ </Chip>
86
+ </View>
87
+ <View style={styles.rowStyle}>
88
+ <Chip searchBar size="small" chipColor="brand" style={styles.rowGap} showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
89
+ Brand
90
+ </Chip>
91
+ <Chip
92
+ searchBar
93
+ size="medium"
94
+ chipColor="brand"
95
+ icon={{ svgSource: svgProps }}
96
+ showCloseIcon={showCloseIcon}
97
+ closeIconOnPress={showToast}
98
+ >
99
+ Brand
100
+ </Chip>
101
+ </View>
102
+ <View style={styles.rowStyle}>
103
+ <Chip searchBar size="small" style={styles.rowGap} disabled showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
104
+ Disabled
105
+ </Chip>
106
+ <Chip searchBar size="medium" icon={{ svgSource: svgProps }} disabled showCloseIcon={showCloseIcon} closeIconOnPress={showToast}>
107
+ Disabled
108
+ </Chip>
109
+ </View>
110
+ </View>
111
+ );
112
+ };
113
+
114
+ const styles = StyleSheet.create({
115
+ rowStyle: { flexDirection: 'row', marginTop: 6 },
116
+ rowGap: { marginRight: 6 },
117
+ });
@@ -0,0 +1,39 @@
1
+ import * as React from 'react';
2
+
3
+ import { ChipDefault } from './ChipDefault';
4
+ import { E2EChipTest } from './E2EChipTest';
5
+ import { CHIP_TESTPAGE } from '../../../../E2E/src/Chip/consts';
6
+ import type { TestSection, PlatformStatus } from '../Test';
7
+ import { Test } from '../Test';
8
+
9
+ const chipSections: TestSection[] = [
10
+ {
11
+ name: 'Default Chip',
12
+ testID: CHIP_TESTPAGE,
13
+ component: ChipDefault,
14
+ },
15
+ ];
16
+
17
+ const e2eSections: TestSection[] = [
18
+ {
19
+ name: 'Chip E2E',
20
+ component: E2EChipTest,
21
+ },
22
+ ];
23
+
24
+ export const ChipTest: React.FunctionComponent = () => {
25
+ const status: PlatformStatus = {
26
+ win32Status: 'Backlog',
27
+ uwpStatus: 'Backlog',
28
+ iosStatus: 'Backlog',
29
+ macosStatus: 'Backlog',
30
+ androidStatus: 'Experimental',
31
+ };
32
+
33
+ const description =
34
+ 'Chips are compact representations of entities (most commonly, people) that can be typed in, deleted or dragged easily.';
35
+
36
+ const spec = 'https://github.com/microsoft/fluentui-react-native/blob/main/packages/components/Chip/SPEC.md';
37
+
38
+ return <Test name="Chip Test" description={description} spec={spec} sections={chipSections} status={status} e2eSections={e2eSections} />;
39
+ };
@@ -0,0 +1,36 @@
1
+ import * as React from 'react';
2
+ import { View } from 'react-native';
3
+
4
+ import { Chip } from '@fluentui-react-native/chip';
5
+ import type { InteractionEvent } from '@fluentui-react-native/interactive-hooks';
6
+ import { Text } from '@fluentui-react-native/text';
7
+
8
+ import {
9
+ CHIP_CALLBACK_TEXT_END_STATE,
10
+ CHIP_CALLBACK_TEXT_START_STATE,
11
+ CHIP_TEST_COMPONENT,
12
+ CHIP_TEXT,
13
+ } from '../../../../E2E/src/Chip/consts';
14
+ import { testProps } from '../Common/TestProps';
15
+
16
+ export const E2EChipTest: React.FunctionComponent = () => {
17
+ const [text, setText] = React.useState<string>(CHIP_CALLBACK_TEXT_START_STATE);
18
+ const showTextOnSelection = React.useCallback(
19
+ (_e: InteractionEvent, isSelected: boolean) => setText(isSelected ? CHIP_CALLBACK_TEXT_END_STATE : CHIP_CALLBACK_TEXT_START_STATE),
20
+ [],
21
+ );
22
+ return (
23
+ <View>
24
+ <Text {...testProps(CHIP_TEXT)}>{text}</Text>
25
+ <Chip
26
+ /* For Android E2E testing purposes, testProps must be passed in after accessibilityLabel. */
27
+ {...testProps(CHIP_TEST_COMPONENT)}
28
+ chipColor="success"
29
+ showCloseIcon
30
+ onSelectionChange={showTextOnSelection}
31
+ >
32
+ Basic Chip
33
+ </Chip>
34
+ </View>
35
+ );
36
+ };
@@ -0,0 +1 @@
1
+ export * from './ChipTest';
package/src/testPages.ts CHANGED
@@ -6,6 +6,7 @@ import { ButtonTest } from './TestComponents/Button';
6
6
  import { CalloutTest } from './TestComponents/Callout';
7
7
  import { CheckboxLegacyTest } from './TestComponents/CheckboxLegacy';
8
8
  import { CheckboxV1Test } from './TestComponents/CheckboxV1';
9
+ import { ChipTest } from './TestComponents/Chip';
9
10
  import { ColorTokensTest } from './TestComponents/ColorTokens';
10
11
  import { ContextualMenuTest } from './TestComponents/ContextualMenu';
11
12
  import { CornerRadiusTokensTest } from './TestComponents/CornerRadius';
@@ -94,6 +95,12 @@ export const tests: TestDescription[] = [
94
95
  testPageButton: Constants.HOMEPAGE_CHECKBOXV1_BUTTON,
95
96
  platforms: ['android', 'ios', 'macos', 'win32'], // 'windows': GH#935: Temporarily disabling while SVGs don't work in windows
96
97
  },
98
+ {
99
+ name: 'Chip',
100
+ component: ChipTest,
101
+ testPageButton: Constants.HOMEPAGE_CHIP_BUTTON,
102
+ platforms: ['android'],
103
+ },
97
104
  {
98
105
  name: 'Color Tokens',
99
106
  component: ColorTokensTest,