Commits

Art Lowel authored d03c640e8c7 Merge
Merge remote-tracking branch 'atmire-github/fix-submission-lost-changes-after-save-7.6' into fix-submission-lost-changes-after-save-8.0.0-next
No tags

src/app/core/json-patch/json-patch-operations.service.spec.ts

Modified
149 149 it('should call submitJsonPatchOperations method', () => {
150 150 spyOn((service as any), 'submitJsonPatchOperations').and.callThrough();
151 151
152 152 scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpointURL, resourceScope, testJsonPatchResourceType).subscribe());
153 153 scheduler.flush();
154 154
155 155 expect((service as any).submitJsonPatchOperations).toHaveBeenCalled();
156 156 });
157 157
158 158 it('should send a new SubmissionPatchRequest', () => {
159 - const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref, patchOpBody);
159 + const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref + '?embed=item', patchOpBody);
160 160 scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpoint, resourceScope, testJsonPatchResourceType).subscribe());
161 161 scheduler.flush();
162 162
163 163 expect(requestService.send).toHaveBeenCalledWith(expected);
164 164 });
165 165
166 166 it('should dispatch a new StartTransactionPatchOperationsAction', () => {
167 167 const expectedAction = new StartTransactionPatchOperationsAction(testJsonPatchResourceType, undefined, timestamp);
168 168 scheduler.schedule(() => service.jsonPatchByResourceType(resourceEndpoint, resourceScope, testJsonPatchResourceType).subscribe());
169 169 scheduler.flush();
239 239 it('should call submitJsonPatchOperations method', () => {
240 240 spyOn((service as any), 'submitJsonPatchOperations').and.callThrough();
241 241
242 242 scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpointURL, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId).subscribe());
243 243 scheduler.flush();
244 244
245 245 expect((service as any).submitJsonPatchOperations).toHaveBeenCalled();
246 246 });
247 247
248 248 it('should send a new SubmissionPatchRequest', () => {
249 - const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref, patchOpBody);
249 + const expected = new SubmissionPatchRequest(requestService.generateRequestId(), resourceHref + '?embed=item', patchOpBody);
250 250 scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpoint, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId).subscribe());
251 251 scheduler.flush();
252 252
253 253 expect(requestService.send).toHaveBeenCalledWith(expected);
254 254 });
255 255
256 256 it('should dispatch a new StartTransactionPatchOperationsAction', () => {
257 257 const expectedAction = new StartTransactionPatchOperationsAction(testJsonPatchResourceType, testJsonPatchResourceId, timestamp);
258 258 scheduler.schedule(() => service.jsonPatchByResourceID(resourceEndpoint, resourceScope, testJsonPatchResourceType, testJsonPatchResourceId).subscribe());
259 259 scheduler.flush();

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut