Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptive Cards TextBlock heading should start at level 2 #4747

Merged
merged 8 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
"packages/*/dist": false,
"packages/*/lib": false
},
"typescript.tsdk": "packages\\component\\node_modules\\typescript\\lib"
"typescript.tsdk": "packages\\component\\node_modules\\typescript\\lib",
"prettier.prettierPath": "./node_modules/prettier"
}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Fixed

- 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)
- 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)

## [4.15.8] - 2023-06-06

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions __tests__/html/replyToId.firstSetOfActivities.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
clock.tick(1000);

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

directLine.activityDeferredObservable.next({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default function createAdaptiveCardsHostConfig(styleOptions: FullBundleSt
spacing: 8
},
textBlock: {
headingLevel: 1
headingLevel: 2
}
};
}
33 changes: 33 additions & 0 deletions packages/test/harness/src/browser/globals/checkAccessibility.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@
import 'axe-core';

export default function initializeCheckAccessibility() {
axe.configure({
checks: [
{
evaluate: (node, { selector }) => !node.querySelector(selector),
id: 'webchat-has-no-heading-one',
metadata: {
impact: 'moderate',
messages: {
pass: 'Web Chat has no level-one heading',
fail: 'Web Chat must have no level-one heading'
}
},
options: {
selector:
'h1:not([role], [aria-level]), :is(h1, h2, h3, h4, h5, h6):not([role])[aria-level="1"], [role=heading][aria-level="1"]'
}
}
],
rules: [
{
all: ['webchat-has-no-heading-one'],
id: 'webchat-has-no-heading-one',
metadata: {
description: 'As a component, ensures Web Chat does not contains any level-one heading.',
help: 'No level-one heading is allowed in Web Chat',
helpUrl: 'https://github.com/microsoft/BotFramework-WebChat/issues/4721'
},
selector: '#webchat',
tags: ['webchat', 'cat.semantics', 'best-practice']
}
]
});

window.checkAccessibility ||
(window.checkAccessibility = async function checkAccessibilityBrowser() {
const startTime = Date.now();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const customAdaptiveCardsHostConfig = {
spacing: 8
},
textBlock: {
headingLevel: 1
headingLevel: 2
}
};

Expand Down