Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions src/material-experimental/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ entryPoints = [
"mdc-form-field",
"mdc-form-field/testing",
"mdc-input",
"mdc-input/testing",
"mdc-list",
"mdc-menu",
"mdc-menu/testing",
Expand Down
48 changes: 48 additions & 0 deletions src/material-experimental/mdc-input/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_test_library", "ng_web_test_suite", "ts_library")

ts_library(
name = "testing",
srcs = glob(
["**/*.ts"],
exclude = ["**/*.spec.ts"],
),
module_name = "@angular/material-experimental/mdc-input/testing",
deps = [
"//src/material/form-field/testing/control",
"//src/material/input/testing",
],
)

filegroup(
name = "source-files",
srcs = glob(["**/*.ts"]),
)

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

ng_web_test_suite(
name = "unit_tests",
static_files = [
"@npm//:node_modules/@material/textfield/dist/mdc.textfield.js",
"@npm//:node_modules/@material/line-ripple/dist/mdc.lineRipple.js",
"@npm//:node_modules/@material/notched-outline/dist/mdc.notchedOutline.js",
"@npm//:node_modules/@material/floating-label/dist/mdc.floatingLabel.js",
],
deps = [
":unit_tests_lib",
"//src/material-experimental:mdc_require_config.js",
],
)
9 changes: 9 additions & 0 deletions src/material-experimental/mdc-input/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';
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import {MatInputModule} from '@angular/material-experimental/mdc-input';
import {runHarnessTests} from '@angular/material/input/testing/shared.spec';
import {MatInputHarness} from './input-harness';

describe('MDC-based MatInputHarness', () => {
runHarnessTests(MatInputModule, MatInputHarness);
});
12 changes: 12 additions & 0 deletions src/material-experimental/mdc-input/testing/input-harness.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/**
* @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
*/

import {MatInputHarness as BaseInputHarness} from '@angular/material/input/testing';

/** Harness for interacting with a MDC-based Material inputs in tests. */
export class MatInputHarness extends BaseInputHarness {}
10 changes: 10 additions & 0 deletions src/material-experimental/mdc-input/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 {InputHarnessFilters} from '@angular/material/input/testing';
export {MatInputHarness} from './input-harness';