Skip to content

Commit 7b73ea5

Browse files
authored
cleanup: restructure select harness to follow the same file st… (#17120)
* cleanup: restructure select harness to follow the same file structure as other harnesses The select harness should remain in experimental until the form-field harness is developed. * fix owner lint
1 parent 6a732d3 commit 7b73ea5

File tree

10 files changed

+126
-134
lines changed

10 files changed

+126
-134
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
/src/material-experimental/mdc-theming/** @mmalerba
111111
/src/material-experimental/mdc-typography/** @mmalerba
112112
/src/material-experimental/popover-edit/** @kseamon @andrewseguin
113+
/src/material-experimental/select/** @crisbeto
113114

114115
# CDK experimental package
115116
/src/cdk-experimental/** @jelbourn

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

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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-select",
@@ -22,17 +22,6 @@ ng_module(
2222
],
2323
)
2424

25-
ts_library(
26-
name = "harness",
27-
srcs = glob(
28-
["harness/**/*.ts"],
29-
exclude = ["**/*.spec.ts"],
30-
),
31-
deps = [
32-
"//src/cdk/testing",
33-
],
34-
)
35-
3625
sass_library(
3726
name = "mdc_select_scss_lib",
3827
srcs = glob(["**/_*.scss"]),
@@ -50,33 +39,6 @@ sass_binary(
5039
deps = [],
5140
)
5241

53-
ng_test_library(
54-
name = "select_tests_lib",
55-
srcs = [
56-
"harness/select-harness.spec.ts",
57-
],
58-
deps = [
59-
":harness",
60-
":mdc-select",
61-
"//src/cdk/overlay",
62-
"//src/cdk/platform",
63-
"//src/cdk/testing",
64-
"//src/cdk/testing/testbed",
65-
"//src/material/form-field",
66-
"//src/material/select",
67-
"@npm//@angular/forms",
68-
"@npm//@angular/platform-browser",
69-
],
70-
)
71-
72-
ng_web_test_suite(
73-
name = "unit_tests",
74-
deps = [
75-
":select_tests_lib",
76-
"//src/material-experimental:mdc_require_config.js",
77-
],
78-
)
79-
8042
ng_e2e_test_library(
8143
name = "e2e_test_sources",
8244
srcs = glob(["**/*.e2e.spec.ts"]),

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

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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-experimental/select/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/form-field",
27+
"//src/material/select",
28+
"@npm//@angular/forms",
29+
"@npm//@angular/platform-browser",
30+
],
31+
)
32+
33+
ng_test_library(
34+
name = "unit_tests_lib",
35+
srcs = glob(
36+
["**/*.spec.ts"],
37+
exclude = ["shared.spec.ts"],
38+
),
39+
deps = [
40+
":harness_tests_lib",
41+
":testing",
42+
"//src/material/select",
43+
],
44+
)
45+
46+
ng_web_test_suite(
47+
name = "unit_tests",
48+
deps = [":unit_tests_lib"],
49+
)
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 './select-harness';
10+
export * from './select-harness-filters';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {MatSelectModule} from '@angular/material/select';
2+
import {MatSelectHarness} from './select-harness';
3+
import {runHarnessTests} from './shared.spec';
4+
5+
describe('Non-MDC-based MatSelectHarness', () => {
6+
runHarnessTests(MatSelectModule, MatSelectHarness);
7+
});

0 commit comments

Comments
 (0)