test(multiple): check for incorrect usage of Angular Aria directives and log violations#33195
test(multiple): check for incorrect usage of Angular Aria directives and log violations#33195adolgachev wants to merge 9 commits intoangular:mainfrom
Conversation
1b0bef9 to
8a745a6
Compare
8a745a6 to
be06cbf
Compare
249d896 to
0c9eb7b
Compare
14258d5 to
e631419
Compare
ea9143c to
e17912e
Compare
…es and log violations
… and log violations
…nd log violations
…nd log violations
…g element and violations
e17912e to
15a16d9
Compare
| read: () => { | ||
| const violations: string[] = []; | ||
| if (!this._popup()) { | ||
| violations.push( |
There was a problem hiding this comment.
This is actually erroring out on the demo page, even when set up. I can investigate further possible timing issue or we could just punt it to possibly deal with it later.
There was a problem hiding this comment.
Possibly due to the recent change that hides the overlay when a popup is collapsed.
| validate(): string[] { | ||
| const violations: string[] = []; | ||
|
|
||
| const rows = this.inputs.rows(); |
There was a problem hiding this comment.
Those are probably invalid when used as a filterable table.
| validate(): string[] { | ||
| const violations: string[] = []; | ||
|
|
||
| if (this.inputs.items().length === 0) { |
There was a problem hiding this comment.
Same comment. This might be invalid when used as a filterable tree.
| /** Logs each of the violations to the console as errors, optionally with the host element context. */ | ||
| export function reportViolations(violations: string[], element: Element): void { | ||
| if (violations.length) { | ||
| console.error('Violations found on element: %o:', element); |
There was a problem hiding this comment.
warn is probably less aggressive give the violations don't break the build.
| tab: this._tabPattern, | ||
| }); | ||
|
|
||
| private readonly _tabContent = contentChild(TabContent); |
There was a problem hiding this comment.
Should probably consolidate this into the DeferredContent and check whether a DeferredContent is missing when DeferredContentAware is used.
| read: () => { | ||
| const violations: string[] = []; | ||
| if (!this._popup()) { | ||
| violations.push( |
There was a problem hiding this comment.
Possibly due to the recent change that hides the overlay when a popup is collapsed.
Used gemini to go through all of the components and generate additional violation checks for possible issues with how each set of angular aria directives are used together. Also generated specs for the new and previously existing violations.
Final commit adds a utility method to report the violations which does the console.error but also takes in an element to help in location where the issue is coming from.