(freeze.spec.ts): Add test for freezing a component feature in the frontend to ensure users can freeze components and verify expected behavior with different runs.

This commit is contained in:
cristhianzl 2025-03-21 22:30:59 -03:00
commit ff3c364916

View file

@ -304,9 +304,15 @@ test(
.getByPlaceholder("Empty")
.textContent();
expect(firstRunWithoutFreezing).toBe(firstTextFreezed);
expect(firstTextFreezed).toContain("Lorem Ipsum");
expect(secondRunWithoutFreezing).not.toBe(firstTextFreezed);
expect(firstRunWithoutFreezing).not.toBe(secondRunWithoutFreezing);
expect(thirdTextWithoutFreezing).toBe(firstTextFreezed);
expect(thirdTextWithoutFreezing).toContain("Lorem Ipsum");
const lengthDifference = Math.abs(
thirdTextWithoutFreezing?.length! - firstTextFreezed?.length!,
);
expect(lengthDifference).toBeLessThan(100);
},
);