-
Hello ! I'm facing some trouble using I usually disable animations using the previous code but apparently it does not work in this specific project and I wonder why (it worked like a charm in another projects) Here is the "simplified" template: <div @fadeInOutTrans *ngFor="let element of elements; trackBy: trackById" The transition function: export function fadeInOutWithTransition(fadeInDuration: string, fadeOutDuration: string): AnimationTriggerMetadata {
return trigger('fadeInOutTrans', [
transition(':enter', [style({ opacity: 0 }), animate(`${fadeInDuration} ease-out`, style({ opacity: 1 }))]),
transition(':leave', [style({ opacity: 1 }), animate(`${fadeOutDuration} ease-out`, style({ opacity: 0 }))]),
]);
} The "simplified" unit test: beforeEach(() =>
MockBuilder(ElementsComponent, ElementsModule)
.keep(NoopAnimationsModule, { export: true })
.provide(
provideMockStore({ -- the elements selectors -- })
)
...
it('should not display data', () => {
// here I'm puting zero length data using selector's setResult
store.refreshState();
fixture.detectChanges();
const sampleArea = ngMocks.find('div --- selector to my data', null);
expect(sampleArea).toBeNull(); <-- fails there is data
}); Additional feedbacks:
Thanks for your help or suggestions :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Tomorrow morning, I have to check the following topic I opened myself years ago 😁 |
Beta Was this translation helpful? Give feedback.
Done, docs have been deployed. The update is here: https://ng-mocks.sudo.eu/troubleshooting/browser-animations-module/#writing-tests