test: refs #244936 remove window.open called
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
30da83a88c
commit
d355b320b4
|
@ -388,8 +388,9 @@ class Controller extends Section {
|
|||
|
||||
newOrderFromTicket() {
|
||||
this.$http.post(`Orders/newFromTicket`, {ticketFk: this.ticket.id}).then(async res => {
|
||||
window.location.href = await this.vnApp.getUrl(`order/${res.data}/catalog`);
|
||||
const path = await this.vnApp.getUrl(`order/${res.data}/catalog`);
|
||||
|
||||
window.open(path, '_blank');
|
||||
this.vnApp.showSuccess(this.$t('Order created'));
|
||||
});
|
||||
}
|
||||
|
|
|
@ -567,14 +567,10 @@ describe('Ticket', () => {
|
|||
const expectedResponse = {id: 123};
|
||||
|
||||
window.open = jasmine.createSpy('open');
|
||||
controller.$state.href = jasmine.createSpy('href')
|
||||
.and.returnValue('/somePath');
|
||||
|
||||
$httpBackend.expect('POST', `Orders/newFromTicket`, expectedParams).respond(expectedResponse);
|
||||
controller.newOrderFromTicket();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(window.open).toHaveBeenCalledWith('/somePath', '_blank');
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue