Skip to content

Commit

Permalink
feat(autocomplete): move harness out of experimental (#17080)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba authored and jelbourn committed Sep 16, 2019
1 parent 7a433f6 commit dec116b
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 145 deletions.
40 changes: 1 addition & 39 deletions src/material-experimental/mdc-autocomplete/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package(default_visibility = ["//visibility:public"])

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

ng_module(
name = "mdc-autocomplete",
srcs = glob(
["**/*.ts"],
exclude = [
"**/*.spec.ts",
"harness/**",
],
),
assets = [
Expand All @@ -22,18 +21,6 @@ ng_module(
],
)

ts_library(
name = "harness",
srcs = glob(
["harness/**/*.ts"],
exclude = ["**/*.spec.ts"],
),
deps = [
"//src/cdk/coercion",
"//src/cdk/testing",
],
)

sass_library(
name = "mdc_autocomplete_scss_lib",
srcs = glob(["**/_*.scss"]),
Expand All @@ -57,31 +44,6 @@ sass_binary(
],
)

ng_test_library(
name = "autocomplete_tests_lib",
srcs = [
"harness/autocomplete-harness.spec.ts",
],
deps = [
":harness",
":mdc-autocomplete",
"//src/cdk/overlay",
"//src/cdk/platform",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/autocomplete",
"@npm//@angular/platform-browser",
],
)

ng_web_test_suite(
name = "unit_tests",
deps = [
":autocomplete_tests_lib",
"//src/material-experimental:mdc_require_config.js",
],
)

ng_e2e_test_library(
name = "e2e_test_sources",
srcs = glob(["**/*.e2e.spec.ts"]),
Expand Down

This file was deleted.

16 changes: 1 addition & 15 deletions src/material-experimental/mdc-checkbox/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package(default_visibility = ["//visibility:public"])

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

ng_module(
name = "mdc-checkbox",
srcs = glob(
["**/*.ts"],
exclude = [
"**/*.spec.ts",
"harness/**",
],
),
assets = [":checkbox_scss"] + glob(["**/*.html"]),
Expand All @@ -29,18 +28,6 @@ ng_module(
],
)

ts_library(
name = "harness",
srcs = glob(
["harness/**/*.ts"],
exclude = ["**/*.spec.ts"],
),
deps = [
"//src/cdk/coercion",
"//src/cdk/testing",
],
)

sass_library(
name = "mdc_checkbox_scss_lib",
srcs = glob(["**/_*.scss"]),
Expand Down Expand Up @@ -69,7 +56,6 @@ ng_test_library(
exclude = ["**/*.e2e.spec.ts"],
),
deps = [
":harness",
":mdc-checkbox",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
Expand Down
2 changes: 1 addition & 1 deletion src/material-experimental/mdc-checkbox/testing/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ng_test_library(
deps = [
":testing",
"//src/material-experimental/mdc-checkbox",
"//src/material/checkbox/testing:shared_unit_tests",
"//src/material/checkbox/testing:harness_tests_lib",
],
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {MatCheckboxModule} from '../index';
import {MatCheckboxHarness} from './checkbox-harness';
import {runTests} from '@angular/material/checkbox/testing/shared.spec';
import {runHarnessTests} from '@angular/material/checkbox/testing/shared.spec';

describe('MDC-based MatCheckboxHarness', () => {
runTests(MatCheckboxModule, MatCheckboxHarness as any);
runHarnessTests(MatCheckboxModule, MatCheckboxHarness as any);
});
48 changes: 48 additions & 0 deletions src/material/autocomplete/testing/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "ng_module", "ng_test_library", "ng_web_test_suite")

ng_module(
name = "testing",
srcs = glob(
["**/*.ts"],
exclude = ["**/*.spec.ts"],
),
module_name = "@angular/material/autocomplete/testing",
deps = [
"//src/cdk/coercion",
"//src/cdk/testing",
],
)

ng_test_library(
name = "harness_tests_lib",
srcs = ["shared.spec.ts"],
deps = [
":testing",
"//src/cdk/overlay",
"//src/cdk/testing",
"//src/cdk/testing/testbed",
"//src/material/autocomplete",
"@npm//@angular/forms",
"@npm//@angular/platform-browser",
],
)

ng_test_library(
name = "unit_tests_lib",
srcs = glob(
["**/*.spec.ts"],
exclude = ["shared.spec.ts"],
),
deps = [
":harness_tests_lib",
":testing",
"//src/material/autocomplete",
],
)

ng_web_test_suite(
name = "unit_tests",
deps = [":unit_tests_lib"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {MatAutocompleteModule} from '@angular/material/autocomplete';
import {runHarnessTests} from '@angular/material/autocomplete/testing/shared.spec';
import {MatAutocompleteHarness} from './autocomplete-harness';

describe('Non-MDC-based MatAutocompleteHarness', () => {
runHarnessTests(MatAutocompleteModule, MatAutocompleteHarness);
});
9 changes: 9 additions & 0 deletions src/material/autocomplete/testing/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

export * from './public-api';
10 changes: 10 additions & 0 deletions src/material/autocomplete/testing/public-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/

export * from './autocomplete-harness';
export * from './autocomplete-harness-filters';
Loading

0 comments on commit dec116b

Please sign in to comment.