jazz-tools 0.8.31 → 0.8.32

Sign up to get free protection for your applications and to get access to all the features.
@@ -110,6 +110,94 @@ describe("Simple CoMap operations", async () => {
110
110
  delete map.name;
111
111
  expect(map.name).toEqual(undefined);
112
112
  expect(Object.keys(map)).not.toContain("name");
113
+
114
+ expect(map._edits).toMatchObject({
115
+ _height: {
116
+ by: { id: me.id },
117
+ value: 20,
118
+ },
119
+ birthday: {
120
+ by: { id: me.id },
121
+ value: newBirthday,
122
+ },
123
+ color: {
124
+ by: { id: me.id },
125
+ value: "green",
126
+ all: [
127
+ expect.objectContaining({
128
+ by: { _type: "Account", id: me.id },
129
+ value: "red",
130
+ }),
131
+ expect.objectContaining({
132
+ by: { _type: "Account", id: me.id },
133
+ value: "blue",
134
+ }),
135
+ expect.objectContaining({
136
+ by: { _type: "Account", id: me.id },
137
+ value: "green",
138
+ }),
139
+ ],
140
+ },
141
+ nullable: {
142
+ by: { id: me.id },
143
+ value: null,
144
+ all: [
145
+ expect.objectContaining({
146
+ by: { _type: "Account", id: me.id },
147
+ value: null,
148
+ }),
149
+ expect.objectContaining({
150
+ by: { _type: "Account", id: me.id },
151
+ value: "not null",
152
+ }),
153
+ expect.objectContaining({
154
+ by: { _type: "Account", id: me.id },
155
+ value: null,
156
+ }),
157
+ expect.objectContaining({
158
+ by: { _type: "Account", id: me.id },
159
+ value: undefined,
160
+ }),
161
+ expect.objectContaining({
162
+ by: { _type: "Account", id: me.id },
163
+ value: null,
164
+ }),
165
+ ],
166
+ },
167
+ });
168
+
169
+ expect(JSON.parse(JSON.stringify(map._edits))).toMatchObject({
170
+ _height: {
171
+ by: { id: me.id },
172
+ value: 20,
173
+ },
174
+ birthday: {
175
+ by: { id: me.id },
176
+ value: newBirthday.toISOString(),
177
+ },
178
+ color: {
179
+ by: { id: me.id },
180
+ value: "green",
181
+ all: [
182
+ expect.objectContaining({
183
+ by: { _type: "Account", id: me.id },
184
+ value: "red",
185
+ }),
186
+ expect.objectContaining({
187
+ by: { _type: "Account", id: me.id },
188
+ value: "blue",
189
+ }),
190
+ expect.objectContaining({
191
+ by: { _type: "Account", id: me.id },
192
+ value: "green",
193
+ }),
194
+ ],
195
+ },
196
+ nullable: {
197
+ by: { id: me.id },
198
+ value: null,
199
+ },
200
+ });
113
201
  });
114
202
  });
115
203