Skip to content

Commit c07ec04

Browse files
devversionjelbourn
authored andcommitted
feat(material-experimental/mdc-input): add test harness (#18224)
1 parent 0cd759c commit c07ec04

File tree

5 files changed

+74
-0
lines changed

5 files changed

+74
-0
lines changed

src/material-experimental/config.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ entryPoints = [
1010
"mdc-form-field",
1111
"mdc-form-field/testing",
1212
"mdc-input",
13+
"mdc-input/testing",
1314
"mdc-list",
1415
"mdc-menu",
1516
"mdc-menu/testing",
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
package(default_visibility = ["//visibility:public"])
2+
3+
load("//tools:defaults.bzl", "ng_test_library", "ng_web_test_suite", "ts_library")
4+
5+
ts_library(
6+
name = "testing",
7+
srcs = glob(
8+
["**/*.ts"],
9+
exclude = ["**/*.spec.ts"],
10+
),
11+
module_name = "@angular/material-experimental/mdc-input/testing",
12+
deps = [
13+
"//src/material/form-field/testing/control",
14+
"//src/material/input/testing",
15+
],
16+
)
17+
18+
filegroup(
19+
name = "source-files",
20+
srcs = glob(["**/*.ts"]),
21+
)
22+
23+
ng_test_library(
24+
name = "unit_tests_lib",
25+
srcs = glob(
26+
["**/*.spec.ts"],
27+
exclude = ["shared.spec.ts"],
28+
),
29+
deps = [
30+
":testing",
31+
"//src/material-experimental/mdc-input",
32+
"//src/material/input/testing:harness_tests_lib",
33+
],
34+
)
35+
36+
ng_web_test_suite(
37+
name = "unit_tests",
38+
static_files = [
39+
"@npm//:node_modules/@material/textfield/dist/mdc.textfield.js",
40+
"@npm//:node_modules/@material/line-ripple/dist/mdc.lineRipple.js",
41+
"@npm//:node_modules/@material/notched-outline/dist/mdc.notchedOutline.js",
42+
"@npm//:node_modules/@material/floating-label/dist/mdc.floatingLabel.js",
43+
],
44+
deps = [
45+
":unit_tests_lib",
46+
"//src/material-experimental:mdc_require_config.js",
47+
],
48+
)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export * from './public-api';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {MatInputModule} from '@angular/material-experimental/mdc-input';
2+
import {runHarnessTests} from '@angular/material/input/testing/shared.spec';
3+
import {MatInputHarness} from './index';
4+
5+
describe('MDC-based MatInputHarness', () => {
6+
runHarnessTests(MatInputModule, MatInputHarness);
7+
});
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
export {InputHarnessFilters, MatInputHarness} from '@angular/material/input/testing';

0 commit comments

Comments
 (0)