@taiga-ui/cdk 3.45.0 → 3.46.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 (69) hide show
  1. package/bundles/taiga-ui-cdk-constants.umd.js +1 -1
  2. package/bundles/taiga-ui-cdk-constants.umd.js.map +1 -1
  3. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js +8 -15
  4. package/bundles/taiga-ui-cdk-directives-active-zone.umd.js.map +1 -1
  5. package/constants/version.d.ts +1 -1
  6. package/constants/version.js +1 -1
  7. package/esm2015/constants/version.js +2 -2
  8. package/esm2015/directives/active-zone/active-zone.directive.js +9 -16
  9. package/fesm2015/taiga-ui-cdk-constants.js +1 -1
  10. package/fesm2015/taiga-ui-cdk-constants.js.map +1 -1
  11. package/fesm2015/taiga-ui-cdk-directives-active-zone.js +8 -15
  12. package/fesm2015/taiga-ui-cdk-directives-active-zone.js.map +1 -1
  13. package/package.json +4 -4
  14. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.d.ts +0 -1
  15. package/schematics/ng-add/tests/schematic-ng-add-standalone.spec.js +0 -381
  16. package/schematics/ng-add/tests/schematic-ng-add.spec.d.ts +0 -1
  17. package/schematics/ng-add/tests/schematic-ng-add.spec.js +0 -270
  18. package/schematics/ng-update/v3/tests/schematic-date-time.spec.d.ts +0 -1
  19. package/schematics/ng-update/v3/tests/schematic-date-time.spec.js +0 -117
  20. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.d.ts +0 -1
  21. package/schematics/ng-update/v3/tests/schematic-migrate-hints.spec.js +0 -102
  22. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.d.ts +0 -1
  23. package/schematics/ng-update/v3/tests/schematic-migrate-polymorpheus.spec.js +0 -107
  24. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.d.ts +0 -1
  25. package/schematics/ng-update/v3/tests/schematic-migrate-progress.spec.js +0 -113
  26. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.d.ts +0 -1
  27. package/schematics/ng-update/v3/tests/schematic-migrate-sliders.spec.js +0 -380
  28. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.d.ts +0 -1
  29. package/schematics/ng-update/v3/tests/schematic-migrate-tds.spec.js +0 -119
  30. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.d.ts +0 -1
  31. package/schematics/ng-update/v3/tests/schematic-migrate-textfields.spec.js +0 -123
  32. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.d.ts +0 -1
  33. package/schematics/ng-update/v3/tests/schematic-miscellaneous.spec.js +0 -81
  34. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.d.ts +0 -1
  35. package/schematics/ng-update/v3/tests/schematic-rename-types.spec.js +0 -157
  36. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.d.ts +0 -1
  37. package/schematics/ng-update/v3/tests/schematic-replace-consts.spec.js +0 -135
  38. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.d.ts +0 -1
  39. package/schematics/ng-update/v3/tests/schematic-replace-deep-imports.spec.js +0 -53
  40. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.d.ts +0 -1
  41. package/schematics/ng-update/v3/tests/schematic-replace-deprecated-functions.spec.js +0 -835
  42. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.d.ts +0 -1
  43. package/schematics/ng-update/v3/tests/schematic-replace-enums.spec.js +0 -68
  44. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.d.ts +0 -1
  45. package/schematics/ng-update/v3/tests/schematic-replace-functions.spec.js +0 -195
  46. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.d.ts +0 -1
  47. package/schematics/ng-update/v3/tests/schematic-replace-html.spec.js +0 -611
  48. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.d.ts +0 -1
  49. package/schematics/ng-update/v3/tests/schematic-replace-proprietary-consts.spec.js +0 -100
  50. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.d.ts +0 -1
  51. package/schematics/ng-update/v3/tests/schematic-replace-services.spec.js +0 -102
  52. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.d.ts +0 -1
  53. package/schematics/ng-update/v3/tests/schematic-replace-styles.spec.js +0 -286
  54. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.d.ts +0 -1
  55. package/schematics/ng-update/v3/tests/schematic-textfield-icon.spec.js +0 -141
  56. package/schematics/ng-update/v3/tests/schematic-warnings.spec.d.ts +0 -1
  57. package/schematics/ng-update/v3/tests/schematic-warnings.spec.js +0 -104
  58. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.d.ts +0 -1
  59. package/schematics/ng-update/v3-30/tests/schematic-migrate-icons.spec.js +0 -87
  60. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.d.ts +0 -1
  61. package/schematics/ng-update/v3-35/tests/schematic-migrate-icons.spec.js +0 -101
  62. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.d.ts +0 -1
  63. package/schematics/ng-update/v3-36/tests/schematic-migrate-editor.spec.js +0 -117
  64. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.d.ts +0 -1
  65. package/schematics/ng-update/v3-40/tests/schematic-migrate-textarea.spec.js +0 -90
  66. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.d.ts +0 -1
  67. package/schematics/ng-update/v3-5/tests/schematic-migrate-templates.spec.js +0 -74
  68. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.d.ts +0 -1
  69. package/schematics/ng-update/v4/tests/schematic-migrate-thumbnail-card.spec.js +0 -72
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /* eslint-disable rxjs/no-topromise */
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const testing_1 = require("@angular-devkit/schematics/testing");
7
- const ng_morph_1 = require("ng-morph");
8
- const path_1 = require("path");
9
- const create_angular_json_1 = require("../../../utils/create-angular-json");
10
- const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
- const BEFORE = `import {Component} from '@angular/core';
12
- import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce';
13
- import {TuiDirectiveStylesService} from '@taiga-ui/cdk';
14
-
15
- const lineType: TuiCurrency = TuiCurrency.HongKong_dollar;
16
-
17
- @Component({templateUrl: './app.template.html'})
18
- export class AppComponent {
19
- some: TuiCurrencyCode = TuiCurrencyCode.HongKong_dollar;
20
-
21
- constructor(
22
- @Inject(TuiDirectiveStylesService) private directiveStyles: TuiDirectiveStylesService,
23
- ) {}
24
-
25
- method() {
26
- this.directiveStyles.addComponent(component);
27
- }
28
-
29
- method2() {
30
- this.directiveStyles.addStyle(styles, 'style');
31
- }
32
- }`;
33
- const AFTER = `import {Component} from '@angular/core';
34
- import {TuiCurrency, TuiCurrencyCode} from '@taiga-ui/addon-commerce';
35
- import {TuiDirectiveStylesService} from '@taiga-ui/cdk';
36
-
37
- const lineType: TuiCurrency = TuiCurrency.HongKongDollar;
38
-
39
- @Component({templateUrl: './app.template.html'})
40
- export class AppComponent {
41
- some: TuiCurrencyCode = TuiCurrencyCode.HongKongDollar;
42
-
43
- constructor(
44
- @Inject(TuiDirectiveStylesService) private directiveStyles: TuiDirectiveStylesService,
45
- ) {}
46
-
47
- method() {
48
- this.directiveStyles.addComponent(component);
49
- }
50
-
51
- method2() {
52
- // TODO: (Taiga UI migration) addStyle method has been removed. Use components approach
53
- this.directiveStyles.addStyle(styles, 'style');
54
- }
55
- }`;
56
- describe(`ng-update miscellaneous`, () => {
57
- let host;
58
- let runner;
59
- beforeEach(() => {
60
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
61
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
62
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
63
- createMainFiles();
64
- ng_morph_1.saveActiveProject();
65
- });
66
- it(`should replace content`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
67
- const tree = yield runner
68
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
69
- .toPromise();
70
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(AFTER);
71
- }));
72
- afterEach(() => {
73
- ng_morph_1.resetActiveProject();
74
- });
75
- });
76
- function createMainFiles() {
77
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
78
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
79
- create_angular_json_1.createAngularJson();
80
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
81
- }
@@ -1,157 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /* eslint-disable rxjs/no-topromise */
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const testing_1 = require("@angular-devkit/schematics/testing");
7
- const ng_morph_1 = require("ng-morph");
8
- const path_1 = require("path");
9
- const create_angular_json_1 = require("../../../utils/create-angular-json");
10
- const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
- const BEFORE = `
12
- import { Component } from '@angular/core';
13
- import {
14
- TuiNotificationOptions,
15
- TuiNotificationOptionsWithData,
16
- AnotherType,
17
- TuiAbstractTextfieldHost
18
- } from '@taiga-ui/core';
19
- import { InputCountOptions } from '@taiga-ui/kit/components';
20
- import { ScrollIntoViewDirective, CodeComponent } from '@taiga-ui/addon-doc';
21
- import { TableBar } from '@taiga-ui/addon-tablebars';
22
- import { TuiInvalidDayException, TuiInvalidMonthException, TuiInvalidYearException } from '@taiga-ui/cdk/exceptions';
23
- import { ButtonOptions, some, InputCountOptions, WithDateMaskPipeConfig } from '@taiga-ui/core/types';
24
- import { InputPasswordOptions } from '@taiga-ui/kit/components/input-password';
25
- import { TUI_INPUT_TIME_OPTIONS, InputTimeOptions, Country, RadioOptions } from '@taiga-ui/kit';
26
- import {
27
- Language,
28
- LanguageCore,
29
- LanguageCommerce,
30
- LanguageEditor,
31
- LanguagePreview,
32
- LanguageTable,
33
- LanguageKit
34
- } from '@taiga-ui/i18n';
35
- import { ToggleOptions } from '@taiga-ui/cdk';
36
- const options: ButtonOptions = {};
37
- const inputCountOptions: InputCountOptions = {};
38
- const passwordOptions = {} as InputPasswordOptions;
39
- const config: WithDateMaskPipeConfig = {}
40
- const notificationOptions: TuiNotificationOptions = {};
41
- const notificationOptionsWithData: TuiNotificationOptionsWithData<string> = {};
42
- const COUNTRIES: Country[] = [];
43
- const language: Language
44
- | LanguageCore
45
- | LanguageCommerce
46
- | LanguageEditor
47
- | LanguagePreview
48
- | LanguageTable
49
- | LanguageKit
50
- | null = null;
51
-
52
- @Component({
53
- templateUrl: './app.template.html',
54
- providers: [
55
- {provide: TUI_TOGGLE_OPTIONS, useValue: {showIcons: true} as ToggleOptions},
56
- ],
57
- })
58
- export class AppComponent {
59
- some: ButtonOptions = {};
60
- doSomething(options: InputCountOptions) {
61
- console.log(options.step);
62
- }
63
- get passwordOptions(): InputPasswordOptions {
64
- return {};
65
- }
66
- get radioOptions() {
67
- return {size: 'l'} as RadioOptions;
68
- }
69
- constructor(@Inject(TUI_INPUT_TIME_OPTIONS) readonly options: InputTimeOptions) {}
70
- }
71
-
72
- export class Textfield extends TuiAbstractTextfieldHost {}
73
- `;
74
- const AFTER = `
75
- import { Component } from '@angular/core';
76
- import { TuiAlertOptions, AnotherType, AbstractTuiTextfieldHost } from '@taiga-ui/core';
77
- import { TuiInputCountOptions } from '@taiga-ui/kit';
78
- import { TuiScrollIntoViewLinkDirective, TuiCodeComponent } from '@taiga-ui/addon-doc';
79
- import { TuiTableBar } from '@taiga-ui/addon-tablebars';
80
- import { TuiInvalidDayException, TuiInvalidMonthException, TuiInvalidYearException } from '@taiga-ui/cdk';
81
- import { TuiButtonOptions, some, InputCountOptions } from '@taiga-ui/core';
82
- import { TuiInputPasswordOptions } from '@taiga-ui/kit';
83
- import { TUI_INPUT_TIME_OPTIONS, TuiInputTimeOptions, TuiRadioOptions } from '@taiga-ui/kit';
84
- import {
85
- TuiLanguage,
86
- TuiLanguageCore,
87
- TuiLanguageCommerce,
88
- TuiLanguageEditor,
89
- TuiLanguagePreview,
90
- TuiLanguageTable,
91
- TuiLanguageKit
92
- } from '@taiga-ui/i18n';
93
- import { TuiToggleOptions } from '@taiga-ui/cdk';
94
- const options: TuiButtonOptions = {};
95
- const inputCountOptions: TuiInputCountOptions = {};
96
- const passwordOptions = {} as TuiInputPasswordOptions;
97
- const config: any = {}
98
- const notificationOptions: TuiAlertOptions<any> = {};
99
- const notificationOptionsWithData: TuiAlertOptions<string> = {};
100
- const COUNTRIES: any[] = [];
101
- const language: TuiLanguage
102
- | TuiLanguageCore
103
- | TuiLanguageCommerce
104
- | TuiLanguageEditor
105
- | TuiLanguagePreview
106
- | TuiLanguageTable
107
- | TuiLanguageKit
108
- | null = null;
109
-
110
- @Component({
111
- templateUrl: './app.template.html',
112
- providers: [
113
- {provide: TUI_TOGGLE_OPTIONS, useValue: {showIcons: true} as TuiToggleOptions},
114
- ],
115
- })
116
- export class AppComponent {
117
- some: TuiButtonOptions = {};
118
- doSomething(options: TuiInputCountOptions) {
119
- console.log(options.step);
120
- }
121
- get passwordOptions(): TuiInputPasswordOptions {
122
- return {};
123
- }
124
- get radioOptions() {
125
- return {size: 'l'} as TuiRadioOptions;
126
- }
127
- constructor(@Inject(TUI_INPUT_TIME_OPTIONS) readonly options: TuiInputTimeOptions) {}
128
- }
129
-
130
- export class Textfield extends AbstractTuiTextfieldHost {}
131
- `;
132
- describe(`ng-update`, () => {
133
- let host;
134
- let runner;
135
- beforeEach(() => {
136
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
137
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
138
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
139
- createMainFiles();
140
- ng_morph_1.saveActiveProject();
141
- });
142
- it(`should rename types`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
143
- const tree = yield runner
144
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
145
- .toPromise();
146
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(AFTER);
147
- }));
148
- afterEach(() => {
149
- ng_morph_1.resetActiveProject();
150
- });
151
- });
152
- function createMainFiles() {
153
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
154
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
155
- create_angular_json_1.createAngularJson();
156
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
157
- }
@@ -1,135 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /* eslint-disable rxjs/no-topromise */
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const testing_1 = require("@angular-devkit/schematics/testing");
7
- const ng_morph_1 = require("ng-morph");
8
- const path_1 = require("path");
9
- const create_angular_json_1 = require("../../../utils/create-angular-json");
10
- const collectionPath = path_1.join(__dirname, `../../../migration.json`);
11
- const AFTER = `import { TuiTableCommands } from "@taiga-ui/addon-editor";
12
- import { TuiCountryIsoCode } from "@taiga-ui/i18n";
13
- import { identity } from "rxjs";
14
- import { TuiAlertModule } from "@taiga-ui/core";
15
- import { Validators } from "@angular/forms";
16
- import {Component} from '@angular/core';
17
- import { tuiCreateAutoCorrectedDatePipe, tuiCreateDateMask, tuiCreateDateRangeMask } from '@taiga-ui/kit';
18
- import { tuiGetClosestFocusable, AbstractTuiController } from '@taiga-ui/cdk';
19
-
20
- @Component({templateUrl: './app.template.html'})
21
- export class AppComponent extends AbstractTuiController {
22
- private readonly textMaskOptions = {
23
- mask: tuiCreateDateMask('DMY', '.'),
24
- pipe: tuiCreateAutoCorrectedDatePipe(this),
25
- guide: false,
26
- };
27
-
28
- mask = tuiCreateDateRangeMask('DMY', '.');
29
-
30
- command = TuiTableCommands.InsertColumnBefore;
31
-
32
- control = new FormControl('', [Validators.nullValidator]);
33
-
34
- onMouseDown(event: MouseEvent, target: HTMLElement) {
35
- if (tuiGetClosestFocusable({initial: target, root: 'button', previous: false, keyboard: true})) {
36
- return null;
37
- }
38
- }
39
- }
40
-
41
- @NgModule({
42
- imports: [
43
- TuiAlertModule
44
- ],
45
- declarations: [AppComponent],
46
- })
47
- export class TuiTestModule {}
48
-
49
-
50
- const countriesVariants: ReadonlyArray<readonly TuiCountryIsoCode[]> = [
51
- [
52
- TuiCountryIsoCode.RU,
53
- TuiCountryIsoCode.KZ,
54
- TuiCountryIsoCode.UA,
55
- TuiCountryIsoCode.BY,
56
- ],
57
- Object.values(TuiCountryIsoCode),
58
- ];
59
- `;
60
- const BEFORE = `import {Component} from '@angular/core';
61
- import {TUI_DATE_MASK, TUI_DATE_RANGE_MASK, TuiCountryIsoCode, tuiCreateAutoCorrectedDatePipe} from '@taiga-ui/kit';
62
- import {EMPTY_VALIDATOR} from '@taiga-ui/cdk';
63
- import { TuiController } from '@taiga-ui/cdk';
64
- import { tuiGetClosestFocusable, identity } from '@taiga-ui/cdk';
65
- import { TuiNotificationsModule } from '@taiga-ui/core';
66
- import { TableComands } from '@taiga-ui/addon-editor';
67
- import {TuiResizableColumnModule} from '@taiga-ui/addon-table';
68
-
69
- @Component({templateUrl: './app.template.html'})
70
- export class AppComponent extends TuiController {
71
- private readonly textMaskOptions = {
72
- mask: TUI_DATE_MASK,
73
- pipe: tuiCreateAutoCorrectedDatePipe(this),
74
- guide: false,
75
- };
76
-
77
- mask = TUI_DATE_RANGE_MASK;
78
-
79
- command = TableComands.InsertColumnBefore;
80
-
81
- control = new FormControl('', [EMPTY_VALIDATOR]);
82
-
83
- onMouseDown(event: MouseEvent, target: HTMLElement) {
84
- if (tuiGetClosestFocusable(target, false, 'button')) {
85
- return null;
86
- }
87
- }
88
- }
89
-
90
- @NgModule({
91
- imports: [
92
- TuiNotificationsModule,
93
- TuiResizableColumnModule
94
- ],
95
- declarations: [AppComponent],
96
- })
97
- export class TuiTestModule {}
98
-
99
-
100
- const countriesVariants: ReadonlyArray<readonly TuiCountryIsoCode[]> = [
101
- [
102
- TuiCountryIsoCode.RU,
103
- TuiCountryIsoCode.KZ,
104
- TuiCountryIsoCode.UA,
105
- TuiCountryIsoCode.BY,
106
- ],
107
- Object.values(TuiCountryIsoCode),
108
- ];
109
- `;
110
- describe(`ng-update`, () => {
111
- let host;
112
- let runner;
113
- beforeEach(() => {
114
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
115
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
116
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host));
117
- createMainFiles();
118
- ng_morph_1.saveActiveProject();
119
- });
120
- it(`should replace constants`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
121
- const tree = yield runner
122
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
123
- .toPromise();
124
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(AFTER);
125
- }));
126
- afterEach(() => {
127
- ng_morph_1.resetActiveProject();
128
- });
129
- });
130
- function createMainFiles() {
131
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, BEFORE);
132
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
133
- create_angular_json_1.createAngularJson();
134
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
135
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- /* eslint-disable rxjs/no-topromise */
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const testing_1 = require("@angular-devkit/schematics/testing");
7
- const ng_morph_1 = require("ng-morph");
8
- const path_1 = require("path");
9
- const create_angular_json_1 = require("../../../utils/create-angular-json");
10
- const replace_styles_1 = require("../steps/replace-styles");
11
- const collectionPath = path_1.join(__dirname, `../../../migration.json`);
12
- describe(`ng-update`, () => {
13
- let host;
14
- let runner;
15
- beforeEach(() => {
16
- host = new testing_1.UnitTestTree(new schematics_1.HostTree());
17
- runner = new testing_1.SchematicTestRunner(`schematics`, collectionPath);
18
- ng_morph_1.setActiveProject(ng_morph_1.createProject(host, `/`, `**/**`));
19
- createMainFiles();
20
- ng_morph_1.saveActiveProject();
21
- });
22
- it(`should rename types`, () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
23
- const tree = yield runner
24
- .runSchematicAsync(`updateToV3`, { 'skip-logs': process.env[`TUI_CI`] === `true` }, host)
25
- .toPromise();
26
- expect(tree.readContent(`test/app/app.component.ts`)).toEqual(`import { Component } from '@angular/core';
27
- import { some } from '@taiga-ui/kit';
28
- import { any } from '@taiga-ui/cdk'
29
- import { unknown } from '@taiga-ui/core'
30
-
31
- @Component({templateUrl: './app.template.html'})
32
- export class AppComponent {}`);
33
- expect(tree.readContent(`test/style.less`)).toEqual(`${replace_styles_1.TUI_WARNING_NORMALIZE}\n@import '@taiga-ui/styles/taiga-ui-global.less';`);
34
- expect(tree.readContent(`test/app/app.template.less`)).toEqual(`@import '@taiga-ui/core/styles/taiga-ui-local.less';`);
35
- }));
36
- afterEach(() => {
37
- ng_morph_1.resetActiveProject();
38
- });
39
- });
40
- function createMainFiles() {
41
- ng_morph_1.createSourceFile(`test/app/app.component.ts`, `import { Component } from '@angular/core';
42
- import { some } from '@taiga-ui/kit/types';
43
- import { any } from '@taiga-ui/cdk/directives/any'
44
- import { unknown } from '@taiga-ui/core'
45
-
46
- @Component({templateUrl: './app.template.html'})
47
- export class AppComponent {}`);
48
- ng_morph_1.createSourceFile(`test/app/app.template.html`, `<app></app>`);
49
- ng_morph_1.createSourceFile(`test/style.less`, `@import '~@taiga-ui/core/styles/taiga-ui-global';`);
50
- ng_morph_1.createSourceFile(`test/app/app.template.less`, `@import '~@taiga-ui/core/styles/taiga-ui-local';`);
51
- create_angular_json_1.createAngularJson();
52
- ng_morph_1.createSourceFile(`package.json`, `{"dependencies": {"@angular/core": "~13.0.0"}}`);
53
- }