@delon/testing 19.1.0 → 20.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +120 -3
- package/package.json +1 -1
- package/public_api.d.ts +0 -7
- package/src/cdk-overlay.d.ts +0 -7
- package/src/dispatch-events.d.ts +0 -17
- package/src/event-objects.d.ts +0 -16
- package/src/g2.d.ts +0 -42
- package/src/suite.d.ts +0 -13
- package/src/type-in-element.d.ts +0 -15
- package/src/zorro.d.ts +0 -6
package/index.d.ts
CHANGED
|
@@ -1,5 +1,122 @@
|
|
|
1
|
+
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
|
2
|
+
import { DebugElement, Type } from '@angular/core';
|
|
3
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
4
|
+
import { Chart } from '@antv/g2';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
|
-
*
|
|
7
|
+
* @license
|
|
8
|
+
* Copyright Google LLC All Rights Reserved.
|
|
9
|
+
*
|
|
10
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
11
|
+
* found in the LICENSE file at https://angular.io/license
|
|
3
12
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
13
|
+
/** Utility to dispatch any event on a Node. */
|
|
14
|
+
declare function dispatchEvent(node: Node | Window, event: Event): Event;
|
|
15
|
+
/** Shorthand to dispatch a fake event on a specified node. */
|
|
16
|
+
declare function dispatchFakeEvent(node: Node | Window, type: string | Event, canBubble?: boolean): Event;
|
|
17
|
+
/** Shorthand to dispatch a keyboard event with a specified key code. */
|
|
18
|
+
declare function dispatchKeyboardEvent(node: Node, type: string, keyCode: number, target?: Element): KeyboardEvent;
|
|
19
|
+
/** Shorthand to dispatch a mouse event on the specified coordinates. */
|
|
20
|
+
declare function dispatchMouseEvent(node: Node, type: string, x?: number, y?: number, event?: MouseEvent): MouseEvent;
|
|
21
|
+
/** Shorthand to dispatch a touch event on the specified coordinates. */
|
|
22
|
+
declare function dispatchTouchEvent(node: Node, type: string, x?: number, y?: number): Event;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright Google LLC All Rights Reserved.
|
|
27
|
+
*
|
|
28
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
29
|
+
* found in the LICENSE file at https://angular.io/license
|
|
30
|
+
*/
|
|
31
|
+
/** Creates a browser MouseEvent with the specified options. */
|
|
32
|
+
declare function createMouseEvent(type: string, x?: number, y?: number): MouseEvent;
|
|
33
|
+
/** Creates a browser TouchEvent with the specified pointer coordinates. */
|
|
34
|
+
declare function createTouchEvent(type: string, pageX?: number, pageY?: number): UIEvent;
|
|
35
|
+
/** Dispatches a keydown event from an element. */
|
|
36
|
+
declare function createKeyboardEvent(type: string, keyCode: number, target?: Element, key?: string): NzSafeAny;
|
|
37
|
+
/** Creates a fake event object with any desired event type. */
|
|
38
|
+
declare function createFakeEvent(type: string, canBubble?: boolean, cancelable?: boolean): Event;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @license
|
|
42
|
+
* Copyright Google LLC All Rights Reserved.
|
|
43
|
+
*
|
|
44
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
45
|
+
* found in the LICENSE file at https://angular.io/license
|
|
46
|
+
*/
|
|
47
|
+
/**
|
|
48
|
+
* Focuses an input, sets its value and dispatches
|
|
49
|
+
* the `input` event, simulating the user typing.
|
|
50
|
+
*
|
|
51
|
+
* @param value Value to be set on the input.
|
|
52
|
+
* @param element Element onto which to set the value.
|
|
53
|
+
*/
|
|
54
|
+
declare function typeInElement(value: string, element: HTMLInputElement): void;
|
|
55
|
+
|
|
56
|
+
declare const DROPDOWN_MIN_TIME = 1000;
|
|
57
|
+
/**
|
|
58
|
+
* 触发 dropdown
|
|
59
|
+
*/
|
|
60
|
+
declare function dispatchDropDown(dl: DebugElement, trigger: 'mouseleave' | 'click', allowNull?: boolean): boolean;
|
|
61
|
+
|
|
62
|
+
type PageG2Type = 'geometries' | 'views';
|
|
63
|
+
declare const PageG2DataCount = 2;
|
|
64
|
+
declare const PageG2Height = 100;
|
|
65
|
+
declare class PageG2<T> {
|
|
66
|
+
fixture: ComponentFixture<T> | null;
|
|
67
|
+
constructor(fixture?: ComponentFixture<T> | null);
|
|
68
|
+
get dl(): DebugElement;
|
|
69
|
+
get context(): T;
|
|
70
|
+
get comp(): NzSafeAny;
|
|
71
|
+
get chart(): Chart;
|
|
72
|
+
genComp(comp: Type<T>, dc?: boolean): this;
|
|
73
|
+
dcFirst(): this;
|
|
74
|
+
dc(): this;
|
|
75
|
+
end(): this;
|
|
76
|
+
destroy(): void;
|
|
77
|
+
newData(data: NzSafeAny): this;
|
|
78
|
+
getEls(cls: string): NodeListOf<HTMLElement>;
|
|
79
|
+
getEl(cls: string): HTMLElement;
|
|
80
|
+
getController(type: 'axis' | 'legend'): NzSafeAny;
|
|
81
|
+
isCanvas(stauts?: boolean): this;
|
|
82
|
+
isText(cls: string, value: string): this;
|
|
83
|
+
isExists(cls: string, stauts?: boolean): this;
|
|
84
|
+
checkOptions(key: string, value: NzSafeAny): this;
|
|
85
|
+
checkAttrOptions(type: PageG2Type, key: string, value: NzSafeAny): this;
|
|
86
|
+
isXScalesCount(num: number): this;
|
|
87
|
+
isYScalesCount(num: number): this;
|
|
88
|
+
isDataCount(type: PageG2Type, num: number): this;
|
|
89
|
+
get firstDataPoint(): {
|
|
90
|
+
x: number;
|
|
91
|
+
y: number;
|
|
92
|
+
};
|
|
93
|
+
checkTooltip(_includeText: string | null, point?: {
|
|
94
|
+
x: number;
|
|
95
|
+
y: number;
|
|
96
|
+
}): this;
|
|
97
|
+
checkClickItem(): this;
|
|
98
|
+
}
|
|
99
|
+
declare function checkDelay<T>(comp: Type<T>, page?: PageG2<T> | null): void;
|
|
100
|
+
|
|
101
|
+
declare class TestContext<T> {
|
|
102
|
+
fixture: ComponentFixture<T>;
|
|
103
|
+
constructor(fixture: ComponentFixture<T>);
|
|
104
|
+
get component(): T;
|
|
105
|
+
get el(): HTMLElement;
|
|
106
|
+
get dl(): DebugElement;
|
|
107
|
+
get context(): T;
|
|
108
|
+
detectChanges(): void;
|
|
109
|
+
resolve<T1>(component: Type<T1>): T1;
|
|
110
|
+
}
|
|
111
|
+
declare const createTestContext: <T>(component: Type<T>) => TestContext<T>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* 清除Cdk的窗体,以便下一次使用,一般这样使用:
|
|
115
|
+
* ```ts
|
|
116
|
+
* afterEach(cleanCdkOverlayHtml);
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
declare function cleanCdkOverlayHtml(): void;
|
|
120
|
+
|
|
121
|
+
export { DROPDOWN_MIN_TIME, PageG2, PageG2DataCount, PageG2Height, TestContext, checkDelay, cleanCdkOverlayHtml, createFakeEvent, createKeyboardEvent, createMouseEvent, createTestContext, createTouchEvent, dispatchDropDown, dispatchEvent, dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent, dispatchTouchEvent, typeInElement };
|
|
122
|
+
export type { PageG2Type };
|
package/package.json
CHANGED
package/public_api.d.ts
DELETED
package/src/cdk-overlay.d.ts
DELETED
package/src/dispatch-events.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
/** Utility to dispatch any event on a Node. */
|
|
9
|
-
export declare function dispatchEvent(node: Node | Window, event: Event): Event;
|
|
10
|
-
/** Shorthand to dispatch a fake event on a specified node. */
|
|
11
|
-
export declare function dispatchFakeEvent(node: Node | Window, type: string | Event, canBubble?: boolean): Event;
|
|
12
|
-
/** Shorthand to dispatch a keyboard event with a specified key code. */
|
|
13
|
-
export declare function dispatchKeyboardEvent(node: Node, type: string, keyCode: number, target?: Element): KeyboardEvent;
|
|
14
|
-
/** Shorthand to dispatch a mouse event on the specified coordinates. */
|
|
15
|
-
export declare function dispatchMouseEvent(node: Node, type: string, x?: number, y?: number, event?: MouseEvent): MouseEvent;
|
|
16
|
-
/** Shorthand to dispatch a touch event on the specified coordinates. */
|
|
17
|
-
export declare function dispatchTouchEvent(node: Node, type: string, x?: number, y?: number): Event;
|
package/src/event-objects.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
|
|
2
|
-
/**
|
|
3
|
-
* @license
|
|
4
|
-
* Copyright Google LLC All Rights Reserved.
|
|
5
|
-
*
|
|
6
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
-
* found in the LICENSE file at https://angular.io/license
|
|
8
|
-
*/
|
|
9
|
-
/** Creates a browser MouseEvent with the specified options. */
|
|
10
|
-
export declare function createMouseEvent(type: string, x?: number, y?: number): MouseEvent;
|
|
11
|
-
/** Creates a browser TouchEvent with the specified pointer coordinates. */
|
|
12
|
-
export declare function createTouchEvent(type: string, pageX?: number, pageY?: number): UIEvent;
|
|
13
|
-
/** Dispatches a keydown event from an element. */
|
|
14
|
-
export declare function createKeyboardEvent(type: string, keyCode: number, target?: Element, key?: string): NzSafeAny;
|
|
15
|
-
/** Creates a fake event object with any desired event type. */
|
|
16
|
-
export declare function createFakeEvent(type: string, canBubble?: boolean, cancelable?: boolean): Event;
|
package/src/g2.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { DebugElement, Type } from '@angular/core';
|
|
2
|
-
import { ComponentFixture } from '@angular/core/testing';
|
|
3
|
-
import { Chart } from '@antv/g2';
|
|
4
|
-
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
|
|
5
|
-
export type PageG2Type = 'geometries' | 'views';
|
|
6
|
-
export declare const PageG2DataCount = 2;
|
|
7
|
-
export declare const PageG2Height = 100;
|
|
8
|
-
export declare class PageG2<T> {
|
|
9
|
-
fixture: ComponentFixture<T> | null;
|
|
10
|
-
constructor(fixture?: ComponentFixture<T> | null);
|
|
11
|
-
get dl(): DebugElement;
|
|
12
|
-
get context(): T;
|
|
13
|
-
get comp(): NzSafeAny;
|
|
14
|
-
get chart(): Chart;
|
|
15
|
-
genComp(comp: Type<T>, dc?: boolean): this;
|
|
16
|
-
dcFirst(): this;
|
|
17
|
-
dc(): this;
|
|
18
|
-
end(): this;
|
|
19
|
-
destroy(): void;
|
|
20
|
-
newData(data: NzSafeAny): this;
|
|
21
|
-
getEls(cls: string): NodeListOf<HTMLElement>;
|
|
22
|
-
getEl(cls: string): HTMLElement;
|
|
23
|
-
getController(type: 'axis' | 'legend'): NzSafeAny;
|
|
24
|
-
isCanvas(stauts?: boolean): this;
|
|
25
|
-
isText(cls: string, value: string): this;
|
|
26
|
-
isExists(cls: string, stauts?: boolean): this;
|
|
27
|
-
checkOptions(key: string, value: NzSafeAny): this;
|
|
28
|
-
checkAttrOptions(type: PageG2Type, key: string, value: NzSafeAny): this;
|
|
29
|
-
isXScalesCount(num: number): this;
|
|
30
|
-
isYScalesCount(num: number): this;
|
|
31
|
-
isDataCount(type: PageG2Type, num: number): this;
|
|
32
|
-
get firstDataPoint(): {
|
|
33
|
-
x: number;
|
|
34
|
-
y: number;
|
|
35
|
-
};
|
|
36
|
-
checkTooltip(_includeText: string | null, point?: {
|
|
37
|
-
x: number;
|
|
38
|
-
y: number;
|
|
39
|
-
}): this;
|
|
40
|
-
checkClickItem(): this;
|
|
41
|
-
}
|
|
42
|
-
export declare function checkDelay<T>(comp: Type<T>, page?: PageG2<T> | null): void;
|
package/src/suite.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DebugElement, Type } from '@angular/core';
|
|
2
|
-
import { ComponentFixture } from '@angular/core/testing';
|
|
3
|
-
export declare class TestContext<T> {
|
|
4
|
-
fixture: ComponentFixture<T>;
|
|
5
|
-
constructor(fixture: ComponentFixture<T>);
|
|
6
|
-
get component(): T;
|
|
7
|
-
get el(): HTMLElement;
|
|
8
|
-
get dl(): DebugElement;
|
|
9
|
-
get context(): T;
|
|
10
|
-
detectChanges(): void;
|
|
11
|
-
resolve<T1>(component: Type<T1>): T1;
|
|
12
|
-
}
|
|
13
|
-
export declare const createTestContext: <T>(component: Type<T>) => TestContext<T>;
|
package/src/type-in-element.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
/**
|
|
9
|
-
* Focuses an input, sets its value and dispatches
|
|
10
|
-
* the `input` event, simulating the user typing.
|
|
11
|
-
*
|
|
12
|
-
* @param value Value to be set on the input.
|
|
13
|
-
* @param element Element onto which to set the value.
|
|
14
|
-
*/
|
|
15
|
-
export declare function typeInElement(value: string, element: HTMLInputElement): void;
|
package/src/zorro.d.ts
DELETED