Skip to content

Commit 2c2d9f2

Browse files
authored
Adaptive Cards TextBlock heading should start at level 2 (#4747)
* AC text block heading should be level 2 * Add entry * Fix tests * Clean up * Fix screenshots * Fix heading-one test * Fix flaky * Add entry
1 parent 67bf2e5 commit 2c2d9f2

File tree

10 files changed

+39
-3
lines changed

10 files changed

+39
-3
lines changed

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
"packages/*/dist": false,
44
"packages/*/lib": false
55
},
6-
"typescript.tsdk": "packages\\component\\node_modules\\typescript\\lib"
6+
"typescript.tsdk": "packages\\component\\node_modules\\typescript\\lib",
7+
"prettier.prettierPath": "./node_modules/prettier"
78
}

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2525
### Fixed
2626

2727
- Fixes [#4718](https://github.com/microsoft/BotFramework-WebChat/issues/4718). In high contrast mode, Adaptive Card buttons, when pushed, should highlighted properly, by [@compulim](https://github.com/compulim), in PR [#4746](https://github.com/microsoft/BotFramework-WebChat/pull/4746)
28+
- Fixes [#4721](https://github.com/microsoft/BotFramework-WebChat/issues/4721) and [#4726](https://github.com/microsoft/BotFramework-WebChat/issues/4726). Adaptive Cards `TextBlock` heading elements should start at level 2, by [@compulim](https://github.com/compulim), in PR [#4747](https://github.com/microsoft/BotFramework-WebChat/issues/4747)
2829

2930
## [4.15.8] - 2023-06-06
3031

1.63 KB
Loading
1.56 KB
Loading
-176 Bytes
Loading
1.64 KB
Loading

__tests__/html/replyToId.firstSetOfActivities.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
clock.tick(1000);
4040

4141
// We should not delay the first activity, as the first activity always has a "replyToId" pointing to missing activity.
42+
await pageConditions.numActivitiesShown(1);
4243
await host.snapshot();
4344

4445
directLine.activityDeferredObservable.next({

packages/bundle/src/adaptiveCards/Styles/adaptiveCardHostConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export default function createAdaptiveCardsHostConfig(styleOptions: FullBundleSt
135135
spacing: 8
136136
},
137137
textBlock: {
138-
headingLevel: 1
138+
headingLevel: 2
139139
}
140140
};
141141
}

packages/test/harness/src/browser/globals/checkAccessibility.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,39 @@
33
import 'axe-core';
44

55
export default function initializeCheckAccessibility() {
6+
axe.configure({
7+
checks: [
8+
{
9+
evaluate: (node, { selector }) => !node.querySelector(selector),
10+
id: 'webchat-has-no-heading-one',
11+
metadata: {
12+
impact: 'moderate',
13+
messages: {
14+
pass: 'Web Chat has no level-one heading',
15+
fail: 'Web Chat must have no level-one heading'
16+
}
17+
},
18+
options: {
19+
selector:
20+
'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level="1"], [role=heading][aria-level="1"]'
21+
}
22+
}
23+
],
24+
rules: [
25+
{
26+
all: ['webchat-has-no-heading-one'],
27+
id: 'webchat-has-no-heading-one',
28+
metadata: {
29+
description: 'As a component, ensures Web Chat does not contains any level-one heading.',
30+
help: 'No level-one heading is allowed in Web Chat',
31+
helpUrl: 'https://github.com/microsoft/BotFramework-WebChat/issues/4721'
32+
},
33+
selector: '#webchat',
34+
tags: ['webchat', 'cat.semantics', 'best-practice']
35+
}
36+
]
37+
});
38+
639
window.checkAccessibility ||
740
(window.checkAccessibility = async function checkAccessibilityBrowser() {
841
const startTime = Date.now();

packages/test/page-object/src/globals/testHelpers/activityGrouping/customAdaptiveCardsHostConfig.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const customAdaptiveCardsHostConfig = {
122122
spacing: 8
123123
},
124124
textBlock: {
125-
headingLevel: 1
125+
headingLevel: 2
126126
}
127127
};
128128

0 commit comments

Comments
 (0)