LP1884787 ng lint and unit test repairs
authorBill Erickson <berickxx@gmail.com>
Wed, 24 Jun 2020 16:25:16 +0000 (12:25 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 25 Jun 2020 14:01:39 +0000 (10:01 -0400)
Minor lint update, some of which affected tests and required a few
additional test spec updates.

Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/booking/create-reservation.component.ts
Open-ILS/src/eg2/src/app/staff/booking/reservation-actions.spec.ts
Open-ILS/src/eg2/src/app/staff/booking/schedule-grid.service.ts

index 9f05c27..6e3ae35 100644 (file)
@@ -316,7 +316,8 @@ export class CreateReservationComponent implements OnInit, AfterViewInit, OnDest
             };
             this.resources.forEach(resource => {
                 this.cellTextGenerator[resource.barcode()] = row =>  {
-                    return row.patrons[resource.barcode()] ? row.patrons[resource.barcode()].map(reservation => reservation['patronLabel']).join(', ') : '';
+                    return row.patrons[resource.barcode()] ?
+                        row.patrons[resource.barcode()].map(reservation => reservation['patronLabel']).join(', ') : '';
                 };
             });
         });
index c47af8d..73e4e25 100644 (file)
@@ -8,12 +8,16 @@ describe('ReservationActionsService', () => {
     let service: ReservationActionsService;
     let cookieServiceStub: Partial<CookieService>;
     let printServiceStub: Partial<PrintService>;
+    let pcrudServiceStub: Partial<PcrudService>;
     const routerSpy = {
         navigate: jasmine.createSpy('navigate')
     };
     beforeEach(() => {
-        const pcrudServiceStub = {};
-        const cookieServiceStub = {};
+        pcrudServiceStub = {};
+        cookieServiceStub = {};
+        pcrudServiceStub = {};
+        cookieServiceStub = {};
+        printServiceStub = {};
         TestBed.configureTestingModule({
             providers: [
                 ReservationActionsService,
index 46929de..401eafa 100644 (file)
@@ -101,7 +101,8 @@ export class ScheduleGridService {
                 timezone)
         };
     }
-    momentizeDay = (date: Date, start: NgbTimeStruct, end: NgbTimeStruct, timezone: string): {startTime: moment.Moment, endTime: moment.Moment} => {
+    momentizeDay = (date: Date, start: NgbTimeStruct, end: NgbTimeStruct, timezone: string):
+        {startTime: moment.Moment, endTime: moment.Moment} => {
         return {
             startTime: moment.tz([
                 date.getFullYear(),
@@ -148,7 +149,7 @@ export class ScheduleGridService {
                 schedule[index].time.clone().add(granularity, 'minutes');
             if ((moment.tz(reservation.start_time(), timezone).isBefore(end)) &&
                 (moment.tz(reservation.end_time(), timezone).isAfter(start))) {
-                if (!schedule[index]['patrons']) schedule[index].patrons = {};
+                if (!schedule[index]['patrons']) { schedule[index].patrons = {}; }
                 if (!schedule[index].patrons[reservation.current_resource().barcode()]) {
                     schedule[index].patrons[reservation.current_resource().barcode()] = [];
                 }