Skip to content

Commit ca53bb5

Browse files
authored
build: fix select e2e tests (#25375)
In a previous PR I assumed that a timeout in the select e2e tests was a flake, but it was actually a failure, because the test is running against the docs examples which were switched over to MDC.
1 parent 7acbf1f commit ca53bb5

File tree

3 files changed

+31
-23
lines changed

3 files changed

+31
-23
lines changed

src/material/legacy-select/BUILD.bazel

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
21
load(
32
"//tools:defaults.bzl",
43
"markdown_to_html",
5-
"ng_e2e_test_library",
64
"ng_module",
75
"ng_test_library",
86
"ng_web_test_suite",
@@ -43,10 +41,7 @@ sass_binary(
4341

4442
ng_test_library(
4543
name = "unit_test_sources",
46-
srcs = glob(
47-
["**/*.spec.ts"],
48-
exclude = ["**/*.e2e.spec.ts"],
49-
),
44+
srcs = glob(["**/*.spec.ts"]),
5045
deps = [
5146
":legacy-select",
5247
"//src/cdk/a11y",
@@ -70,19 +65,6 @@ ng_web_test_suite(
7065
deps = [":unit_test_sources"],
7166
)
7267

73-
ng_e2e_test_library(
74-
name = "e2e_test_sources",
75-
srcs = glob(["**/*.e2e.spec.ts"]),
76-
deps = [
77-
"//src/cdk/testing/private/e2e",
78-
],
79-
)
80-
81-
e2e_test_suite(
82-
name = "e2e_tests",
83-
deps = [":e2e_test_sources"],
84-
)
85-
8668
markdown_to_html(
8769
name = "overview",
8870
srcs = [":select.md"],

src/material/select/BUILD.bazel

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
load("//tools:defaults.bzl", "markdown_to_html", "ng_module", "ng_test_library", "ng_web_test_suite", "sass_binary", "sass_library")
1+
load("//src/e2e-app:test_suite.bzl", "e2e_test_suite")
2+
load(
3+
"//tools:defaults.bzl",
4+
"markdown_to_html",
5+
"ng_e2e_test_library",
6+
"ng_module",
7+
"ng_test_library",
8+
"ng_web_test_suite",
9+
"sass_binary",
10+
"sass_library",
11+
)
212

313
package(default_visibility = ["//visibility:public"])
414

@@ -51,7 +61,10 @@ sass_binary(
5161

5262
ng_test_library(
5363
name = "select_tests_lib",
54-
srcs = glob(["**/*.spec.ts"]),
64+
srcs = glob(
65+
["**/*.spec.ts"],
66+
exclude = ["**/*.e2e.spec.ts"],
67+
),
5568
deps = [
5669
":select",
5770
"//src/cdk/a11y",
@@ -75,6 +88,19 @@ ng_web_test_suite(
7588
],
7689
)
7790

91+
ng_e2e_test_library(
92+
name = "e2e_test_sources",
93+
srcs = glob(["**/*.e2e.spec.ts"]),
94+
deps = [
95+
"//src/cdk/testing/private/e2e",
96+
],
97+
)
98+
99+
e2e_test_suite(
100+
name = "e2e_tests",
101+
deps = [":e2e_test_sources"],
102+
)
103+
78104
markdown_to_html(
79105
name = "overview",
80106
srcs = [":select.md"],

src/material/legacy-select/select.e2e.spec.ts renamed to src/material/select/select.e2e.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ describe('select', () => {
1111
// accidentally. This could happen because the select panel is removed from DOM
1212
// immediately when an option is clicked. Usually ripples still fade-in at that point.
1313
it('should not accidentally persist ripples', async () => {
14-
const select = getElement('.mat-select');
15-
const options = element.all(by.css('.mat-option'));
14+
const select = getElement('.mat-mdc-select');
15+
const options = element.all(by.css('.mat-mdc-option'));
1616
const ripples = element.all(by.css('.mat-ripple-element'));
1717

1818
// Wait for select to be rendered.

0 commit comments

Comments
 (0)