-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Accessibility behavior tests and documentation generation #14968
Changes from all commits
7c2cce4
62e28f2
0c5c65b
8eefec7
832899a
d95c074
071e0d7
c21cdf2
df6e0bb
a2168a7
ab319d4
f32733d
be41933
942446b
6df8780
58de7e9
a041178
761ed16
0f83787
65cf888
8a2357f
8ab96ed
89b56d7
5cd0ecb
497f075
fb2fa1c
438db4e
ee8be58
1078f5c
ccc74c6
44a290b
3a62193
846af10
d8c91dc
be90740
37bcc6a
b11f922
8541477
5f31556
8d8753d
bb8576e
cafc888
fe42d56
658aad4
27fe33e
16764ea
9c14142
0e7341a
cbe6f02
7ec71ee
e8c0fc5
96b542c
2fc633d
368c3fa
f0c220d
9687f42
ea3c8f5
c261bd7
4eed27e
4ab19c5
6762ab9
ce5794f
609b183
7b6c3fc
11d0548
29987e1
14b4aac
b779410
e929a2d
d412ace
ded98e7
df4fac6
5b5468f
def446d
8a5fa60
cdbd58f
6bdc75e
50836f4
43f0b9f
81bc5b6
1cf6b4c
79769b8
3ff524b
f937404
efa46d5
c75a8d7
7fe136b
d0b2903
20a9bca
990214c
199db5f
57fadd5
2ff230b
cce00c3
9d7b099
4461232
350f149
446ee01
fedb513
d1eb954
a408ed5
acf0ac0
8595de3
2f68d7c
23a2cbb
391610d
ba48f8f
72945ae
137bce4
17763ee
6dabdf0
d197a44
3aaf952
e70ef34
c604d8b
8b89e13
a420ac6
47e2e7c
8a408f9
d43fbc5
c77456c
48adbdf
e4841eb
d66ac86
745dbc8
415fbf7
fd42af2
072fe94
2bf9c6d
a0781f2
66f776a
7a252be
a0dccf6
9d0ec02
420f894
a9c6493
9d246b0
a3342e3
e29e673
405ebc9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"type": "none", | ||
"comment": "removing overrides from eslintrc.json file", | ||
"packageName": "@fluentui/eslint-plugin", | ||
"email": "email not defined", | ||
"dependentChangeType": "none", | ||
"date": "2020-09-24T15:16:06.898Z" | ||
} |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { Rule } from './../../types'; | ||
import { BehaviorRule } from './../../rules/rules'; | ||
|
||
export const buttonBehaviorDefinition: Rule[] = [ | ||
BehaviorRule.root() | ||
.forProps({ as: 'div' }) | ||
.hasAttribute('role', 'button') | ||
.description(`if element type is other than 'button'.`), | ||
BehaviorRule.root() | ||
.doesNotHaveAttribute('role') | ||
.description(`if element is native button.`), | ||
BehaviorRule.root() | ||
.forProps({ as: 'div' }) | ||
.hasAttribute('tabindex', '0') | ||
.description(`if element type is other than 'button'.`), | ||
BehaviorRule.root() | ||
.doesNotHaveAttribute('tabindex') | ||
.description(`if element is native 'button'.`), | ||
BehaviorRule.root() | ||
.forProps({ disabled: true }) | ||
.hasAttribute('disabled') | ||
.description(`based on 'disabled' prop when element is native 'button'.`), | ||
BehaviorRule.root() | ||
.forProps({ disabled: true, as: 'div' }) | ||
.doesNotHaveAttribute('disabled') | ||
.description(`if element is NOT native 'button'.`), | ||
BehaviorRule.root() | ||
.forProps({ disabled: true, loading: true }) | ||
.doesNotHaveAttribute('disabled') | ||
.description(`if element is loading.`), | ||
BehaviorRule.root() | ||
.forProps({ disabled: true }) | ||
.hasAttribute('aria-disabled', 'true') | ||
.description(`if property 'disabled' is 'true'.`), | ||
BehaviorRule.root() | ||
.forProps({ loading: true }) | ||
.hasAttribute('aria-disabled', 'true') | ||
.description(`if property 'aria-disabled' is 'true'.`), | ||
BehaviorRule.root() | ||
.forProps({ as: 'div' }) | ||
.pressSpaceKey() | ||
.verifyOnclickExecution() | ||
.description(`when element is not native 'button' or 'link'.`), | ||
BehaviorRule.root() | ||
.forProps({ as: 'div' }) | ||
.pressEnterKey() | ||
.verifyOnclickExecution() | ||
.description(`when element is not native 'button' or 'link'.`), | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { Rule } from './../../types'; | ||
import { BehaviorRule } from './../../rules/rules'; | ||
|
||
export const buttonGroupBehaviorDefinition: Rule[] = [BehaviorRule.root().hasAttribute('role', 'group')]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Rule } from './../../types'; | ||
import { BehaviorRule } from './../../rules/rules'; | ||
|
||
export const toggleButtonBehaviorDefinition: Rule[] = [ | ||
BehaviorRule.root() | ||
.forProps({ active: 'true' }) | ||
.hasAttribute('aria-pressed', 'true') | ||
.description(`if element has active prop.`), | ||
BehaviorRule.root() | ||
.hasAttribute('aria-pressed', 'false') | ||
.description(`if element has no 'active' prop.`), | ||
]; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './Button/buttonBehaviorDefinition'; | ||
export * from './Button/buttonGroupBehaviorDefinition'; | ||
export * from './Button/toggleButtonBehaviorDefinition'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export * from './types'; | ||
export * from './validators'; | ||
export * from './facades'; | ||
export * from './rules'; | ||
export * from './definitions'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
export * from './rules'; | ||
export * from './types'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"baseUrl": ".", | ||
"outDir": "lib", | ||
"target": "es6", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing this line because it break the condition
disabled: props.disabled && !props.loading ? (props.as === 'button' ? true : undefined) : undefined,
which is in ButtonBehavior.ts file.
This issue was found by tests.