jest-preset-angular icon indicating copy to clipboard operation
jest-preset-angular copied to clipboard

fix: generated id="root{n}" should be removed

Open wellwind opened this issue 2 years ago • 1 comments

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

wellwind avatar Sep 15 '23 14:09 wellwind

Hi @ahnpnl,

do you think this PR is fine to approve?

wellwind avatar Sep 28 '23 13:09 wellwind

Continue in #2565

ahnpnl avatar Jul 09 '24 14:07 ahnpnl