chore: Merge master to develop and manage conflict (#3570)

This commit is contained in:
Adrien de Peretti
2023-03-29 10:11:32 +02:00
committed by GitHub
parent 0695ff642b
commit 7f120e576b
25 changed files with 1033 additions and 383 deletions
@@ -0,0 +1,59 @@
import { hasChanges } from "../has-changes"
describe("hasChanges", function () {
it("should return true the data differ and false otherwise", () => {
const objToCompareTo = {
prop1: "test",
prop2: "test",
prop3: "test",
prop4: {
prop4_1: "test",
prop4_2: "test",
prop4_3: "test",
},
}
const obj = {
prop1: "test",
prop2: "test",
prop3: "test",
prop4: {
prop4_1: "test",
prop4_2: "test",
prop4_3: "test",
},
}
let res = hasChanges(objToCompareTo, obj)
expect(res).toBeFalsy()
const obj2 = {
...obj,
prop3: "tes",
}
res = hasChanges(objToCompareTo, obj2)
expect(res).toBeTruthy()
const obj3 = {
...obj,
prop4: {
prop4_1: "",
prop4_2: "test",
prop4_3: "test",
},
}
res = hasChanges(objToCompareTo, obj3)
expect(res).toBeTruthy()
const obj4 = {
...obj,
}
/* @ts-ignore */
delete obj4.prop4
res = hasChanges(objToCompareTo, obj4)
expect(res).toBeFalsy()
})
})