Jasmine exception when using mat-tabs
See original GitHub issueBug, feature request, or proposal:
Jasmine throws an error with below code: PhantomJS 2.1.1 (Windows 8 0.0.0) MyComponent should create FAILED TypeError: undefined is not an object (evaluating ‘getAnimationStyle(element, ‘’).trim’) (line 3963) applyKeyframeAnimation
The same error occurs when testing with chrome.
<mat-tab-group>
<mat-tab label="Account">
<div class="tab-content p-24">
Account content 1
</div>
</mat-tab>
<mat-tab label="Subscriptions">
<div class="tab-content p-24">
Subscriptions content 2
</div>
</mat-tab>
</mat-tab-group>
What is the expected behavior?
Succesful unit testing
What is the current behavior?
Error on unit testing
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I’m using Angular 6, Angular Material 6.4.6 on Windows with Typescript.
Is there anything else we should know?
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to change tabs in the unit test of a component that uses ...
Just add async() and use whenStable(). it('should display registration form after clicking second tab', async(() => { compiled = fixture.
Read more >Step-by-Step Test Implementation (Jasmine Spec) - YouTube
This video is part of the Angular Testing Course - https://angular-university.io/course/angular-testing-course Check out the PDF E-Books ...
Read more >Unit Testing Angular Component With Material Dialog | Jasmine
unittesting #angular #material #beginner #tutorialsHow to unit test Angular component with Material MatDialog?
Read more >Testing Angular 2+ Apps with Jasmine and Karma | Mosh
Get the COMPLETE COURSE (60% OFF - LIMITED TIME): https://programmingwithmosh.com/courses/angularA step-by-step and pragmatic introduction ...
Read more >sort objects alphabetically ignoring the lower and uppercase ...
First sort your dictionary based on your key by Object.keys(data).sort(); and then use reduce function find whole object based on sorted key. Like...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i have found a solution here : https://github.com/angular/angular/issues/24094 add NoopAnimationsModule in your TU and it will disable animations. after that the test work with phantomJS.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.