This repository has been archived by the owner on Mar 27, 2023. It is now read-only.
Accordion throws ExpressionChangedAfterItHasBeenCheckedError in Jest unit tests if *clrIfExpanded is set #5813
Unanswered
JeTmAn1981
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @JeTmAn1981 - a couple of questions to help me help you.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So I'm writing unit tests for a component that uses a Clarity Accordion. It was driving me nuts because I could not for the life of me figure out why a ExpressionChangedAfterItHasBeenCheckedError was being thrown by the tests. It doesn't occur when running the application, and there's nothing obvious in the component itself to trigger that error (not doing anything in ngAfterViewInit or anything like that).
After literal days of debugging I finally realize that *clrIfExpanded is the culprit. Somewhere along the line it must be making changes to the view late in the testing process.
The question is, what do I do about this? I need to write tests against these components. But, I don't know how to avoid this error. I can't get even get a test that creates the component to pass with this in place.
Beta Was this translation helpful? Give feedback.
All reactions