File tree Expand file tree Collapse file tree 5 files changed +20
-7
lines changed
tools/public_api_guard/cdk Expand file tree Collapse file tree 5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import {
10
+ _getTextWithExcludedElements ,
10
11
ElementDimensions ,
11
12
ModifierKeys ,
12
13
TestElement ,
13
- TestKey , TextOptions
14
+ TestKey ,
15
+ TextOptions
14
16
} from '@angular/cdk/testing' ;
15
17
import { browser , ElementFinder , Key } from 'protractor' ;
16
- import { getTextWithExcludedElements } from '../text-filtering' ;
17
18
18
19
/** Maps the `TestKey` constants to Protractor's `Key` constants. */
19
20
const keyMap = {
@@ -137,7 +138,7 @@ export class ProtractorElement implements TestElement {
137
138
138
139
async text ( options ?: TextOptions ) : Promise < string > {
139
140
if ( options ?. exclude ) {
140
- return browser . executeScript ( getTextWithExcludedElements , this . element , options . exclude ) ;
141
+ return browser . executeScript ( _getTextWithExcludedElements , this . element , options . exclude ) ;
141
142
}
142
143
return this . element . getText ( ) ;
143
144
}
Original file line number Diff line number Diff line change @@ -10,3 +10,4 @@ export * from './component-harness';
10
10
export * from './harness-environment' ;
11
11
export * from './test-element' ;
12
12
export * from './element-dimensions' ;
13
+ export * from './text-filtering' ;
Original file line number Diff line number Diff line change 8
8
9
9
import * as keyCodes from '@angular/cdk/keycodes' ;
10
10
import {
11
+ _getTextWithExcludedElements ,
11
12
ElementDimensions ,
12
13
ModifierKeys ,
13
14
TestElement ,
14
- TestKey , TextOptions
15
+ TestKey ,
16
+ TextOptions
15
17
} from '@angular/cdk/testing' ;
16
18
import {
17
19
clearElement ,
@@ -22,7 +24,6 @@ import {
22
24
triggerFocus ,
23
25
typeInElement ,
24
26
} from './fake-events' ;
25
- import { getTextWithExcludedElements } from '../text-filtering' ;
26
27
27
28
/** Maps `TestKey` constants to the `keyCode` and `key` values used by native browser events. */
28
29
const keyMap = {
@@ -135,7 +136,7 @@ export class UnitTestElement implements TestElement {
135
136
async text ( options ?: TextOptions ) : Promise < string > {
136
137
await this . _stabilize ( ) ;
137
138
if ( options ?. exclude ) {
138
- return getTextWithExcludedElements ( this . element , options . exclude ) ;
139
+ return _getTextWithExcludedElements ( this . element , options . exclude ) ;
139
140
}
140
141
return ( this . element . textContent || '' ) . trim ( ) ;
141
142
}
Original file line number Diff line number Diff line change
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
+
1
9
/**
2
10
* Gets text of element excluding certain selectors within the element.
3
11
* @param element Element to get text from,
4
12
* @param excludeSelector Selector identifying which elements to exclude,
5
13
*/
6
- export function getTextWithExcludedElements ( element : Element , excludeSelector : string ) {
14
+ export function _getTextWithExcludedElements ( element : Element , excludeSelector : string ) {
7
15
const clone = element . cloneNode ( true ) as Element ;
8
16
const exclusions = clone . querySelectorAll ( excludeSelector ) ;
9
17
for ( let i = 0 ; i < exclusions . length ; i ++ ) {
Original file line number Diff line number Diff line change
1
+ export declare function _getTextWithExcludedElements ( element : Element , excludeSelector : string ) : string ;
2
+
1
3
export declare type AsyncFactoryFn < T > = ( ) => Promise < T > ;
2
4
3
5
export declare type AsyncOptionPredicate < T , O > = ( item : T , option : O ) => Promise < boolean > ;
You can’t perform that action at this time.
0 commit comments