From 6c1d2f9798031ba83e795ea27cb919eab6d7dc61 Mon Sep 17 00:00:00 2001 From: splincode Date: Fri, 3 Jan 2025 18:25:03 +0300 Subject: [PATCH] chore(schematics): valid migration for NG_EVENT_PLUGINS --- .../replace-modules-with-providers.spec.ts | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/projects/cdk/schematics/ng-update/v4/tests/replace-modules-with-providers.spec.ts b/projects/cdk/schematics/ng-update/v4/tests/replace-modules-with-providers.spec.ts index 80b857bdaa03..81ce877b47cd 100644 --- a/projects/cdk/schematics/ng-update/v4/tests/replace-modules-with-providers.spec.ts +++ b/projects/cdk/schematics/ng-update/v4/tests/replace-modules-with-providers.spec.ts @@ -20,13 +20,22 @@ const MODULE_BEFORE = `import { TuiMobileCalendarDialogModule } from "@taiga-ui/ import { OldModule } from "@namespace/cdk"; import { TuiMarkerIconModule } from "@taiga-ui/kit"; import { TuiProprietaryRootModule } from "@taiga-ui/proprietary-core"; +import { NG_EVENT_PLUGINS } from '@tinkoff/ng-event-plugins'; @NgModule({ imports: [TuiMobileCalendarDialogModule, TuiProprietaryRootModule, OldModule, TuiAvatar, TuiAvatar, TuiAvatar, TuiMarkerIconModule], providers: [Provider] }) -export class Test { -}`; +export class Test1 { +} + +@NgModule({ + imports: [], + providers: [Provider, NG_EVENT_PLUGINS] +}) +export class Test2 { +} +`; const MODULE_AFTER = `import { newProvider } from "@namespace/new"; import { tuiProvideMobileCalendar } from "@taiga-ui/addon-mobile"; @@ -34,13 +43,22 @@ import { TuiAvatar } from "@taiga-ui/kit"; import { TBANK_PROVIDERS } from "@taiga-ui/proprietary"; import { NG_EVENT_PLUGINS } from "@taiga-ui/event-plugins"; import { TuiRoot } from "@taiga-ui/core"; +import { NG_EVENT_PLUGINS } from '@taiga-ui/event-plugins'; @NgModule({ imports: [TuiRoot, TuiAvatar], providers: [Provider, NG_EVENT_PLUGINS, TBANK_PROVIDERS, tuiProvideMobileCalendar(), newProvider] }) -export class Test { -}`; +export class Test1 { +} + +@NgModule({ + imports: [], + providers: [Provider, NG_EVENT_PLUGINS] +}) +export class Test2 { +} +`; const COMPONENT_BEFORE = `import { TuiMobileCalendarDialogModule } from "@taiga-ui/addon-mobile"; import { OldModule } from "@namespace/cdk";