@fluentui-react-native/tester 0.102.2 → 0.103.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.
- package/CHANGELOG.json +128 -2
- package/CHANGELOG.md +34 -2
- package/lib/E2E/LinkExperimental/pages/LinkPageObject.d.ts +15 -0
- package/lib/E2E/LinkExperimental/pages/LinkPageObject.d.ts.map +1 -0
- package/lib/E2E/LinkExperimental/pages/LinkPageObject.js +50 -0
- package/lib/E2E/LinkExperimental/pages/LinkPageObject.js.map +1 -0
- package/lib/E2E/LinkExperimental/specs/Link.spec.win.d.ts +2 -0
- package/lib/E2E/LinkExperimental/specs/Link.spec.win.d.ts.map +1 -0
- package/lib/E2E/LinkExperimental/specs/Link.spec.win.js +113 -0
- package/lib/E2E/LinkExperimental/specs/Link.spec.win.js.map +1 -0
- package/lib/E2E/common/NavigateAppPage.d.ts +2 -0
- package/lib/E2E/common/NavigateAppPage.d.ts.map +1 -1
- package/lib/E2E/common/NavigateAppPage.js +20 -0
- package/lib/E2E/common/NavigateAppPage.js.map +1 -1
- package/lib/TestComponents/LinkExperimental/E2ELinkTest.d.ts +3 -0
- package/lib/TestComponents/LinkExperimental/E2ELinkTest.d.ts.map +1 -0
- package/lib/TestComponents/LinkExperimental/E2ELinkTest.js +15 -0
- package/lib/TestComponents/LinkExperimental/E2ELinkTest.js.map +1 -0
- package/lib/TestComponents/LinkExperimental/LinkTest.d.ts +3 -0
- package/lib/TestComponents/LinkExperimental/LinkTest.d.ts.map +1 -0
- package/lib/TestComponents/LinkExperimental/LinkTest.js +134 -0
- package/lib/TestComponents/LinkExperimental/LinkTest.js.map +1 -0
- package/lib/TestComponents/LinkExperimental/consts.d.ts +7 -0
- package/lib/TestComponents/LinkExperimental/consts.d.ts.map +1 -0
- package/lib/TestComponents/LinkExperimental/consts.js +9 -0
- package/lib/TestComponents/LinkExperimental/consts.js.map +1 -0
- package/lib/TestComponents/LinkExperimental/index.d.ts +3 -0
- package/lib/TestComponents/LinkExperimental/index.d.ts.map +1 -0
- package/lib/TestComponents/LinkExperimental/index.js +3 -0
- package/lib/TestComponents/LinkExperimental/index.js.map +1 -0
- package/lib/testPages.d.ts.map +1 -1
- package/lib/testPages.js +7 -0
- package/lib/testPages.js.map +1 -1
- package/lib-commonjs/E2E/LinkExperimental/pages/LinkPageObject.d.ts +15 -0
- package/lib-commonjs/E2E/LinkExperimental/pages/LinkPageObject.d.ts.map +1 -0
- package/lib-commonjs/E2E/LinkExperimental/pages/LinkPageObject.js +52 -0
- package/lib-commonjs/E2E/LinkExperimental/pages/LinkPageObject.js.map +1 -0
- package/lib-commonjs/E2E/LinkExperimental/specs/Link.spec.win.d.ts +2 -0
- package/lib-commonjs/E2E/LinkExperimental/specs/Link.spec.win.d.ts.map +1 -0
- package/lib-commonjs/E2E/LinkExperimental/specs/Link.spec.win.js +115 -0
- package/lib-commonjs/E2E/LinkExperimental/specs/Link.spec.win.js.map +1 -0
- package/lib-commonjs/E2E/common/NavigateAppPage.d.ts +2 -0
- package/lib-commonjs/E2E/common/NavigateAppPage.d.ts.map +1 -1
- package/lib-commonjs/E2E/common/NavigateAppPage.js +54 -34
- package/lib-commonjs/E2E/common/NavigateAppPage.js.map +1 -1
- package/lib-commonjs/TestComponents/LinkExperimental/E2ELinkTest.d.ts +3 -0
- package/lib-commonjs/TestComponents/LinkExperimental/E2ELinkTest.d.ts.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/E2ELinkTest.js +20 -0
- package/lib-commonjs/TestComponents/LinkExperimental/E2ELinkTest.js.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/LinkTest.d.ts +3 -0
- package/lib-commonjs/TestComponents/LinkExperimental/LinkTest.d.ts.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/LinkTest.js +139 -0
- package/lib-commonjs/TestComponents/LinkExperimental/LinkTest.js.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/consts.d.ts +7 -0
- package/lib-commonjs/TestComponents/LinkExperimental/consts.d.ts.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/consts.js +12 -0
- package/lib-commonjs/TestComponents/LinkExperimental/consts.js.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/index.d.ts +3 -0
- package/lib-commonjs/TestComponents/LinkExperimental/index.d.ts.map +1 -0
- package/lib-commonjs/TestComponents/LinkExperimental/index.js +6 -0
- package/lib-commonjs/TestComponents/LinkExperimental/index.js.map +1 -0
- package/lib-commonjs/testPages.d.ts.map +1 -1
- package/lib-commonjs/testPages.js +7 -0
- package/lib-commonjs/testPages.js.map +1 -1
- package/package.json +17 -16
- package/src/E2E/LinkExperimental/pages/LinkPageObject.ts +34 -0
- package/src/E2E/LinkExperimental/specs/Link.spec.win.ts +49 -0
- package/src/E2E/common/NavigateAppPage.ts +9 -0
- package/src/TestComponents/LinkExperimental/E2ELinkTest.tsx +32 -0
- package/src/TestComponents/LinkExperimental/LinkTest.tsx +210 -0
- package/src/TestComponents/LinkExperimental/consts.ts +10 -0
- package/src/TestComponents/LinkExperimental/index.ts +2 -0
- package/src/testPages.ts +7 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EXPERIMENTAL_LINK_TESTPAGE,
|
|
3
|
+
EXPERIMENTAL_LINK_TEST_COMPONENT,
|
|
4
|
+
HOMEPAGE_EXPERIMENTAL_LINK_BUTTON,
|
|
5
|
+
EXPERIMENTAL_LINK_NO_A11Y_LABEL_COMPONENT,
|
|
6
|
+
} from '../../../TestComponents/LinkExperimental/consts';
|
|
7
|
+
import { BasePage, By } from '../../common/BasePage';
|
|
8
|
+
|
|
9
|
+
class ExperimentalLinkPageObject extends BasePage {
|
|
10
|
+
/*****************************************/
|
|
11
|
+
/**************** Getters ****************/
|
|
12
|
+
/*****************************************/
|
|
13
|
+
get _testPage() {
|
|
14
|
+
return By(EXPERIMENTAL_LINK_TESTPAGE);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
get _pageName() {
|
|
18
|
+
return EXPERIMENTAL_LINK_TESTPAGE;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
get _primaryComponent() {
|
|
22
|
+
return By(EXPERIMENTAL_LINK_TEST_COMPONENT);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
get _secondaryComponent() {
|
|
26
|
+
return By(EXPERIMENTAL_LINK_NO_A11Y_LABEL_COMPONENT);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get _pageButton() {
|
|
30
|
+
return By(HOMEPAGE_EXPERIMENTAL_LINK_BUTTON);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default new ExperimentalLinkPageObject();
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import NavigateAppPage from '../../common/NavigateAppPage';
|
|
2
|
+
import ExperimentalLinkPageObject from '../pages/LinkPageObject';
|
|
3
|
+
import { ComponentSelector, Platform } from '../../common/BasePage';
|
|
4
|
+
import { EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL } from '../../../TestComponents/LinkExperimental/consts';
|
|
5
|
+
import { LINK_A11Y_ROLE, PAGE_TIMEOUT, BOOT_APP_TIMEOUT } from '../../common/consts';
|
|
6
|
+
|
|
7
|
+
// Before testing begins, allow up to 60 seconds for app to open
|
|
8
|
+
describe('Link Testing Initialization', function () {
|
|
9
|
+
it('Wait for app load', async () => {
|
|
10
|
+
await NavigateAppPage.waitForPageDisplayed(BOOT_APP_TIMEOUT);
|
|
11
|
+
await expect(await NavigateAppPage.isPageLoaded()).toBeTruthy(NavigateAppPage.ERRORMESSAGE_APPLOAD);
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
it('Click and navigate to Link test page', async () => {
|
|
15
|
+
/* Scroll to component test page button in scrollview if not already visible*/
|
|
16
|
+
await ExperimentalLinkPageObject.scrollToComponentButton(Platform.Win32);
|
|
17
|
+
await ExperimentalLinkPageObject.waitForButtonDisplayed(PAGE_TIMEOUT);
|
|
18
|
+
|
|
19
|
+
/* Click on component button to navigate to test page */
|
|
20
|
+
await NavigateAppPage.clickAndGoToLinkExperimentalPage();
|
|
21
|
+
await ExperimentalLinkPageObject.waitForPageDisplayed(PAGE_TIMEOUT);
|
|
22
|
+
|
|
23
|
+
await expect(await ExperimentalLinkPageObject.isPageLoaded()).toBeTruthy(ExperimentalLinkPageObject.ERRORMESSAGE_PAGELOAD);
|
|
24
|
+
await expect(await ExperimentalLinkPageObject.didAssertPopup()).toBeFalsy(ExperimentalLinkPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
describe('Link Accessibility Testing', () => {
|
|
29
|
+
it('Link - Validate accessibilityRole is correct', async () => {
|
|
30
|
+
await ExperimentalLinkPageObject.scrollToTestElement();
|
|
31
|
+
await ExperimentalLinkPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
32
|
+
|
|
33
|
+
await expect(await ExperimentalLinkPageObject.getAccessibilityRole()).toEqual(LINK_A11Y_ROLE);
|
|
34
|
+
await expect(await ExperimentalLinkPageObject.didAssertPopup()).toBeFalsy(ExperimentalLinkPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('Link - Set accessibilityLabel', async () => {
|
|
38
|
+
await ExperimentalLinkPageObject.scrollToTestElement();
|
|
39
|
+
await ExperimentalLinkPageObject.waitForPrimaryElementDisplayed(PAGE_TIMEOUT);
|
|
40
|
+
|
|
41
|
+
await expect(await ExperimentalLinkPageObject.getAccessibilityLabel(ComponentSelector.Primary)).toEqual(
|
|
42
|
+
EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL,
|
|
43
|
+
);
|
|
44
|
+
await expect(await ExperimentalLinkPageObject.didAssertPopup()).toBeFalsy(ExperimentalLinkPageObject.ERRORMESSAGE_ASSERT); // Ensure no asserts popped up
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// No need to test not setting a11y label. The content prop gets passed down to the child Text component. This equates to not setting the a11y label
|
|
48
|
+
// on a Text component which we have testing for in our Text component spec
|
|
49
|
+
});
|
|
@@ -11,6 +11,7 @@ import { HOMEPAGE_FOCUSTRAPZONE_BUTTON } from '../../TestComponents/FocusTrapZon
|
|
|
11
11
|
import { HOMEPAGE_FOCUSZONE_BUTTON } from '../../TestComponents/FocusZone/consts';
|
|
12
12
|
import { HOMEPAGE_ICON_BUTTON } from '../../TestComponents/Icon/consts';
|
|
13
13
|
import { HOMEPAGE_LINK_BUTTON } from '../../TestComponents/Link/consts';
|
|
14
|
+
import { HOMEPAGE_EXPERIMENTAL_LINK_BUTTON } from '../../TestComponents/LinkExperimental/consts';
|
|
14
15
|
import { HOMEPAGE_MENU_BUTTON } from '../../TestComponents/Menu/consts';
|
|
15
16
|
import { HOMEPAGE_MENUBUTTON_BUTTON } from '../../TestComponents/MenuButton/consts';
|
|
16
17
|
import { HOMEPAGE_EXPERIMENTAL_MENU_BUTTON } from '../../TestComponents/MenuButtonExperimental/consts';
|
|
@@ -79,6 +80,10 @@ class NavigateAppPage extends BasePage {
|
|
|
79
80
|
await this.linkPage.click();
|
|
80
81
|
}
|
|
81
82
|
|
|
83
|
+
async clickAndGoToLinkExperimentalPage() {
|
|
84
|
+
await this.linkExperimentalPage.click();
|
|
85
|
+
}
|
|
86
|
+
|
|
82
87
|
async clickAndGoToMenuPage() {
|
|
83
88
|
await this.menuPage.click();
|
|
84
89
|
}
|
|
@@ -203,6 +208,10 @@ class NavigateAppPage extends BasePage {
|
|
|
203
208
|
return By(HOMEPAGE_LINK_BUTTON);
|
|
204
209
|
}
|
|
205
210
|
|
|
211
|
+
private get linkExperimentalPage() {
|
|
212
|
+
return By(HOMEPAGE_EXPERIMENTAL_LINK_BUTTON);
|
|
213
|
+
}
|
|
214
|
+
|
|
206
215
|
private get menuPage() {
|
|
207
216
|
return By(HOMEPAGE_MENU_BUTTON);
|
|
208
217
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Alert } from 'react-native';
|
|
3
|
+
import { Link } from '@fluentui-react-native/experimental-link';
|
|
4
|
+
import { Stack } from '@fluentui-react-native/stack';
|
|
5
|
+
import { stackStyle } from '../Common/styles';
|
|
6
|
+
import {
|
|
7
|
+
EXPERIMENTAL_LINK_TEST_COMPONENT,
|
|
8
|
+
EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL,
|
|
9
|
+
EXPERIMENTAL_LINK_NO_A11Y_LABEL_COMPONENT,
|
|
10
|
+
EXPERIMENTAL_LINK_TEST_COMPONENT_LABEL,
|
|
11
|
+
} from './consts';
|
|
12
|
+
|
|
13
|
+
export const LinkE2ETest: React.FunctionComponent = () => {
|
|
14
|
+
const doPress = (): void => {
|
|
15
|
+
Alert.alert('Alert.', 'You have been alerted.');
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<Stack style={stackStyle}>
|
|
20
|
+
<Link
|
|
21
|
+
url="https://www.bing.com/"
|
|
22
|
+
testID={EXPERIMENTAL_LINK_TEST_COMPONENT}
|
|
23
|
+
accessibilityLabel={EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL}
|
|
24
|
+
>
|
|
25
|
+
Link with Accessibility Label
|
|
26
|
+
</Link>
|
|
27
|
+
<Link onPress={doPress} testID={EXPERIMENTAL_LINK_NO_A11Y_LABEL_COMPONENT}>
|
|
28
|
+
{EXPERIMENTAL_LINK_TEST_COMPONENT_LABEL}
|
|
29
|
+
</Link>
|
|
30
|
+
</Stack>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Alert, View, StyleSheet, Text, TextInput } from 'react-native';
|
|
3
|
+
import { Link, LinkTokens } from '@fluentui-react-native/experimental-link';
|
|
4
|
+
import { Stack } from '@fluentui-react-native/stack';
|
|
5
|
+
import { stackStyle, commonTestStyles as commonStyles } from '../Common/styles';
|
|
6
|
+
import { EXPERIMENTAL_LINK_TESTPAGE } from './consts';
|
|
7
|
+
import { Test, TestSection, PlatformStatus } from '../Test';
|
|
8
|
+
import { LinkE2ETest } from './E2ELinkTest';
|
|
9
|
+
|
|
10
|
+
const DefaultLinks: React.FunctionComponent = () => {
|
|
11
|
+
const doPress = React.useCallback(() => Alert.alert('Alert.', 'You have been alerted.'), []);
|
|
12
|
+
const doAllyTap = React.useCallback(() => Alert.alert('Alert.', 'You have invoked onAllyTap.'), []);
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Stack style={stackStyle}>
|
|
16
|
+
<Link tooltip={'https://www.bing.com/'} url="https://www.bing.com/">
|
|
17
|
+
Click to navigate.
|
|
18
|
+
</Link>
|
|
19
|
+
<Link onPress={doPress} onAccessibilityTap={doAllyTap}>
|
|
20
|
+
Click to alert.
|
|
21
|
+
</Link>
|
|
22
|
+
<Link disabled focusable>
|
|
23
|
+
Disabled focusable Link
|
|
24
|
+
</Link>
|
|
25
|
+
</Stack>
|
|
26
|
+
);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const InlineLinks: React.FunctionComponent = () => {
|
|
30
|
+
const doPress = React.useCallback(() => Alert.alert('Alert.', 'You have been alerted.'), []);
|
|
31
|
+
const doAllyTap = React.useCallback(() => Alert.alert('Alert.', 'You have invoked onAllyTap.'), []);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Stack style={stackStyle}>
|
|
35
|
+
<Text>
|
|
36
|
+
Click{' '}
|
|
37
|
+
<Link inline onPress={doPress} onAccessibilityTap={doAllyTap}>
|
|
38
|
+
this link
|
|
39
|
+
</Link>{' '}
|
|
40
|
+
to alert me.
|
|
41
|
+
</Text>
|
|
42
|
+
<Text>
|
|
43
|
+
This{' '}
|
|
44
|
+
<Link inline onPress={doPress} disabled focusable>
|
|
45
|
+
link
|
|
46
|
+
</Link>{' '}
|
|
47
|
+
is disabled but focusable.
|
|
48
|
+
</Text>
|
|
49
|
+
<Text>
|
|
50
|
+
Follow this{' '}
|
|
51
|
+
<Link inline url="https://www.bing.com/">
|
|
52
|
+
link
|
|
53
|
+
</Link>{' '}
|
|
54
|
+
to navigate.
|
|
55
|
+
</Text>
|
|
56
|
+
</Stack>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const SubtleLinks: React.FunctionComponent = () => {
|
|
61
|
+
const doPress = React.useCallback(() => Alert.alert('Alert.', 'You have been alerted.'), []);
|
|
62
|
+
const doAllyTap = React.useCallback(() => Alert.alert('Alert.', 'You have invoked onAllyTap.'), []);
|
|
63
|
+
|
|
64
|
+
return (
|
|
65
|
+
<Stack style={stackStyle}>
|
|
66
|
+
<Link appearance="subtle" url="https://www.bing.com/">
|
|
67
|
+
Click to navigate.
|
|
68
|
+
</Link>
|
|
69
|
+
<Text>
|
|
70
|
+
This is inline Link.{' '}
|
|
71
|
+
<Link appearance="subtle" inline onPress={doPress} onAccessibilityTap={doAllyTap}>
|
|
72
|
+
Click to alert.
|
|
73
|
+
</Link>
|
|
74
|
+
</Text>
|
|
75
|
+
<Link appearance="subtle" onPress={doPress} disabled>
|
|
76
|
+
Disabled Link
|
|
77
|
+
</Link>
|
|
78
|
+
</Stack>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
tokensRow: {
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
marginBottom: 10,
|
|
86
|
+
},
|
|
87
|
+
tokensColumn: {
|
|
88
|
+
flexDirection: 'column',
|
|
89
|
+
margin: 10,
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
const BlueHeaderBold = Link.customize({ variant: 'headerStandard', fontWeight: '700', color: '#0229c4', textAlign: 'right' });
|
|
94
|
+
const CustomLinks: React.FunctionComponent = () => {
|
|
95
|
+
const [linkColor, setLinkColor] = React.useState<string>('blue');
|
|
96
|
+
const [linkFont, setLinkFont] = React.useState<string>('Ariel');
|
|
97
|
+
const [linkFontSize, setLinkFontSize] = React.useState<number>(12);
|
|
98
|
+
const [linkText, setLinkText] = React.useState<string>('Click to Navigate');
|
|
99
|
+
const [linkUrl, setLinkUrl] = React.useState<string>('https://www.bing.com/');
|
|
100
|
+
|
|
101
|
+
const CustomLink = React.useMemo(() => {
|
|
102
|
+
const tokens: LinkTokens = {
|
|
103
|
+
color: linkColor,
|
|
104
|
+
fontFamily: linkFont,
|
|
105
|
+
fontSize: linkFontSize,
|
|
106
|
+
};
|
|
107
|
+
return Link.customize(tokens);
|
|
108
|
+
}, [linkColor, linkFont, linkFontSize, linkText, linkUrl]);
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<View style={styles.tokensColumn}>
|
|
112
|
+
<View style={styles.tokensRow}>
|
|
113
|
+
<View>
|
|
114
|
+
<Text>Text Tokens</Text>
|
|
115
|
+
<TextInput
|
|
116
|
+
accessibilityLabel="Link color"
|
|
117
|
+
style={commonStyles.textBox}
|
|
118
|
+
placeholder="Link color"
|
|
119
|
+
blurOnSubmit={true}
|
|
120
|
+
onSubmitEditing={(e) => {
|
|
121
|
+
setLinkColor(e.nativeEvent.text);
|
|
122
|
+
}}
|
|
123
|
+
/>
|
|
124
|
+
<TextInput
|
|
125
|
+
accessibilityLabel="Link font"
|
|
126
|
+
style={commonStyles.textBox}
|
|
127
|
+
placeholder="Link font"
|
|
128
|
+
blurOnSubmit={true}
|
|
129
|
+
onSubmitEditing={(e) => {
|
|
130
|
+
setLinkFont(e.nativeEvent.text);
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
<TextInput
|
|
134
|
+
accessibilityLabel="Link font size"
|
|
135
|
+
style={commonStyles.textBox}
|
|
136
|
+
placeholder="Link font size"
|
|
137
|
+
blurOnSubmit={true}
|
|
138
|
+
onSubmitEditing={(e) => {
|
|
139
|
+
setLinkFontSize(parseInt(e.nativeEvent.text));
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
142
|
+
</View>
|
|
143
|
+
<View>
|
|
144
|
+
<Text>Content and URL customize</Text>
|
|
145
|
+
<TextInput
|
|
146
|
+
accessibilityLabel="Link text"
|
|
147
|
+
style={commonStyles.textBox}
|
|
148
|
+
placeholder="Link text"
|
|
149
|
+
blurOnSubmit={true}
|
|
150
|
+
onSubmitEditing={(e) => {
|
|
151
|
+
setLinkText(e.nativeEvent.text);
|
|
152
|
+
}}
|
|
153
|
+
/>
|
|
154
|
+
<TextInput
|
|
155
|
+
accessibilityLabel="Link Url"
|
|
156
|
+
style={commonStyles.textBox}
|
|
157
|
+
placeholder="Link URL"
|
|
158
|
+
blurOnSubmit={true}
|
|
159
|
+
onSubmitEditing={(e) => {
|
|
160
|
+
setLinkUrl(e.nativeEvent.text);
|
|
161
|
+
}}
|
|
162
|
+
/>
|
|
163
|
+
</View>
|
|
164
|
+
</View>
|
|
165
|
+
<CustomLink align="end" url={linkUrl}>
|
|
166
|
+
{linkText}
|
|
167
|
+
</CustomLink>
|
|
168
|
+
<BlueHeaderBold>BlueHeaderBold</BlueHeaderBold>
|
|
169
|
+
</View>
|
|
170
|
+
);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
const linkSections: TestSection[] = [
|
|
174
|
+
{
|
|
175
|
+
name: 'Default Links',
|
|
176
|
+
testID: EXPERIMENTAL_LINK_TESTPAGE,
|
|
177
|
+
component: DefaultLinks,
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'Inline Links',
|
|
181
|
+
component: InlineLinks,
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
name: 'Subtle Links',
|
|
185
|
+
component: SubtleLinks,
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
name: 'Custom Link',
|
|
189
|
+
component: CustomLinks,
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
name: 'Link E2E Test',
|
|
193
|
+
component: LinkE2ETest,
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
export const ExperimentalLinkTest: React.FunctionComponent = () => {
|
|
198
|
+
const status: PlatformStatus = {
|
|
199
|
+
win32Status: 'Beta',
|
|
200
|
+
uwpStatus: 'Experimental',
|
|
201
|
+
iosStatus: 'Experimental',
|
|
202
|
+
macosStatus: 'Beta',
|
|
203
|
+
androidStatus: 'Backlog',
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
const description =
|
|
207
|
+
'With a Link, users can navigate to another page, window, or Help topic; display a definition; initiate a command; or choose an option. A Link indicates that it can be clicked, typically by being displayed using the visited or unvisited link system colors. Traditionally, Links are underlined as well, but that approach is often unnecessary and falling out of favor to reduce visual clutter.\n\nA Link is the lightest weight clickable control, and is often used to reduce the visual complexity of a design.';
|
|
208
|
+
|
|
209
|
+
return <Test name="Link Test" description={description} sections={linkSections} status={status}></Test>;
|
|
210
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const HOMEPAGE_EXPERIMENTAL_LINK_BUTTON = 'Homepage_LinkExperimental_Button';
|
|
2
|
+
export const EXPERIMENTAL_LINK_TESTPAGE = 'LinkExperimental_TestPage';
|
|
3
|
+
|
|
4
|
+
/* E2E Testing Link 1 */
|
|
5
|
+
export const EXPERIMENTAL_LINK_TEST_COMPONENT = 'Experimental_Link_Test_Component'; // A component on each specific test page
|
|
6
|
+
export const EXPERIMENTAL_LINK_ACCESSIBILITY_LABEL = 'E2E testing Experimental Link accessibility label';
|
|
7
|
+
|
|
8
|
+
/* E2E Testing Link 2 */
|
|
9
|
+
export const EXPERIMENTAL_LINK_NO_A11Y_LABEL_COMPONENT = 'Experimental Link_No_A11y_label_Component';
|
|
10
|
+
export const EXPERIMENTAL_LINK_TEST_COMPONENT_LABEL = 'Test Experimental Link2 - No Accessibility Label'; // A component on each specific test page
|
package/src/testPages.ts
CHANGED
|
@@ -36,6 +36,7 @@ import { TextTest, HOMEPAGE_TEXT_BUTTON } from './TestComponents/Text';
|
|
|
36
36
|
import { TextExperimentalTest, HOMEPAGE_EXPERIMENTAL_TEXT_BUTTON } from './TestComponents/TextExperimental';
|
|
37
37
|
import { ThemeTest, HOMEPAGE_THEME_BUTTON } from './TestComponents/Theme';
|
|
38
38
|
import { TokenTest, HOMEPAGE_TOKEN_BUTTON } from './TestComponents/Tokens';
|
|
39
|
+
import { ExperimentalLinkTest, HOMEPAGE_EXPERIMENTAL_LINK_BUTTON } from './TestComponents/LinkExperimental';
|
|
39
40
|
|
|
40
41
|
export const tests: TestDescription[] = [
|
|
41
42
|
{
|
|
@@ -141,6 +142,12 @@ export const tests: TestDescription[] = [
|
|
|
141
142
|
testPage: HOMEPAGE_LINK_BUTTON,
|
|
142
143
|
platforms: ['android', 'ios', 'macos', 'web', 'win32', 'windows'],
|
|
143
144
|
},
|
|
145
|
+
{
|
|
146
|
+
name: 'Link (Experimental)',
|
|
147
|
+
component: ExperimentalLinkTest,
|
|
148
|
+
testPage: HOMEPAGE_EXPERIMENTAL_LINK_BUTTON,
|
|
149
|
+
platforms: ['win32'],
|
|
150
|
+
},
|
|
144
151
|
{
|
|
145
152
|
name: 'Menu',
|
|
146
153
|
component: MenuTest,
|