Skip to content

Commit dec116b

Browse files
mmalerbajelbourn
authored andcommitted
feat(autocomplete): move harness out of experimental (#17080)
1 parent 7a433f6 commit dec116b

File tree

16 files changed

+127
-145
lines changed

16 files changed

+127
-145
lines changed

src/material-experimental/mdc-autocomplete/BUILD.bazel

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package(default_visibility = ["//visibility:public"])
22

33
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
44
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
5-
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite", "ts_library")
5+
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module")
66

77
ng_module(
88
name = "mdc-autocomplete",
99
srcs = glob(
1010
["**/*.ts"],
1111
exclude = [
1212
"**/*.spec.ts",
13-
"harness/**",
1413
],
1514
),
1615
assets = [
@@ -22,18 +21,6 @@ ng_module(
2221
],
2322
)
2423

25-
ts_library(
26-
name = "harness",
27-
srcs = glob(
28-
["harness/**/*.ts"],
29-
exclude = ["**/*.spec.ts"],
30-
),
31-
deps = [
32-
"//src/cdk/coercion",
33-
"//src/cdk/testing",
34-
],
35-
)
36-
3724
sass_library(
3825
name = "mdc_autocomplete_scss_lib",
3926
srcs = glob(["**/_*.scss"]),
@@ -57,31 +44,6 @@ sass_binary(
5744
],
5845
)
5946

60-
ng_test_library(
61-
name = "autocomplete_tests_lib",
62-
srcs = [
63-
"harness/autocomplete-harness.spec.ts",
64-
],
65-
deps = [
66-
":harness",
67-
":mdc-autocomplete",
68-
"//src/cdk/overlay",
69-
"//src/cdk/platform",
70-
"//src/cdk/testing",
71-
"//src/cdk/testing/testbed",
72-
"//src/material/autocomplete",
73-
"@npm//@angular/platform-browser",
74-
],
75-
)
76-
77-
ng_web_test_suite(
78-
name = "unit_tests",
79-
deps = [
80-
":autocomplete_tests_lib",
81-
"//src/material-experimental:mdc_require_config.js",
82-
],
83-
)
84-
8547
ng_e2e_test_library(
8648
name = "e2e_test_sources",
8749
srcs = glob(["**/*.e2e.spec.ts"]),

src/material-experimental/mdc-autocomplete/harness/mdc-autocomplete-harness.ts

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/material-experimental/mdc-checkbox/BUILD.bazel

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ package(default_visibility = ["//visibility:public"])
22

33
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
44
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
5-
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite", "ts_library")
5+
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "ng_test_library", "ng_web_test_suite")
66

77
ng_module(
88
name = "mdc-checkbox",
99
srcs = glob(
1010
["**/*.ts"],
1111
exclude = [
1212
"**/*.spec.ts",
13-
"harness/**",
1413
],
1514
),
1615
assets = [":checkbox_scss"] + glob(["**/*.html"]),
@@ -29,18 +28,6 @@ ng_module(
2928
],
3029
)
3130

32-
ts_library(
33-
name = "harness",
34-
srcs = glob(
35-
["harness/**/*.ts"],
36-
exclude = ["**/*.spec.ts"],
37-
),
38-
deps = [
39-
"//src/cdk/coercion",
40-
"//src/cdk/testing",
41-
],
42-
)
43-
4431
sass_library(
4532
name = "mdc_checkbox_scss_lib",
4633
srcs = glob(["**/_*.scss"]),
@@ -69,7 +56,6 @@ ng_test_library(
6956
exclude = ["**/*.e2e.spec.ts"],
7057
),
7158
deps = [
72-
":harness",
7359
":mdc-checkbox",
7460
"//src/cdk/testing",
7561
"//src/cdk/testing/testbed",

src/material-experimental/mdc-checkbox/testing/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ ng_test_library(
2222
deps = [
2323
":testing",
2424
"//src/material-experimental/mdc-checkbox",
25-
"//src/material/checkbox/testing:shared_unit_tests",
25+
"//src/material/checkbox/testing:harness_tests_lib",
2626
],
2727
)
2828

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {MatCheckboxModule} from '../index';
22
import {MatCheckboxHarness} from './checkbox-harness';
3-
import {runTests} from '@angular/material/checkbox/testing/shared.spec';
3+
import {runHarnessTests} from '@angular/material/checkbox/testing/shared.spec';
44

55
describe('MDC-based MatCheckboxHarness', () => {
6-
runTests(MatCheckboxModule, MatCheckboxHarness as any);
6+
runHarnessTests(MatCheckboxModule, MatCheckboxHarness as any);
77
});
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_module", "ng_test_library", "ng_web_test_suite")
4+
5+
ng_module(
6+
name = "testing",
7+
srcs = glob(
8+
["**/*.ts"],
9+
exclude = ["**/*.spec.ts"],
10+
),
11+
module_name = "@angular/material/autocomplete/testing",
12+
deps = [
13+
"//src/cdk/coercion",
14+
"//src/cdk/testing",
15+
],
16+
)
17+
18+
ng_test_library(
19+
name = "harness_tests_lib",
20+
srcs = ["shared.spec.ts"],
21+
deps = [
22+
":testing",
23+
"//src/cdk/overlay",
24+
"//src/cdk/testing",
25+
"//src/cdk/testing/testbed",
26+
"//src/material/autocomplete",
27+
"@npm//@angular/forms",
28+
"@npm//@angular/platform-browser",
29+
],
30+
)
31+
32+
ng_test_library(
33+
name = "unit_tests_lib",
34+
srcs = glob(
35+
["**/*.spec.ts"],
36+
exclude = ["shared.spec.ts"],
37+
),
38+
deps = [
39+
":harness_tests_lib",
40+
":testing",
41+
"//src/material/autocomplete",
42+
],
43+
)
44+
45+
ng_web_test_suite(
46+
name = "unit_tests",
47+
deps = [":unit_tests_lib"],
48+
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {MatAutocompleteModule} from '@angular/material/autocomplete';
2+
import {runHarnessTests} from '@angular/material/autocomplete/testing/shared.spec';
3+
import {MatAutocompleteHarness} from './autocomplete-harness';
4+
5+
describe('Non-MDC-based MatAutocompleteHarness', () => {
6+
runHarnessTests(MatAutocompleteModule, MatAutocompleteHarness);
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 * from './public-api';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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 './autocomplete-harness';
10+
export * from './autocomplete-harness-filters';

0 commit comments

Comments
 (0)