Skip to content

Commit 72498b4

Browse files
authored
fix(aria/grid): unit tests and small fixes for grid directives (#32841)
1 parent 65db13a commit 72498b4

File tree

8 files changed

+1109
-6
lines changed

8 files changed

+1109
-6
lines changed

goldens/aria/private/index.api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ export class GridPattern {
421421
readonly inputs: GridInputs;
422422
readonly isFocused: WritableSignalLike<boolean>;
423423
readonly keydown: SignalLike<KeyboardEventManager<KeyboardEvent>>;
424+
readonly multiSelectable: SignalLike<boolean | undefined>;
424425
readonly nextColKey: SignalLike<"ArrowRight" | "ArrowLeft">;
425426
onFocusIn(event: FocusEvent): void;
426427
onFocusOut(event: FocusEvent): void;

src/aria/grid/BUILD.bazel

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
load("//tools:defaults.bzl", "extract_api_to_json", "ng_project")
1+
load("//tools:defaults.bzl", "extract_api_to_json", "ng_project", "ng_web_test_suite")
22

33
package(default_visibility = ["//visibility:public"])
44

@@ -16,6 +16,27 @@ ng_project(
1616
],
1717
)
1818

19+
ng_project(
20+
name = "unit_test_sources",
21+
testonly = True,
22+
srcs = glob(
23+
["**/*.spec.ts"],
24+
exclude = ["**/*.e2e.spec.ts"],
25+
),
26+
deps = [
27+
":grid",
28+
"//:node_modules/@angular/core",
29+
"//:node_modules/@angular/platform-browser",
30+
"//:node_modules/axe-core",
31+
"//src/cdk/testing/private",
32+
],
33+
)
34+
35+
ng_web_test_suite(
36+
name = "unit_tests",
37+
deps = [":unit_test_sources"],
38+
)
39+
1940
filegroup(
2041
name = "source-files",
2142
srcs = glob(

src/aria/grid/grid-cell-widget.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {GRID_CELL} from './grid-tokens';
4646
'[attr.data-active]': 'active()',
4747
'[attr.data-active-control]': 'isActivated() ? "widget" : "cell"',
4848
'[tabindex]': '_tabIndex()',
49+
'[attr.id]': 'id()',
4950
},
5051
})
5152
export class GridCellWidget {

src/aria/grid/grid-cell.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class GridCell {
135135
toggle('role', this.role());
136136
toggle('id', pattern.id());
137137
toggle('rowspan', rowSpan);
138-
toggle('colspan', rowSpan);
138+
toggle('colspan', colSpan);
139139
toggle('aria-rowspan', rowSpan);
140140
toggle('aria-colspan', colSpan);
141141
toggle('data-active', this.active());

0 commit comments

Comments
 (0)