question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Jasmine exception when using mat-tabs

See original GitHub issue

Bug, 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:closed
  • Created 5 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
arucarcommented, Dec 12, 2018

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.

0reactions
angular-automatic-lock-bot[bot]commented, May 29, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found