Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -83,8 +83,8 @@ jobs:
- *copy_bazel_config

# TODO(jelbourn): Update this command to run all tests if the Bazel issues have been fixed.
- run: bazel build src/cdk/... src/lib:material
- run: bazel test src/cdk/...
- run: bazel build src/cdk/... src/lib/...
- run: bazel test src/cdk/... src/lib/...

- *save_cache

Expand Down
5 changes: 4 additions & 1 deletion src/lib/BUILD.bazel
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,5 +46,8 @@ ng_package(
packages = ["//src/lib/schematics:npm_package"],
replacements = VERSION_PLACEHOLDER_REPLACEMENTS,
deps = MATERIAL_TARGETS,
tags = ["publish"],
# TODO(devversion): Use the npm package for publishing. Right now this is disabled because
# we build using AOT for serving & testing, but the `ng_package` rule should not include factory
# files.
tags = ["manual"],
)
28 changes: 27 additions & 1 deletion src/lib/autocomplete/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "autocomplete",
Expand DownExpand Up@@ -42,3 +42,29 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "autocomplete_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/forms",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser/animations",
"@rxjs",
"@rxjs//operators",
"//src/cdk/bidi",
"//src/cdk/keycodes",
"//src/cdk/overlay",
"//src/cdk/scrolling",
"//src/cdk/testing",
"//src/lib/core",
"//src/lib/form-field",
"//src/lib/input",
":autocomplete"
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":autocomplete_test_sources"],
)
18 changes: 17 additions & 1 deletion src/lib/badge/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "badge",
Expand All@@ -26,3 +26,19 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "badge_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/platform-browser",
"//src/lib/core",
":badge",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":badge_test_sources"],
)

24 changes: 23 additions & 1 deletion src/lib/bottom-sheet/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "bottom-sheet",
Expand DownExpand Up@@ -42,3 +42,25 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "bottom_sheet_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/common",
"@angular//packages/common/testing",
"@angular//packages/platform-browser/animations",
"//src/cdk/bidi",
"//src/cdk/keycodes",
"//src/cdk/overlay",
"//src/cdk/scrolling",
"//src/cdk/testing",
":bottom-sheet",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":bottom_sheet_test_sources"],
)

19 changes: 18 additions & 1 deletion src/lib/button-toggle/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "button-toggle",
Expand DownExpand Up@@ -34,3 +34,20 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "button_toggle_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/forms",
"@angular//packages/platform-browser",
"//src/cdk/testing",
":button-toggle",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":button_toggle_test_sources"],
)

17 changes: 16 additions & 1 deletion src/lib/button/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "button",
Expand DownExpand Up@@ -41,3 +41,18 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "button_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/platform-browser",
"//src/lib/core",
":button"
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":button_test_sources"],
)
19 changes: 18 additions & 1 deletion src/lib/checkbox/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "checkbox",
Expand DownExpand Up@@ -36,3 +36,20 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "checkbox_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/forms",
"@angular//packages/platform-browser",
"//src/cdk/observers",
"//src/cdk/testing",
":checkbox",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":checkbox_test_sources"],
)
26 changes: 25 additions & 1 deletion src/lib/chips/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "chips",
Expand DownExpand Up@@ -40,3 +40,27 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "chips_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/animations",
"@angular//packages/forms",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser/animations",
"//src/cdk/a11y",
"//src/cdk/bidi",
"//src/cdk/keycodes",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/lib/form-field",
"//src/lib/input",
":chips",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":chips_test_sources"],
)
24 changes: 22 additions & 2 deletions src/lib/core/BUILD.bazel
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,7 +2,7 @@ package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//:packages.bzl", "MATERIAL_PACKAGES")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

exports_files(["theming/_theming.scss"])

Expand DownExpand Up@@ -30,7 +30,6 @@ ng_module(
],
)


# TODO(jelbourn): remove this when sass_library acts like a filegroup
filegroup(
name = "core_scss_partials",
Expand DownExpand Up@@ -106,3 +105,24 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

#################
# Test targets
#################

ng_test_library(
name = "core_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/platform-browser",
"@angular//packages/platform-browser/animations",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/lib/core",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":core_test_sources"],
)
30 changes: 27 additions & 3 deletions src/lib/datepicker/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "datepicker",
Expand DownExpand Up@@ -64,9 +64,33 @@ sass_binary(
deps = ["//src/lib/core:core_scss_lib"],
)



sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "datepicker_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/forms",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser-dynamic/testing",
"@angular//packages/platform-browser/animations",
"@rxjs",
"//src/cdk/bidi",
"//src/cdk/keycodes",
"//src/cdk/overlay",
"//src/cdk/scrolling",
"//src/cdk/testing",
"//src/lib/core",
"//src/lib/form-field",
"//src/lib/input",
":datepicker",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":datepicker_test_sources"],
)
4 changes: 2 additions & 2 deletions src/lib/datepicker/datepicker.spec.ts
Original file line numberDiff line numberDiff line change
Expand Up@@ -604,7 +604,7 @@ describe('MatDatepicker', () => {

// When the calendar is in year view, the first cell should be for a month rather than
// for a date.
expect(firstCalendarCell.textContent)
expect(firstCalendarCell.textContent!.trim())
.toBe('JAN', 'Expected the calendar to be in year-view');
});

Expand DownExpand Up@@ -654,7 +654,7 @@ describe('MatDatepicker', () => {

// When the calendar is in year view, the first cell should be for a month rather than
// for a date.
expect(firstCalendarCell.textContent)
expect(firstCalendarCell.textContent!.trim())
.toBe('2016', 'Expected the calendar to be in multi-year-view');
});

Expand Down
25 changes: 24 additions & 1 deletion src/lib/dialog/BUILD.bazel
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
package(default_visibility=["//visibility:public"])

load("@io_bazel_rules_sass//sass:sass.bzl", "sass_library", "sass_binary")
load("//tools:defaults.bzl", "ng_module")
load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "dialog",
Expand DownExpand Up@@ -39,3 +39,26 @@ sass_library(
name = "theme",
srcs = glob(["**/*-theme.scss"]),
)

ng_test_library(
name = "dialog_test_sources",
srcs = glob(["**/*.spec.ts"]),
deps = [
"@angular//packages/common",
"@angular//packages/common/testing",
"@angular//packages/platform-browser",
"@angular//packages/platform-browser/animations",
"@rxjs",
"//src/cdk/bidi",
"//src/cdk/keycodes",
"//src/cdk/overlay",
"//src/cdk/scrolling",
"//src/cdk/testing",
":dialog",
]
)

ng_web_test_suite(
name = "unit_tests",
deps = [":dialog_test_sources"],
)
Loading