@taiga-ui/testing 3.14.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/README.md +3 -0
- package/bundles/taiga-ui-testing-core.umd.js +1336 -0
- package/bundles/taiga-ui-testing-core.umd.js.map +1 -0
- package/bundles/taiga-ui-testing-cypress.umd.js +130 -0
- package/bundles/taiga-ui-testing-cypress.umd.js.map +1 -0
- package/bundles/taiga-ui-testing-exceptions.umd.js +360 -0
- package/bundles/taiga-ui-testing-exceptions.umd.js.map +1 -0
- package/bundles/taiga-ui-testing-mocks.umd.js +371 -0
- package/bundles/taiga-ui-testing-mocks.umd.js.map +1 -0
- package/bundles/taiga-ui-testing-setup-jest.umd.js +149 -0
- package/bundles/taiga-ui-testing-setup-jest.umd.js.map +1 -0
- package/bundles/taiga-ui-testing-utils.umd.js +942 -0
- package/bundles/taiga-ui-testing-utils.umd.js.map +1 -0
- package/bundles/taiga-ui-testing.umd.js +46 -0
- package/bundles/taiga-ui-testing.umd.js.map +1 -0
- package/core/accordion-item.harness.d.ts +14 -0
- package/core/accordion.harness.d.ts +5 -0
- package/core/action.harness.d.ts +7 -0
- package/core/avatar.harness.d.ts +5 -0
- package/core/badge.harness.d.ts +7 -0
- package/core/button.harness.d.ts +7 -0
- package/core/calendar.harness.d.ts +16 -0
- package/core/card.harness.d.ts +6 -0
- package/core/hosted-dropdown.harness.d.ts +6 -0
- package/core/index.d.ts +20 -0
- package/core/island.harness.d.ts +12 -0
- package/core/loader.harness.d.ts +9 -0
- package/core/marker-icon.harness.d.ts +4 -0
- package/core/package.json +10 -0
- package/core/primitive-calender.harness.d.ts +6 -0
- package/core/primitive-spin-button.harness.d.ts +6 -0
- package/core/primitive-textfield.harness.d.ts +6 -0
- package/core/primitive-year-month-pagination.harness.d.ts +9 -0
- package/core/primitive-year-picker.harness.d.ts +5 -0
- package/core/select.harness.d.ts +7 -0
- package/core/svg.harness.d.ts +8 -0
- package/core/tag.harness.d.ts +12 -0
- package/core/taiga-ui-testing-core.d.ts +5 -0
- package/core/textfield.harness.d.ts +5 -0
- package/core/toggle.harness.d.ts +8 -0
- package/cypress/assertions/be-in-viewport.d.ts +14 -0
- package/cypress/assertions/index.d.ts +1 -0
- package/cypress/commands/wait-all-img-inside.command.d.ts +2 -0
- package/cypress/index.d.ts +3 -0
- package/cypress/package.json +10 -0
- package/cypress/snapshot/command.d.ts +16 -0
- package/cypress/taiga-ui-testing-cypress.d.ts +5 -0
- package/esm2015/core/accordion-item.harness.js +59 -0
- package/esm2015/core/accordion.harness.js +11 -0
- package/esm2015/core/action.harness.js +16 -0
- package/esm2015/core/avatar.harness.js +11 -0
- package/esm2015/core/badge.harness.js +21 -0
- package/esm2015/core/button.harness.js +21 -0
- package/esm2015/core/calendar.harness.js +66 -0
- package/esm2015/core/card.harness.js +19 -0
- package/esm2015/core/hosted-dropdown.harness.js +17 -0
- package/esm2015/core/index.js +21 -0
- package/esm2015/core/island.harness.js +53 -0
- package/esm2015/core/loader.harness.js +25 -0
- package/esm2015/core/marker-icon.harness.js +5 -0
- package/esm2015/core/primitive-calender.harness.js +40 -0
- package/esm2015/core/primitive-spin-button.harness.js +17 -0
- package/esm2015/core/primitive-textfield.harness.js +16 -0
- package/esm2015/core/primitive-year-month-pagination.harness.js +28 -0
- package/esm2015/core/primitive-year-picker.harness.js +29 -0
- package/esm2015/core/select.harness.js +21 -0
- package/esm2015/core/svg.harness.js +27 -0
- package/esm2015/core/tag.harness.js +39 -0
- package/esm2015/core/taiga-ui-testing-core.js +5 -0
- package/esm2015/core/textfield.harness.js +11 -0
- package/esm2015/core/toggle.harness.js +21 -0
- package/esm2015/cypress/assertions/be-in-viewport.js +28 -0
- package/esm2015/cypress/assertions/index.js +2 -0
- package/esm2015/cypress/commands/wait-all-img-inside.command.js +62 -0
- package/esm2015/cypress/index.js +4 -0
- package/esm2015/cypress/snapshot/command.js +23 -0
- package/esm2015/cypress/taiga-ui-testing-cypress.js +5 -0
- package/esm2015/exceptions/element-is-not-input.exception.js +6 -0
- package/esm2015/exceptions/field-not-found.exception.js +6 -0
- package/esm2015/exceptions/index.js +3 -0
- package/esm2015/exceptions/taiga-ui-testing-exceptions.js +5 -0
- package/esm2015/index.js +11 -0
- package/esm2015/mocks/event.js +12 -0
- package/esm2015/mocks/index.js +3 -0
- package/esm2015/mocks/sanitizer.js +13 -0
- package/esm2015/mocks/taiga-ui-testing-mocks.js +5 -0
- package/esm2015/setup-jest/index.js +135 -0
- package/esm2015/setup-jest/taiga-ui-testing-setup-jest.js +5 -0
- package/esm2015/taiga-ui-testing.js +5 -0
- package/esm2015/utils/active-element.js +14 -0
- package/esm2015/utils/configure-test-suite.js +32 -0
- package/esm2015/utils/date.js +18 -0
- package/esm2015/utils/helpers.js +36 -0
- package/esm2015/utils/index.js +15 -0
- package/esm2015/utils/input/cleaner.unit-common.js +79 -0
- package/esm2015/utils/input/filler.unit-common.js +50 -0
- package/esm2015/utils/input/form-control-state.unit-common.js +37 -0
- package/esm2015/utils/input/placeholder.unit-common.js +87 -0
- package/esm2015/utils/input/tooltip.unit-common.js +46 -0
- package/esm2015/utils/keyboard-event.js +9 -0
- package/esm2015/utils/native-input.page-object.js +58 -0
- package/esm2015/utils/page-object.js +25 -0
- package/esm2015/utils/replace-nbsp.js +6 -0
- package/esm2015/utils/taiga-ui-testing-utils.js +5 -0
- package/esm2015/utils/viewport.js +23 -0
- package/exceptions/element-is-not-input.exception.d.ts +3 -0
- package/exceptions/field-not-found.exception.d.ts +3 -0
- package/exceptions/index.d.ts +2 -0
- package/exceptions/package.json +10 -0
- package/exceptions/taiga-ui-testing-exceptions.d.ts +5 -0
- package/fesm2015/taiga-ui-testing-core.js +522 -0
- package/fesm2015/taiga-ui-testing-core.js.map +1 -0
- package/fesm2015/taiga-ui-testing-cypress.js +119 -0
- package/fesm2015/taiga-ui-testing-cypress.js.map +1 -0
- package/fesm2015/taiga-ui-testing-exceptions.js +18 -0
- package/fesm2015/taiga-ui-testing-exceptions.js.map +1 -0
- package/fesm2015/taiga-ui-testing-mocks.js +32 -0
- package/fesm2015/taiga-ui-testing-mocks.js.map +1 -0
- package/fesm2015/taiga-ui-testing-setup-jest.js +138 -0
- package/fesm2015/taiga-ui-testing-setup-jest.js.map +1 -0
- package/fesm2015/taiga-ui-testing-utils.js +520 -0
- package/fesm2015/taiga-ui-testing-utils.js.map +1 -0
- package/fesm2015/taiga-ui-testing.js +16 -0
- package/fesm2015/taiga-ui-testing.js.map +1 -0
- package/index.d.ts +10 -0
- package/mocks/event.d.ts +3 -0
- package/mocks/index.d.ts +2 -0
- package/mocks/package.json +10 -0
- package/mocks/sanitizer.d.ts +7 -0
- package/mocks/taiga-ui-testing-mocks.d.ts +5 -0
- package/package.json +16 -0
- package/setup-jest/index.d.ts +1 -0
- package/setup-jest/package.json +10 -0
- package/setup-jest/taiga-ui-testing-setup-jest.d.ts +5 -0
- package/taiga-ui-testing.d.ts +5 -0
- package/utils/active-element.d.ts +4 -0
- package/utils/configure-test-suite.d.ts +1 -0
- package/utils/date.d.ts +2 -0
- package/utils/helpers.d.ts +22 -0
- package/utils/index.d.ts +14 -0
- package/utils/input/cleaner.unit-common.d.ts +20 -0
- package/utils/input/filler.unit-common.d.ts +16 -0
- package/utils/input/form-control-state.unit-common.d.ts +13 -0
- package/utils/input/placeholder.unit-common.d.ts +17 -0
- package/utils/input/tooltip.unit-common.d.ts +18 -0
- package/utils/keyboard-event.d.ts +1 -0
- package/utils/native-input.page-object.d.ts +18 -0
- package/utils/package.json +10 -0
- package/utils/page-object.d.ts +11 -0
- package/utils/replace-nbsp.d.ts +1 -0
- package/utils/taiga-ui-testing-utils.d.ts +5 -0
- package/utils/viewport.d.ts +1 -0
package/package.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@taiga-ui/testing",
|
|
3
|
+
"version": "3.14.0",
|
|
4
|
+
"description": "Utils functions for testing Taiga UI packages",
|
|
5
|
+
"dependencies": {
|
|
6
|
+
"cypress-image-snapshot": "^4.0.1",
|
|
7
|
+
"tslib": "^2.0.0"
|
|
8
|
+
},
|
|
9
|
+
"main": "bundles/taiga-ui-testing.umd.js",
|
|
10
|
+
"module": "fesm2015/taiga-ui-testing.js",
|
|
11
|
+
"es2015": "fesm2015/taiga-ui-testing.js",
|
|
12
|
+
"esm2015": "esm2015/taiga-ui-testing.js",
|
|
13
|
+
"fesm2015": "fesm2015/taiga-ui-testing.js",
|
|
14
|
+
"typings": "taiga-ui-testing.d.ts",
|
|
15
|
+
"sideEffects": false
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/taiga-ui-testing-setup-jest.umd.js",
|
|
3
|
+
"module": "../fesm2015/taiga-ui-testing-setup-jest.js",
|
|
4
|
+
"es2015": "../fesm2015/taiga-ui-testing-setup-jest.js",
|
|
5
|
+
"esm2015": "../esm2015/setup-jest/taiga-ui-testing-setup-jest.js",
|
|
6
|
+
"fesm2015": "../fesm2015/taiga-ui-testing-setup-jest.js",
|
|
7
|
+
"typings": "taiga-ui-testing-setup-jest.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"name": "@taiga-ui/testing/setup-jest"
|
|
10
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
export declare function tuiDispatchOnActive<T>(key: string, fixture?: ComponentFixture<T>): void;
|
|
3
|
+
export declare function tuiActiveText(): string;
|
|
4
|
+
export declare function tuiIsActive(element: Element): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const configureTestSuite: (configureModule?: (() => void) | undefined) => void;
|
package/utils/date.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseHarnessFilters, ComponentHarness, ComponentHarnessConstructor, ContentContainerComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
/**
|
|
3
|
+
* Decorator to add default static 'with' method.
|
|
4
|
+
* Use in conjunction with {@link tuiHarnessWith} mixin.
|
|
5
|
+
*/
|
|
6
|
+
export declare function tuiWithPredicate<T extends ComponentHarnessConstructor<ComponentHarness> & {
|
|
7
|
+
with: (options?: BaseHarnessFilters) => HarnessPredicate<ComponentHarness>;
|
|
8
|
+
}>(original: T): T;
|
|
9
|
+
/**
|
|
10
|
+
* Mixin to extend {@link ComponentHarness} and add typed
|
|
11
|
+
* static 'with' method. Use {@link tuiWithPredicate} decorator
|
|
12
|
+
* to monkey-patch default static 'with' method.
|
|
13
|
+
*/
|
|
14
|
+
export declare function tuiHarnessWith<T>(hostSelector: string): ComponentHarnessConstructor<ComponentHarness> & {
|
|
15
|
+
with: (options?: BaseHarnessFilters) => HarnessPredicate<ComponentHarness>;
|
|
16
|
+
};
|
|
17
|
+
export declare class TuiComponentHarness extends ComponentHarness {
|
|
18
|
+
static with<T extends ComponentHarness>(this: ComponentHarnessConstructor<T>, options: BaseHarnessFilters): HarnessPredicate<T>;
|
|
19
|
+
}
|
|
20
|
+
export declare class TuiContentContainerComponentHarness extends ContentContainerComponentHarness {
|
|
21
|
+
static with<T extends ComponentHarness>(this: ComponentHarnessConstructor<T>, options: BaseHarnessFilters): HarnessPredicate<T>;
|
|
22
|
+
}
|
package/utils/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './active-element';
|
|
2
|
+
export * from './configure-test-suite';
|
|
3
|
+
export * from './date';
|
|
4
|
+
export * from './helpers';
|
|
5
|
+
export * from './input/cleaner.unit-common';
|
|
6
|
+
export * from './input/filler.unit-common';
|
|
7
|
+
export * from './input/form-control-state.unit-common';
|
|
8
|
+
export * from './input/placeholder.unit-common';
|
|
9
|
+
export * from './input/tooltip.unit-common';
|
|
10
|
+
export * from './keyboard-event';
|
|
11
|
+
export * from './native-input.page-object';
|
|
12
|
+
export * from './page-object';
|
|
13
|
+
export * from './replace-nbsp';
|
|
14
|
+
export * from './viewport';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { TuiNativeInputPO } from '../native-input.page-object';
|
|
4
|
+
import { TuiPageObject } from '../page-object';
|
|
5
|
+
interface TestParams {
|
|
6
|
+
pageObject: TuiPageObject<unknown>;
|
|
7
|
+
fixture: ComponentFixture<unknown>;
|
|
8
|
+
testComponent: TestComponent;
|
|
9
|
+
inputPO: TuiNativeInputPO;
|
|
10
|
+
prefix: string;
|
|
11
|
+
}
|
|
12
|
+
interface TestComponent {
|
|
13
|
+
control?: FormControl;
|
|
14
|
+
value?: unknown;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
cleaner: boolean;
|
|
17
|
+
readOnly: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function tuiTestCleaner(context: TestParams, setValue?: any, clearValue?: any): void;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { TuiNativeInputPO } from '../native-input.page-object';
|
|
4
|
+
import { TuiPageObject } from '../page-object';
|
|
5
|
+
interface TestParams {
|
|
6
|
+
pageObject: TuiPageObject<unknown>;
|
|
7
|
+
fixture: ComponentFixture<unknown>;
|
|
8
|
+
testComponent: TestComponent;
|
|
9
|
+
inputPO: TuiNativeInputPO;
|
|
10
|
+
prefix: string;
|
|
11
|
+
}
|
|
12
|
+
interface TestComponent {
|
|
13
|
+
control: FormControl;
|
|
14
|
+
}
|
|
15
|
+
export declare function tuiTestFiller(context: TestParams, setValue?: unknown, clearValue?: unknown): void;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { TuiNativeInputPO } from '../native-input.page-object';
|
|
4
|
+
interface TestParams {
|
|
5
|
+
fixture: ComponentFixture<unknown>;
|
|
6
|
+
testComponent: TestComponent;
|
|
7
|
+
inputPO: TuiNativeInputPO;
|
|
8
|
+
}
|
|
9
|
+
interface TestComponent {
|
|
10
|
+
control: FormControl;
|
|
11
|
+
}
|
|
12
|
+
export declare function tuiTestFormControlState(context: TestParams): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { TuiPageObject } from '../page-object';
|
|
4
|
+
interface TestParams {
|
|
5
|
+
pageObject: TuiPageObject<unknown>;
|
|
6
|
+
fixture: ComponentFixture<unknown>;
|
|
7
|
+
testComponent: TestComponent;
|
|
8
|
+
prefix: string;
|
|
9
|
+
}
|
|
10
|
+
interface TestComponent {
|
|
11
|
+
control?: FormControl;
|
|
12
|
+
value?: unknown;
|
|
13
|
+
labelOutside: boolean;
|
|
14
|
+
size: 'l' | 'm' | 's';
|
|
15
|
+
}
|
|
16
|
+
export declare function tuiTestPlaceholder(context: TestParams, setValue?: unknown, clearValue?: unknown): void;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { TuiPageObject } from '../page-object';
|
|
4
|
+
interface TestParams {
|
|
5
|
+
pageObject: TuiPageObject<unknown>;
|
|
6
|
+
fixture: ComponentFixture<unknown>;
|
|
7
|
+
testComponent: TestComponent;
|
|
8
|
+
prefix: string;
|
|
9
|
+
}
|
|
10
|
+
interface TestComponent {
|
|
11
|
+
readOnly: boolean;
|
|
12
|
+
hintContent: string | null;
|
|
13
|
+
size: unknown;
|
|
14
|
+
control?: FormControl;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare function tuiTestTooltip(context: TestParams): void;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tuiCreateKeyboardEvent(key: string, eventType?: string): KeyboardEvent;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DebugElement } from '@angular/core';
|
|
2
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
3
|
+
export declare class TuiNativeInputPO {
|
|
4
|
+
private readonly fixture;
|
|
5
|
+
private readonly automationId;
|
|
6
|
+
private readonly hostDebugElement?;
|
|
7
|
+
private readonly pageObject;
|
|
8
|
+
constructor(fixture: ComponentFixture<unknown>, automationId: string, hostDebugElement?: DebugElement | undefined);
|
|
9
|
+
get nativeElement(): HTMLInputElement | HTMLTextAreaElement | null;
|
|
10
|
+
get value(): string;
|
|
11
|
+
get focused(): boolean;
|
|
12
|
+
sendText(value: string): void;
|
|
13
|
+
sendTextAndBlur(value: string): void;
|
|
14
|
+
sendKeydown(key: string): void;
|
|
15
|
+
focus(): void;
|
|
16
|
+
blur(): void;
|
|
17
|
+
click(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../bundles/taiga-ui-testing-utils.umd.js",
|
|
3
|
+
"module": "../fesm2015/taiga-ui-testing-utils.js",
|
|
4
|
+
"es2015": "../fesm2015/taiga-ui-testing-utils.js",
|
|
5
|
+
"esm2015": "../esm2015/utils/taiga-ui-testing-utils.js",
|
|
6
|
+
"fesm2015": "../fesm2015/taiga-ui-testing-utils.js",
|
|
7
|
+
"typings": "taiga-ui-testing-utils.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"name": "@taiga-ui/testing/utils"
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DebugElement } from '@angular/core';
|
|
2
|
+
import { ComponentFixture } from '@angular/core/testing';
|
|
3
|
+
export declare class TuiPageObject<T> {
|
|
4
|
+
protected fixture: ComponentFixture<T>;
|
|
5
|
+
constructor(fixture: ComponentFixture<T>);
|
|
6
|
+
static getIds({ nativeElement }: DebugElement): string[];
|
|
7
|
+
static containsId(debugElement: DebugElement, automationId: string): boolean;
|
|
8
|
+
private static byAutomationId;
|
|
9
|
+
getByAutomationId(automationId: string, debugElement?: DebugElement): DebugElement | null;
|
|
10
|
+
getAllByAutomationId(automationId: string, debugElement?: DebugElement): DebugElement[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tuiReplaceNbsp(content?: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function tuiTestingViewport(width: number, height: number): void;
|