Skip to content

Commit 165d853

Browse files
test(material-experimental/chips) Port unit tests for mdc chips
1 parent 5b3e846 commit 165d853

19 files changed

+3300
-91
lines changed

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

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package(default_visibility = ["//visibility:public"])
22

33
load("@io_bazel_rules_sass//:defs.bzl", "sass_binary", "sass_library")
4-
load("//tools:defaults.bzl", "ng_e2e_test_library", "ng_module", "protractor_web_test_suite")
4+
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")
55

66
ng_module(
77
name = "mdc-chips",
@@ -14,6 +14,7 @@ ng_module(
1414
deps = [
1515
"//src/material/core",
1616
"//src/material/form-field",
17+
"@npm//@angular/animations",
1718
"@npm//@angular/common",
1819
"@npm//@angular/core",
1920
"@npm//@angular/forms",
@@ -44,26 +45,36 @@ sass_binary(
4445
],
4546
)
4647

47-
ng_e2e_test_library(
48-
name = "e2e_test_sources",
49-
srcs = glob(["**/*.e2e.spec.ts"]),
48+
ng_test_library(
49+
name = "chips_tests_lib",
50+
srcs = glob(
51+
["**/*.spec.ts"],
52+
exclude = ["**/*.e2e.spec.ts"],
53+
),
5054
deps = [
51-
"//src/cdk/testing/e2e",
55+
":mdc-chips",
56+
"//src/cdk/a11y",
57+
"//src/cdk/bidi",
58+
"//src/cdk/keycodes",
59+
"//src/cdk/platform",
60+
"//src/cdk/testing",
61+
"//src/material/core",
62+
"//src/material/form-field",
63+
"//src/material/input",
64+
"@npm//@angular/animations",
65+
"@npm//@angular/common",
66+
"@npm//@angular/forms",
67+
"@npm//@angular/platform-browser",
68+
"@npm//material-components-web",
69+
"@npm//rxjs",
5270
],
5371
)
5472

55-
protractor_web_test_suite(
56-
name = "e2e_tests",
57-
configuration = "//src/e2e-app:protractor.conf.js",
58-
data = [
59-
"//tools/axe-protractor",
60-
"@npm//@angular/bazel",
61-
],
62-
on_prepare = "//src/e2e-app:start-devserver.js",
63-
server = "//src/e2e-app:devserver",
64-
tags = ["e2e"],
73+
ng_web_test_suite(
74+
name = "unit_tests",
75+
static_files = ["@npm//node_modules/@material/chips:dist/mdc.chips.js"],
6576
deps = [
66-
":e2e_test_sources",
67-
"//src/cdk/testing/e2e",
77+
":chips_tests_lib",
78+
"//src/material-experimental:mdc_require_config.js",
6879
],
6980
)

0 commit comments

Comments
 (0)