4157-send-sms-to-routes #1106

Merged
pau merged 16 commits from 4157-send-sms-to-routes into dev 2022-11-16 08:09:29 +00:00
2 changed files with 8 additions and 7 deletions
Showing only changes of commit 5bf425d8e3 - Show all commits

View File

@ -1,17 +1,17 @@
import './index';
describe('Ticket', () => {
describe('Component vnTicketSms', () => {
describe('Route', () => {
describe('Component vnRouteSms', () => {
let controller;
let $httpBackend;
beforeEach(ngModule('ticket'));
beforeEach(ngModule('route'));
beforeEach(inject(($componentController, $rootScope, _$httpBackend_) => {
$httpBackend = _$httpBackend_;
let $scope = $rootScope.$new();
const $element = angular.element('<vn-dialog></vn-dialog>');
controller = $componentController('vnTicketSms', {$element, $scope});
controller = $componentController('vnRouteSms', {$element, $scope});
controller.$.message = {
input: {
value: 'My SMS'
@ -21,11 +21,11 @@ describe('Ticket', () => {
describe('onResponse()', () => {
it('should perform a POST query and show a success snackbar', () => {
let params = {ticketId: 11, destinationFk: 1101, destination: 111111111, message: 'My SMS'};
controller.sms = {ticketId: 11, destinationFk: 1101, destination: 111111111, message: 'My SMS'};
let params = {destinationFk: 1101, destination: 111111111, message: 'My SMS'};
controller.sms = {destinationFk: 1101, destination: 111111111, message: 'My SMS'};
jest.spyOn(controller.vnApp, 'showMessage');
$httpBackend.expect('POST', `Tickets/11/sendSms`, params).respond(200, params);
$httpBackend.expect('POST', `Routes/sendSms`, params).respond(200, params);
controller.onResponse();
$httpBackend.flush();

View File

@ -37,6 +37,7 @@
icon="format_list_numbered">
</vn-button>
<vn-button
disabled="!$ctrl.isChecked"
icon="sms"
vn-tooltip="Send SMS to all clients"
ng-click="$ctrl.sendSms()">