jest-preset-angular
jest-preset-angular copied to clipboard
fix: generated id="root{n}" should be removed
Summary
When using snapshot testing, Angular will generate <div id="root{n}"> root tag every time call TestBed.createComponent; this attribute will cause the snapshot not to be stable and should be removed when serializing content.
Test plan
I have updated the testing snapshot content, fixed the code, and the snapshot testing passed.
Does this PR introduce a breaking change?
- [x] Yes
- [ ] No
All old snapshots containing <div id="root{n}"> will cause failure.
So developers have to update the new snapshot manually after the upgrade.
Other information
Hi @ahnpnl,
do you think this PR is fine to approve?
Continue in #2565