Skip to content

Commit 8434ffd

Browse files
committed
test: add full liveCircle test
1 parent 3b21023 commit 8434ffd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/units/form/form-accept-changes.spec.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,16 @@ describe("Form accept changes", () => {
5858
})
5959
test("Accept clean without name for clean changes", () =>{})
6060
test("Accept clean without name", () =>{})
61+
test("Step accept and then full accept should clean changes", () => {
62+
const form = new Form();
63+
form.change({ username: "Jack", age: 24, id: 1 })
64+
65+
form.acceptChanges('username');
66+
expect(form.pureValues).toEqual({ username: "Jack" })
67+
expect(form.changes).toEqual({ age: 24, id: 1 })
68+
69+
form.acceptChanges();
70+
expect(form.pureValues).toEqual({ username: "Jack", age: 24, id: 1 });
71+
expect(form.changes).toEqual({})
72+
})
6173
})

0 commit comments

Comments
 (0)