1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { __awaiter } from "tslib";
|
---|
9 | import { ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
---|
10 | import { MatDrawerContentHarness } from './drawer-content-harness';
|
---|
11 | import { MatDrawerHarness } from './drawer-harness';
|
---|
12 | /** Harness for interacting with a standard mat-drawer-container in tests. */
|
---|
13 | export class MatDrawerContainerHarness extends ContentContainerComponentHarness {
|
---|
14 | /**
|
---|
15 | * Gets a `HarnessPredicate` that can be used to search for a `MatDrawerContainerHarness` that
|
---|
16 | * meets certain criteria.
|
---|
17 | * @param options Options for filtering which container instances are considered a match.
|
---|
18 | * @return a `HarnessPredicate` configured with the given options.
|
---|
19 | */
|
---|
20 | static with(options = {}) {
|
---|
21 | return new HarnessPredicate(MatDrawerContainerHarness, options);
|
---|
22 | }
|
---|
23 | /**
|
---|
24 | * Gets drawers that match particular criteria within the container.
|
---|
25 | * @param filter Optionally filters which chips are included.
|
---|
26 | */
|
---|
27 | getDrawers(filter = {}) {
|
---|
28 | return __awaiter(this, void 0, void 0, function* () {
|
---|
29 | return this.locatorForAll(MatDrawerHarness.with(filter))();
|
---|
30 | });
|
---|
31 | }
|
---|
32 | /** Gets the element that has the container's content. */
|
---|
33 | getContent() {
|
---|
34 | return __awaiter(this, void 0, void 0, function* () {
|
---|
35 | return this.locatorFor(MatDrawerContentHarness)();
|
---|
36 | });
|
---|
37 | }
|
---|
38 | }
|
---|
39 | /** The selector for the host element of a `MatDrawerContainer` instance. */
|
---|
40 | MatDrawerContainerHarness.hostSelector = '.mat-drawer-container';
|
---|
41 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJhd2VyLWNvbnRhaW5lci1oYXJuZXNzLmpzIiwic291cmNlU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