@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.
- package/CHANGELOG.json +36 -1
- package/CHANGELOG.md +12 -2
- package/lib/E2E/src/Chip/consts.d.ts +7 -0
- package/lib/E2E/src/Chip/consts.d.ts.map +1 -0
- package/lib/E2E/src/Chip/consts.js +7 -0
- package/lib/E2E/src/Chip/consts.js.map +1 -0
- package/lib/E2E/src/index.consts.d.ts +1 -0
- package/lib/E2E/src/index.consts.d.ts.map +1 -1
- package/lib/E2E/src/index.consts.js +1 -0
- package/lib/E2E/src/index.consts.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.js +13 -6
- package/lib/fluent-tester/src/TestComponents/Badge/BadgeTest.js.map +1 -1
- package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js +26 -0
- package/lib/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js +47 -0
- package/lib/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.js +52 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipDefault.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.js +31 -0
- package/lib/fluent-tester/src/TestComponents/Chip/ChipTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts +3 -0
- package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.js +17 -0
- package/lib/fluent-tester/src/TestComponents/Chip/E2EChipTest.js.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/index.d.ts +2 -0
- package/lib/fluent-tester/src/TestComponents/Chip/index.d.ts.map +1 -0
- package/lib/fluent-tester/src/TestComponents/Chip/index.js +2 -0
- package/lib/fluent-tester/src/TestComponents/Chip/index.js.map +1 -0
- package/lib/fluent-tester/src/testPages.d.ts.map +1 -1
- package/lib/fluent-tester/src/testPages.js +7 -0
- package/lib/fluent-tester/src/testPages.js.map +1 -1
- package/lib-commonjs/E2E/src/Chip/consts.d.ts +7 -0
- package/lib-commonjs/E2E/src/Chip/consts.d.ts.map +1 -0
- package/lib-commonjs/E2E/src/Chip/consts.js +10 -0
- package/lib-commonjs/E2E/src/Chip/consts.js.map +1 -0
- package/lib-commonjs/E2E/src/index.consts.d.ts +1 -0
- package/lib-commonjs/E2E/src/index.consts.d.ts.map +1 -1
- package/lib-commonjs/E2E/src/index.consts.js +1 -0
- package/lib-commonjs/E2E/src/index.consts.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.js +13 -6
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/BadgeTest.js.map +1 -1
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js +31 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/CounterBadgeTest.android.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js +52 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Badge/PresenceBadgeTest.android.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.js +57 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipDefault.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.js +36 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/ChipTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts +3 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.js +21 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/E2EChipTest.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.d.ts +2 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.d.ts.map +1 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.js +5 -0
- package/lib-commonjs/fluent-tester/src/TestComponents/Chip/index.js.map +1 -0
- package/lib-commonjs/fluent-tester/src/testPages.d.ts.map +1 -1
- package/lib-commonjs/fluent-tester/src/testPages.js +7 -0
- package/lib-commonjs/fluent-tester/src/testPages.js.map +1 -1
- package/package.json +4 -3
- package/src/TestComponents/Badge/BadgeTest.tsx +16 -6
- package/src/TestComponents/Badge/CounterBadgeTest.android.tsx +30 -0
- package/src/TestComponents/Badge/PresenceBadgeTest.android.tsx +55 -0
- package/src/TestComponents/Chip/ChipDefault.tsx +117 -0
- package/src/TestComponents/Chip/ChipTest.tsx +39 -0
- package/src/TestComponents/Chip/E2EChipTest.tsx +36 -0
- package/src/TestComponents/Chip/index.ts +1 -0
- 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,
|