refs #5063 fixed front test
This commit is contained in:
parent
afb14044cc
commit
6d6fa11da1
|
@ -92,10 +92,8 @@ class Controller extends Descriptor {
|
|||
this.$.photo.setAttribute('src', newSrc);
|
||||
this.$.photo.setAttribute('zoom-image', newZoomSrc);
|
||||
|
||||
if (this.item.isPhotoRequested) {
|
||||
this.$http.patch(`Items/${this.item.id}`, {isPhotoRequested: false})
|
||||
.then(() => this.item.isPhotoRequested = false);
|
||||
}
|
||||
if (this.item.isPhotoRequested)
|
||||
this.$http.patch(`Items/${this.item.id}`, {isPhotoRequested: false});
|
||||
}
|
||||
|
||||
getWarehouseName(warehouseFk) {
|
||||
|
|
|
@ -47,14 +47,13 @@ describe('vnItemDescriptor', () => {
|
|||
|
||||
describe('onUploadResponse()', () => {
|
||||
it(`should change isPhotoRequested when a new photo is uploaded`, () => {
|
||||
$httpBackend.expectPATCH(`Items/${item.id}`).respond();
|
||||
controller.item = item;
|
||||
controller.$rootScope = {imagePath: () => {}};
|
||||
controller.$.photo = {setAttribute: () => {}};
|
||||
controller.item = item;
|
||||
|
||||
$httpBackend.expectPATCH(`Items/${item.id}`).respond(200);
|
||||
controller.onUploadResponse();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.item.isPhotoRequested).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue