Skip to content

Commit da90755

Browse files
beyackle2beyacklecompulim
authored
add LinkText and underline to HC button-link (#4537)
* add LinkText and underline to HC button-link * add new unit tests for Retry underline * fix test typo * add new snapshot * Update screenshot * Add entry Co-authored-by: Benjamin Yackley <[email protected]> Co-authored-by: William Wong <[email protected]>
1 parent a1cec41 commit da90755

5 files changed

+82
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2222

2323
## [Unreleased]
2424

25+
### Fixed
26+
27+
- Fixes [#4558](https://github.com/microsoft/BotFramework-WebChat/issues/4558). In high contrast mode, "Retry" link button should use link color as defined by [CSS System Colors](https://w3c.github.io/csswg-drafts/css-color/#css-system-colors), by [@beyackle2](https://github.com/beyackle2) in PR [#4537](https://github.com/microsoft/BotFramework-WebChat/pull/4537)
28+
2529
### Changed
2630

2731
- Updated test harness to use [Selenium Hub 4.6.0](https://hub.docker.com/r/selenium/hub) and [Chrome 107](https://hub.docker.com/r/selenium/node-chrome), by [@compulim](https://github.com/compulim) in PR [#4540](https://github.com/microsoft/BotFramework-WebChat/pull/4540)
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<!DOCTYPE html>
2+
<html lang="en-US">
3+
<head>
4+
<link href="/assets/index.css" rel="stylesheet" type="text/css" />
5+
<script crossorigin="anonymous" src="/test-harness.js"></script>
6+
<script crossorigin="anonymous" src="/test-page-object.js"></script>
7+
<script crossorigin="anonymous" src="/__dist__/webchat-es5.js"></script>
8+
</head>
9+
<body>
10+
<div id="webchat"></div>
11+
<script>
12+
run(
13+
async function () {
14+
const store = testHelpers.createStore();
15+
16+
const directLine = testHelpers.createDirectLineEmulator(store);
17+
18+
await host.sendDevToolsCommand('Emulation.setEmulatedMedia', {
19+
features: [
20+
{
21+
name: 'forced-colors',
22+
value: 'active'
23+
}
24+
]});
25+
26+
WebChat.renderWebChat(
27+
{
28+
directLine,
29+
store,
30+
styleOptions: {
31+
groupTimestamp: 60000,
32+
sendTimeout: 5000
33+
}
34+
},
35+
document.getElementById('webchat')
36+
);
37+
38+
await pageConditions.uiConnected();
39+
40+
const { disconnect, flush } = pageObjects.observeLiveRegion();
41+
42+
try {
43+
const sendMessage = await directLine.emulateOutgoingActivity('Hello, World!');
44+
45+
await directLine.emulateIncomingActivity('Aloha!');
46+
47+
sendMessage.rejectPostActivity(new Error('artificial error'));
48+
49+
await pageConditions.became(
50+
'failed to send message',
51+
() => pageElements.activityStatuses()[0]?.innerText === 'Send failed. Retry.',
52+
1000
53+
);
54+
55+
} finally {
56+
57+
await host.snapshot();
58+
59+
disconnect();
60+
}
61+
},
62+
{ ignoreErrors: true }
63+
);
64+
</script>
65+
</body>
66+
</html>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @jest-environment ./packages/test/harness/src/host/jest/WebDriverEnvironment.js */
2+
3+
describe('live region', () => {
4+
test('should render "Send Failed. Retry" correctly in high-contrast mode', () =>
5+
runHTML('accessibility.liveRegion.activityStatus.sendFailed.contrast.html'));
6+
});

packages/component/src/Utils/InlineMarkdown.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ const InlineMarkdown = ({ children, onReference, references }) => {
6868
fontFamily: 'inherit',
6969
fontSize: 'inherit',
7070
padding: 0
71+
},
72+
'@media screen and (forced-colors: active)': {
73+
'& button[data-markdown-href]': {
74+
color: 'LinkText',
75+
textDecoration: 'underline'
76+
}
7177
}
7278
}) + '',
7379
[accent, styleToClassName]

0 commit comments

Comments
 (0)