4157-send-sms-to-routes #1106
|
@ -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();
|
||||
|
|
|
@ -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()">
|
||||
|
|
Loading…
Reference in New Issue