From b067b068d8f4e3dc02f0b0acbcc508fb5aa162f3 Mon Sep 17 00:00:00 2001 From: Nikita Barsukov Date: Fri, 4 Oct 2024 16:42:07 +0300 Subject: [PATCH] chore: remove redundant provide of `NG_EVENT_PLUGINS` --- projects/demo-cypress/src/tests/elastic-sticky.cy.ts | 3 --- projects/demo-cypress/src/tests/hint.cy.ts | 2 -- projects/demo-cypress/src/tests/lazy-loading.cy.ts | 2 -- .../demo-cypress/src/tests/mobile-calendar.cy.ts | 11 +---------- projects/demo-cypress/src/tests/pan.cy.ts | 12 +++--------- projects/demo-cypress/src/tests/range.cy.ts | 6 +----- projects/demo-cypress/src/tests/swipe.cy.ts | 12 +++--------- projects/demo-cypress/src/tests/tabs.cy.ts | 12 +++--------- projects/demo-cypress/src/tests/zoom.cy.ts | 12 +++--------- 9 files changed, 14 insertions(+), 58 deletions(-) diff --git a/projects/demo-cypress/src/tests/elastic-sticky.cy.ts b/projects/demo-cypress/src/tests/elastic-sticky.cy.ts index 3839a48e6ad6..ca11a07b0e2e 100644 --- a/projects/demo-cypress/src/tests/elastic-sticky.cy.ts +++ b/projects/demo-cypress/src/tests/elastic-sticky.cy.ts @@ -1,6 +1,5 @@ import {ChangeDetectionStrategy, Component, EventEmitter, Output} from '@angular/core'; import {TuiElasticSticky} from '@taiga-ui/addon-mobile'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import {createOutputSpy} from 'cypress/angular'; describe('ElasticSticky', () => { @@ -37,8 +36,6 @@ describe('ElasticSticky', () => { beforeEach(() => cy.mount(Test, { - imports: [TuiElasticSticky], - providers: [NG_EVENT_PLUGINS], componentProperties: { change: createOutputSpy('changeSpy'), }, diff --git a/projects/demo-cypress/src/tests/hint.cy.ts b/projects/demo-cypress/src/tests/hint.cy.ts index 804c555924f7..f0046fe11f81 100644 --- a/projects/demo-cypress/src/tests/hint.cy.ts +++ b/projects/demo-cypress/src/tests/hint.cy.ts @@ -2,7 +2,6 @@ import {NgIf} from '@angular/common'; import {ChangeDetectionStrategy, Component, Input} from '@angular/core'; import {NoopAnimationsModule} from '@angular/platform-browser/animations'; import {TuiHintDirective, TuiRoot} from '@taiga-ui/core'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import type {MountResponse} from 'cypress/angular'; describe('TuiHint', () => { @@ -47,7 +46,6 @@ describe('TuiHint', () => { cy .mount(Test, { imports: [NoopAnimationsModule, Host], - providers: [NG_EVENT_PLUGINS], }) .then((wrap) => { component = wrap.component; diff --git a/projects/demo-cypress/src/tests/lazy-loading.cy.ts b/projects/demo-cypress/src/tests/lazy-loading.cy.ts index ce5746ed424b..64daead1bb5d 100644 --- a/projects/demo-cypress/src/tests/lazy-loading.cy.ts +++ b/projects/demo-cypress/src/tests/lazy-loading.cy.ts @@ -1,5 +1,4 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import {TuiImgLazyLoading} from '@taiga-ui/kit'; describe('LazyLoading', () => { @@ -29,7 +28,6 @@ describe('LazyLoading', () => { beforeEach(() => cy.mount(Test, { - providers: [NG_EVENT_PLUGINS], componentProperties: { src: '', }, diff --git a/projects/demo-cypress/src/tests/mobile-calendar.cy.ts b/projects/demo-cypress/src/tests/mobile-calendar.cy.ts index b44e0f86177d..d0c1ae2c8655 100644 --- a/projects/demo-cypress/src/tests/mobile-calendar.cy.ts +++ b/projects/demo-cypress/src/tests/mobile-calendar.cy.ts @@ -7,7 +7,6 @@ import { TuiDay, TuiDayRange, } from '@taiga-ui/cdk'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import {TUI_CALENDAR_DATE_STREAM} from '@taiga-ui/kit'; import {createOutputSpy} from 'cypress/angular'; import {of} from 'rxjs'; @@ -53,8 +52,6 @@ describe('Mobile calendar', () => { it('the back button emits a cancel event', () => { cy.mount(Test, { - imports: [TuiMobileCalendar], - providers: [NG_EVENT_PLUGINS], componentProperties: { onCancel: createOutputSpy('onCancelSpy'), }, @@ -65,9 +62,7 @@ describe('Mobile calendar', () => { }); it('single === true', () => { - cy.mount(Test, { - imports: [TuiMobileCalendar], - }); + cy.mount(Test); cy.get('[automation-id="tui-mobile-calendar__label"]').should( 'contain.text', @@ -77,7 +72,6 @@ describe('Mobile calendar', () => { it('single === false', () => { cy.mount(Test, { - imports: [TuiMobileCalendar], componentProperties: { single: false, }, @@ -92,7 +86,6 @@ describe('Mobile calendar', () => { describe('when the done button emits', () => { it('confirm event with selected day', () => { cy.mount(Test, { - imports: [TuiMobileCalendar], componentProperties: { onConfirm: createOutputSpy('onConfirmSpy'), }, @@ -107,7 +100,6 @@ describe('Mobile calendar', () => { it('confirm event at selected interval', () => { cy.mount(Test, { - imports: [TuiMobileCalendar], componentProperties: { single: false, onConfirm: createOutputSpy('onConfirmSpy'), @@ -127,7 +119,6 @@ describe('Mobile calendar', () => { // TODO: why failed after https://github.com/taiga-family/taiga-ui/pull/8961 xit('year selection scrolls through months', () => { cy.mount(Test, { - imports: [TuiMobileCalendar], componentProperties: { onConfirm: createOutputSpy('onConfirmSpy'), }, diff --git a/projects/demo-cypress/src/tests/pan.cy.ts b/projects/demo-cypress/src/tests/pan.cy.ts index 0f779b51627b..f3c14a56f43f 100644 --- a/projects/demo-cypress/src/tests/pan.cy.ts +++ b/projects/demo-cypress/src/tests/pan.cy.ts @@ -1,6 +1,5 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; import {TuiPan} from '@taiga-ui/cdk'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; describe('TuiPan', () => { let component: Test; @@ -22,14 +21,9 @@ describe('TuiPan', () => { } beforeEach(() => - cy - .mount(Test, { - imports: [TuiPan], - providers: [NG_EVENT_PLUGINS], - }) - .then((wrapper) => { - component = wrapper.component; - }), + cy.mount(Test).then((wrapper) => { + component = wrapper.component; + }), ); it('emits delta', () => { diff --git a/projects/demo-cypress/src/tests/range.cy.ts b/projects/demo-cypress/src/tests/range.cy.ts index 3ca7815345f2..a968b305de89 100644 --- a/projects/demo-cypress/src/tests/range.cy.ts +++ b/projects/demo-cypress/src/tests/range.cy.ts @@ -1,7 +1,6 @@ import {ChangeDetectionStrategy, Component, ElementRef, ViewChild} from '@angular/core'; import type {ComponentFixture} from '@angular/core/testing'; import {FormControl, ReactiveFormsModule} from '@angular/forms'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import type {TuiKeySteps} from '@taiga-ui/kit'; import {TuiRange} from '@taiga-ui/kit'; @@ -44,10 +43,7 @@ describe('TuiRange', () => { } beforeEach(() => { - cy.mount(Test, { - imports: [TuiRange, ReactiveFormsModule], - providers: [NG_EVENT_PLUGINS], - }).then((wrapper) => { + cy.mount(Test).then((wrapper) => { component = wrapper.component; fixture = wrapper.fixture; }); diff --git a/projects/demo-cypress/src/tests/swipe.cy.ts b/projects/demo-cypress/src/tests/swipe.cy.ts index 140acf368cdb..17aca22ca576 100644 --- a/projects/demo-cypress/src/tests/swipe.cy.ts +++ b/projects/demo-cypress/src/tests/swipe.cy.ts @@ -1,7 +1,6 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; import type {TuiSwipeEvent} from '@taiga-ui/cdk'; import {TuiSwipe} from '@taiga-ui/cdk'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; describe('TuiSwipe', () => { let component: Test; @@ -26,14 +25,9 @@ describe('TuiSwipe', () => { } beforeEach(() => - cy - .mount(Test, { - imports: [TuiSwipe], - providers: [NG_EVENT_PLUGINS], - }) - .then((wrapper) => { - component = wrapper.component; - }), + cy.mount(Test).then((wrapper) => { + component = wrapper.component; + }), ); it('emits events bottom', () => { diff --git a/projects/demo-cypress/src/tests/tabs.cy.ts b/projects/demo-cypress/src/tests/tabs.cy.ts index 7d6334fa5666..39079f7ffed9 100644 --- a/projects/demo-cypress/src/tests/tabs.cy.ts +++ b/projects/demo-cypress/src/tests/tabs.cy.ts @@ -1,5 +1,4 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; import {TuiTabs} from '@taiga-ui/kit'; describe('Tabs', () => { @@ -44,14 +43,9 @@ describe('Tabs', () => { } beforeEach(() => - cy - .mount(Test, { - imports: [TuiTabs], - providers: [NG_EVENT_PLUGINS], - }) - .then((wrapper) => { - component = wrapper.component; - }), + cy.mount(Test).then((wrapper) => { + component = wrapper.component; + }), ); it('navigation by arrows works when going right', () => { diff --git a/projects/demo-cypress/src/tests/zoom.cy.ts b/projects/demo-cypress/src/tests/zoom.cy.ts index 7d0baecaf212..d73329792f39 100644 --- a/projects/demo-cypress/src/tests/zoom.cy.ts +++ b/projects/demo-cypress/src/tests/zoom.cy.ts @@ -1,7 +1,6 @@ import {ChangeDetectionStrategy, Component} from '@angular/core'; import type {TuiZoomEvent} from '@taiga-ui/cdk'; import {tuiFloor, TuiZoom} from '@taiga-ui/cdk'; -import {NG_EVENT_PLUGINS} from '@taiga-ui/event-plugins'; describe('TuiZoom', () => { let component: Test; @@ -26,14 +25,9 @@ describe('TuiZoom', () => { } beforeEach(() => - cy - .mount(Test, { - imports: [TuiZoom], - providers: [NG_EVENT_PLUGINS], - }) - .then((wrapper) => { - component = wrapper.component; - }), + cy.mount(Test).then((wrapper) => { + component = wrapper.component; + }), ); it('pinch', () => {