Skip to content

Commit 90b183b

Browse files
fix(components/tabs)!: replace @angular/animations with CSS transitions (#4288)
BREAKING CHANGE `SkySectionedFormComponent` and `SkyVerticalTabsetComponent` have replaced `@angular/animations` with CSS transitions. Tests that interact with sectioned forms or vertical tabs in responsive/mobile mode may need to add `provideNoopSkyAnimations()` from `@skyux/core` to their `TestBed` providers to disable SKY UX CSS transitions during tests. ``` import { provideNoopSkyAnimations } from '@skyux/core'; TestBed.configureTestingModule({ providers: [provideNoopSkyAnimations()], }); ```
1 parent b5567d9 commit 90b183b

File tree

20 files changed

+74
-106
lines changed

20 files changed

+74
-106
lines changed

apps/integration/src/app/integrations/vertical-tabset-back-to-top/vertical-tabset-back-to-top.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ComponentFixture, TestBed } from '@angular/core/testing';
2-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
32
import { SkyAppTestUtility } from '@skyux-sdk/testing';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44

55
import { VerticalTabsetBackToTopComponent } from './vertical-tabset-back-to-top.component';
66
import { VerticalTabsetBackToTopModule } from './vertical-tabset-back-to-top.module';
@@ -52,7 +52,8 @@ describe('Vertical tabset with a back to top', () => {
5252

5353
beforeEach(() => {
5454
TestBed.configureTestingModule({
55-
imports: [NoopAnimationsModule, VerticalTabsetBackToTopModule],
55+
imports: [VerticalTabsetBackToTopModule],
56+
providers: [provideNoopSkyAnimations()],
5657
});
5758

5859
fixture = TestBed.createComponent(VerticalTabsetBackToTopComponent);

libs/components/code-examples/src/lib/modules/tabs/sectioned-form/modal/example.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44
import { SkyInputBoxHarness } from '@skyux/forms/testing';
55
import { SkySectionedFormHarness } from '@skyux/tabs/testing';
66

@@ -12,7 +12,8 @@ describe('Sectioned form in a modal example', () => {
1212
fixture: ComponentFixture<TabsSectionedFormModalExampleComponent>;
1313
}> {
1414
await TestBed.configureTestingModule({
15-
imports: [TabsSectionedFormModalExampleComponent, NoopAnimationsModule],
15+
imports: [TabsSectionedFormModalExampleComponent],
16+
providers: [provideNoopSkyAnimations()],
1617
}).compileComponents();
1718
const fixture = TestBed.createComponent(
1819
TabsSectionedFormModalExampleComponent,

libs/components/code-examples/src/lib/modules/tabs/vertical-tabs/basic/example.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44
import { SkyVerticalTabsetHarness } from '@skyux/tabs/testing';
55

66
import { TabsVerticalTabsBasicExampleComponent } from './example.component';
@@ -24,7 +24,8 @@ describe('Basic vertical tabs example', () => {
2424

2525
beforeEach(() => {
2626
TestBed.configureTestingModule({
27-
imports: [TabsVerticalTabsBasicExampleComponent, NoopAnimationsModule],
27+
imports: [TabsVerticalTabsBasicExampleComponent],
28+
providers: [provideNoopSkyAnimations()],
2829
});
2930
});
3031

libs/components/code-examples/src/lib/modules/tabs/vertical-tabs/grouped/example.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44
import { SkyVerticalTabsetHarness } from '@skyux/tabs/testing';
55

66
import { TabsVerticalTabsGroupedExampleComponent } from './example.component';
@@ -24,7 +24,8 @@ describe('Group vertical tabs example', () => {
2424

2525
beforeEach(() => {
2626
TestBed.configureTestingModule({
27-
imports: [TabsVerticalTabsGroupedExampleComponent, NoopAnimationsModule],
27+
imports: [TabsVerticalTabsGroupedExampleComponent],
28+
providers: [provideNoopSkyAnimations()],
2829
});
2930
});
3031

libs/components/code-examples/src/lib/modules/tabs/vertical-tabs/mixed/example.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44
import { SkyVerticalTabsetHarness } from '@skyux/tabs/testing';
55

66
import { TabsVerticalTabsMixedExampleComponent } from './example.component';
@@ -24,7 +24,8 @@ describe('Mixed vertical tabs example', () => {
2424

2525
beforeEach(() => {
2626
TestBed.configureTestingModule({
27-
imports: [TabsVerticalTabsMixedExampleComponent, NoopAnimationsModule],
27+
imports: [TabsVerticalTabsMixedExampleComponent],
28+
providers: [provideNoopSkyAnimations()],
2829
});
2930
});
3031

libs/components/code-examples/src/lib/modules/tabs/wizard/basic/modal.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
33
import { ComponentFixture, TestBed } from '@angular/core/testing';
44
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
55
import { provideRouter } from '@angular/router';
6+
import { provideNoopSkyAnimations } from '@skyux/core';
67
import { SkyInputBoxHarness } from '@skyux/forms/testing';
78
import { SkyModalInstance } from '@skyux/modals';
89
import {
@@ -19,7 +20,11 @@ describe('Wizard tabset demo', () => {
1920
loader: HarnessLoader;
2021
}> {
2122
await TestBed.configureTestingModule({
22-
providers: [provideRouter([]), SkyModalInstance],
23+
providers: [
24+
provideNoopSkyAnimations(),
25+
provideRouter([]),
26+
SkyModalInstance,
27+
],
2328
imports: [ModalComponent, NoopAnimationsModule],
2429
}).compileComponents();
2530

libs/components/docs-tools/src/lib/modules/code-example-viewer/code-example-viewer.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import { HarnessLoader } from '@angular/cdk/testing';
22
import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed';
33
import { Component } from '@angular/core';
44
import { ComponentFixture, TestBed } from '@angular/core/testing';
5-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
65
import { expectAsync } from '@skyux-sdk/testing';
6+
import { provideNoopSkyAnimations } from '@skyux/core';
77
import { SkyBoxHarness } from '@skyux/layout/testing';
88

99
import { SkyDocsCodeExampleViewerComponent } from './code-example-viewer.component';
@@ -101,7 +101,8 @@ class FooExampleComponent {}`,
101101
};
102102

103103
TestBed.configureTestingModule({
104-
imports: [NoopAnimationsModule, SkyDocsCodeExampleViewerModule],
104+
imports: [SkyDocsCodeExampleViewerModule],
105+
providers: [provideNoopSkyAnimations()],
105106
});
106107
});
107108

libs/components/tabs/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
},
1717
"homepage": "https://github.com/blackbaud/skyux#readme",
1818
"peerDependencies": {
19-
"@angular/animations": "^21.2.0",
2019
"@angular/cdk": "^21.2.0",
2120
"@angular/common": "^21.2.0",
2221
"@angular/core": "^21.2.0",

libs/components/tabs/src/lib/modules/sectioned-form/fixtures/sectioned-form-fixtures.module.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NgModule } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
3-
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
3+
import { provideNoopSkyAnimations } from '@skyux/core';
44
import { SkyCheckboxModule } from '@skyux/forms';
55

66
import { SkySectionedFormModule } from '../sectioned-form.module';
@@ -19,18 +19,14 @@ import { SkySectionedFormFixtureComponent } from './sectioned-form.component.fix
1919
SkySectionedFormNoSectionsFixtureComponent,
2020
SkySectionedFormNoActiveFixtureComponent,
2121
],
22-
imports: [
23-
NoopAnimationsModule,
24-
SkySectionedFormModule,
25-
SkyCheckboxModule,
26-
FormsModule,
27-
],
22+
imports: [SkySectionedFormModule, SkyCheckboxModule, FormsModule],
2823
exports: [
2924
SkySectionedFormFixtureComponent,
3025
SkySectionedFormFixtureInformation1Component,
3126
SkySectionedFormFixtureInformation2Component,
3227
SkySectionedFormNoSectionsFixtureComponent,
3328
SkySectionedFormNoActiveFixtureComponent,
3429
],
30+
providers: [provideNoopSkyAnimations()],
3531
})
3632
export class SkySectionedFormFixturesModule {}

libs/components/tabs/src/lib/modules/sectioned-form/sectioned-form.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
@if (maintainSectionContent || tabService.tabsVisible()) {
1919
<div
2020
class="sky-sectioned-form-tabs"
21+
[class.sky-animation-slide-enter-left]="animationEnabled()"
2122
[ngClass]="{
2223
'sky-sectioned-form-tabs-hidden': !tabService.tabsVisible(),
2324
'sky-sectioned-form-tabs-only': !tabService.contentVisible()
2425
}"
25-
[@tabEnter]="tabService.animationTabsVisibleState"
2626
>
2727
<ng-content />
2828
</div>
@@ -31,10 +31,10 @@
3131
<div
3232
#skySectionSideContent
3333
class="sky-sectioned-form-content"
34+
[class.sky-animation-slide-enter-right]="animationEnabled()"
3435
[ngClass]="{
3536
'sky-sectioned-form-content-hidden': !tabService.contentVisible()
3637
}"
37-
[@contentEnter]="tabService.animationContentVisibleState"
3838
></div>
3939
}
4040
</div>

0 commit comments

Comments
 (0)