@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.
Files changed (152) hide show
  1. package/README.md +3 -0
  2. package/bundles/taiga-ui-testing-core.umd.js +1336 -0
  3. package/bundles/taiga-ui-testing-core.umd.js.map +1 -0
  4. package/bundles/taiga-ui-testing-cypress.umd.js +130 -0
  5. package/bundles/taiga-ui-testing-cypress.umd.js.map +1 -0
  6. package/bundles/taiga-ui-testing-exceptions.umd.js +360 -0
  7. package/bundles/taiga-ui-testing-exceptions.umd.js.map +1 -0
  8. package/bundles/taiga-ui-testing-mocks.umd.js +371 -0
  9. package/bundles/taiga-ui-testing-mocks.umd.js.map +1 -0
  10. package/bundles/taiga-ui-testing-setup-jest.umd.js +149 -0
  11. package/bundles/taiga-ui-testing-setup-jest.umd.js.map +1 -0
  12. package/bundles/taiga-ui-testing-utils.umd.js +942 -0
  13. package/bundles/taiga-ui-testing-utils.umd.js.map +1 -0
  14. package/bundles/taiga-ui-testing.umd.js +46 -0
  15. package/bundles/taiga-ui-testing.umd.js.map +1 -0
  16. package/core/accordion-item.harness.d.ts +14 -0
  17. package/core/accordion.harness.d.ts +5 -0
  18. package/core/action.harness.d.ts +7 -0
  19. package/core/avatar.harness.d.ts +5 -0
  20. package/core/badge.harness.d.ts +7 -0
  21. package/core/button.harness.d.ts +7 -0
  22. package/core/calendar.harness.d.ts +16 -0
  23. package/core/card.harness.d.ts +6 -0
  24. package/core/hosted-dropdown.harness.d.ts +6 -0
  25. package/core/index.d.ts +20 -0
  26. package/core/island.harness.d.ts +12 -0
  27. package/core/loader.harness.d.ts +9 -0
  28. package/core/marker-icon.harness.d.ts +4 -0
  29. package/core/package.json +10 -0
  30. package/core/primitive-calender.harness.d.ts +6 -0
  31. package/core/primitive-spin-button.harness.d.ts +6 -0
  32. package/core/primitive-textfield.harness.d.ts +6 -0
  33. package/core/primitive-year-month-pagination.harness.d.ts +9 -0
  34. package/core/primitive-year-picker.harness.d.ts +5 -0
  35. package/core/select.harness.d.ts +7 -0
  36. package/core/svg.harness.d.ts +8 -0
  37. package/core/tag.harness.d.ts +12 -0
  38. package/core/taiga-ui-testing-core.d.ts +5 -0
  39. package/core/textfield.harness.d.ts +5 -0
  40. package/core/toggle.harness.d.ts +8 -0
  41. package/cypress/assertions/be-in-viewport.d.ts +14 -0
  42. package/cypress/assertions/index.d.ts +1 -0
  43. package/cypress/commands/wait-all-img-inside.command.d.ts +2 -0
  44. package/cypress/index.d.ts +3 -0
  45. package/cypress/package.json +10 -0
  46. package/cypress/snapshot/command.d.ts +16 -0
  47. package/cypress/taiga-ui-testing-cypress.d.ts +5 -0
  48. package/esm2015/core/accordion-item.harness.js +59 -0
  49. package/esm2015/core/accordion.harness.js +11 -0
  50. package/esm2015/core/action.harness.js +16 -0
  51. package/esm2015/core/avatar.harness.js +11 -0
  52. package/esm2015/core/badge.harness.js +21 -0
  53. package/esm2015/core/button.harness.js +21 -0
  54. package/esm2015/core/calendar.harness.js +66 -0
  55. package/esm2015/core/card.harness.js +19 -0
  56. package/esm2015/core/hosted-dropdown.harness.js +17 -0
  57. package/esm2015/core/index.js +21 -0
  58. package/esm2015/core/island.harness.js +53 -0
  59. package/esm2015/core/loader.harness.js +25 -0
  60. package/esm2015/core/marker-icon.harness.js +5 -0
  61. package/esm2015/core/primitive-calender.harness.js +40 -0
  62. package/esm2015/core/primitive-spin-button.harness.js +17 -0
  63. package/esm2015/core/primitive-textfield.harness.js +16 -0
  64. package/esm2015/core/primitive-year-month-pagination.harness.js +28 -0
  65. package/esm2015/core/primitive-year-picker.harness.js +29 -0
  66. package/esm2015/core/select.harness.js +21 -0
  67. package/esm2015/core/svg.harness.js +27 -0
  68. package/esm2015/core/tag.harness.js +39 -0
  69. package/esm2015/core/taiga-ui-testing-core.js +5 -0
  70. package/esm2015/core/textfield.harness.js +11 -0
  71. package/esm2015/core/toggle.harness.js +21 -0
  72. package/esm2015/cypress/assertions/be-in-viewport.js +28 -0
  73. package/esm2015/cypress/assertions/index.js +2 -0
  74. package/esm2015/cypress/commands/wait-all-img-inside.command.js +62 -0
  75. package/esm2015/cypress/index.js +4 -0
  76. package/esm2015/cypress/snapshot/command.js +23 -0
  77. package/esm2015/cypress/taiga-ui-testing-cypress.js +5 -0
  78. package/esm2015/exceptions/element-is-not-input.exception.js +6 -0
  79. package/esm2015/exceptions/field-not-found.exception.js +6 -0
  80. package/esm2015/exceptions/index.js +3 -0
  81. package/esm2015/exceptions/taiga-ui-testing-exceptions.js +5 -0
  82. package/esm2015/index.js +11 -0
  83. package/esm2015/mocks/event.js +12 -0
  84. package/esm2015/mocks/index.js +3 -0
  85. package/esm2015/mocks/sanitizer.js +13 -0
  86. package/esm2015/mocks/taiga-ui-testing-mocks.js +5 -0
  87. package/esm2015/setup-jest/index.js +135 -0
  88. package/esm2015/setup-jest/taiga-ui-testing-setup-jest.js +5 -0
  89. package/esm2015/taiga-ui-testing.js +5 -0
  90. package/esm2015/utils/active-element.js +14 -0
  91. package/esm2015/utils/configure-test-suite.js +32 -0
  92. package/esm2015/utils/date.js +18 -0
  93. package/esm2015/utils/helpers.js +36 -0
  94. package/esm2015/utils/index.js +15 -0
  95. package/esm2015/utils/input/cleaner.unit-common.js +79 -0
  96. package/esm2015/utils/input/filler.unit-common.js +50 -0
  97. package/esm2015/utils/input/form-control-state.unit-common.js +37 -0
  98. package/esm2015/utils/input/placeholder.unit-common.js +87 -0
  99. package/esm2015/utils/input/tooltip.unit-common.js +46 -0
  100. package/esm2015/utils/keyboard-event.js +9 -0
  101. package/esm2015/utils/native-input.page-object.js +58 -0
  102. package/esm2015/utils/page-object.js +25 -0
  103. package/esm2015/utils/replace-nbsp.js +6 -0
  104. package/esm2015/utils/taiga-ui-testing-utils.js +5 -0
  105. package/esm2015/utils/viewport.js +23 -0
  106. package/exceptions/element-is-not-input.exception.d.ts +3 -0
  107. package/exceptions/field-not-found.exception.d.ts +3 -0
  108. package/exceptions/index.d.ts +2 -0
  109. package/exceptions/package.json +10 -0
  110. package/exceptions/taiga-ui-testing-exceptions.d.ts +5 -0
  111. package/fesm2015/taiga-ui-testing-core.js +522 -0
  112. package/fesm2015/taiga-ui-testing-core.js.map +1 -0
  113. package/fesm2015/taiga-ui-testing-cypress.js +119 -0
  114. package/fesm2015/taiga-ui-testing-cypress.js.map +1 -0
  115. package/fesm2015/taiga-ui-testing-exceptions.js +18 -0
  116. package/fesm2015/taiga-ui-testing-exceptions.js.map +1 -0
  117. package/fesm2015/taiga-ui-testing-mocks.js +32 -0
  118. package/fesm2015/taiga-ui-testing-mocks.js.map +1 -0
  119. package/fesm2015/taiga-ui-testing-setup-jest.js +138 -0
  120. package/fesm2015/taiga-ui-testing-setup-jest.js.map +1 -0
  121. package/fesm2015/taiga-ui-testing-utils.js +520 -0
  122. package/fesm2015/taiga-ui-testing-utils.js.map +1 -0
  123. package/fesm2015/taiga-ui-testing.js +16 -0
  124. package/fesm2015/taiga-ui-testing.js.map +1 -0
  125. package/index.d.ts +10 -0
  126. package/mocks/event.d.ts +3 -0
  127. package/mocks/index.d.ts +2 -0
  128. package/mocks/package.json +10 -0
  129. package/mocks/sanitizer.d.ts +7 -0
  130. package/mocks/taiga-ui-testing-mocks.d.ts +5 -0
  131. package/package.json +16 -0
  132. package/setup-jest/index.d.ts +1 -0
  133. package/setup-jest/package.json +10 -0
  134. package/setup-jest/taiga-ui-testing-setup-jest.d.ts +5 -0
  135. package/taiga-ui-testing.d.ts +5 -0
  136. package/utils/active-element.d.ts +4 -0
  137. package/utils/configure-test-suite.d.ts +1 -0
  138. package/utils/date.d.ts +2 -0
  139. package/utils/helpers.d.ts +22 -0
  140. package/utils/index.d.ts +14 -0
  141. package/utils/input/cleaner.unit-common.d.ts +20 -0
  142. package/utils/input/filler.unit-common.d.ts +16 -0
  143. package/utils/input/form-control-state.unit-common.d.ts +13 -0
  144. package/utils/input/placeholder.unit-common.d.ts +17 -0
  145. package/utils/input/tooltip.unit-common.d.ts +18 -0
  146. package/utils/keyboard-event.d.ts +1 -0
  147. package/utils/native-input.page-object.d.ts +18 -0
  148. package/utils/package.json +10 -0
  149. package/utils/page-object.d.ts +11 -0
  150. package/utils/replace-nbsp.d.ts +1 -0
  151. package/utils/taiga-ui-testing-utils.d.ts +5 -0
  152. package/utils/viewport.d.ts +1 -0
@@ -0,0 +1,7 @@
1
+ import { SecurityContext } from '@angular/core';
2
+ export declare const TUI_SANITIZER_MOCK: {
3
+ provide: import("@angular/core").InjectionToken<import("@angular/core").Sanitizer>;
4
+ useValue: {
5
+ sanitize(_context: SecurityContext, src: string): string;
6
+ };
7
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@taiga-ui/testing/mocks" />
5
+ export * from './index';
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,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@taiga-ui/testing/setup-jest" />
5
+ export * from './index';
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@taiga-ui/testing" />
5
+ export * from './index';
@@ -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;
@@ -0,0 +1,2 @@
1
+ export declare function tuiMockCurrentDate(dateOrNumber: Date | number): void;
2
+ export declare function tuiRestoreRealDate(): void;
@@ -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
+ }
@@ -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,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@taiga-ui/testing/utils" />
5
+ export * from './index';
@@ -0,0 +1 @@
1
+ export declare function tuiTestingViewport(width: number, height: number): void;