Skip to content

Commit 92c8865

Browse files
fix: TTA-49 fixing code format
1 parent 0bd80d3 commit 92c8865

11 files changed

+41
-43
lines changed

src/app/modules/reports/components/time-range-custom/time-range-custom.component.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@
1616
<button type="submit" class="btn btn-primary">Search</button>
1717
</div>
1818
</form>
19-
20-
21-

src/app/modules/reports/components/time-range-custom/time-range-custom.component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
display: flex;
1111
justify-content: space-between;
1212
width: 100%;
13-
}
13+
}
14+

src/app/modules/reports/components/time-range-custom/time-range-custom.component.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@ import * as moment from 'moment';
66
import { ToastrService } from 'ngx-toastr';
77
import { EntryState } from 'src/app/modules/time-clock/store/entry.reducer';
88
import * as entryActions from '../../../time-clock/store/entry.actions';
9-
10-
119
import { TimeRangeCustomComponent } from './time-range-custom.component';
1210

11+
1312
describe('TimeRangeCustomComponent', () => {
1413
let component: TimeRangeCustomComponent;
1514
let fixture: ComponentFixture<TimeRangeCustomComponent>;

src/app/modules/reports/components/time-range-custom/time-range-custom.component.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { FormControl, FormGroup } from '@angular/forms';
33
import { TimeRangeHeaderComponent } from './time-range-header/time-range-header.component';
44
import { DATE_FORMAT } from 'src/environments/environment';
55
import { formatDate } from '@angular/common';
6-
import {Store} from '@ngrx/store';
7-
import {EntryState} from '../../../time-clock/store/entry.reducer';
6+
import { Store } from '@ngrx/store';
7+
import { EntryState } from '../../../time-clock/store/entry.reducer';
88
import { ToastrService } from 'ngx-toastr';
9-
109
import * as entryActions from '../../../time-clock/store/entry.actions';
1110
import * as moment from 'moment';
1211

@@ -60,4 +59,3 @@ export class TimeRangeCustomComponent implements OnInit, OnChanges {
6059
}
6160

6261
}
63-

src/app/modules/reports/components/time-range-custom/time-range-header/time-range-header.component.scss

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
display: flex;
33
align-items: center;
44
padding: 0.5em;
5-
}
5+
}
66

7-
.time-range-header-label {
8-
flex: 1;
9-
height: 1em;
10-
font-weight: 500;
11-
text-align: center;
12-
}
7+
.time-range-header-label {
8+
flex: 1;
9+
height: 1em;
10+
font-weight: 500;
11+
text-align: center;
12+
}
1313

14-
.time-range-double-arrow .mat-icon {
15-
margin: -22%;
16-
}
14+
.time-range-double-arrow .mat-icon {
15+
margin: -22%;
16+
}

src/app/modules/reports/components/time-range-custom/time-range-header/time-range-header.component.spec.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import { MatNativeDateModule } from '@angular/material/core';
33
import { MatCalendar, MatDateRangePicker } from '@angular/material/datepicker';
44
import { By } from '@angular/platform-browser';
55
import { of } from 'rxjs';
6-
76
import { TimeRangeHeaderComponent } from './time-range-header.component';
87

8+
99
describe('TimeRangeHeaderComponent', () => {
1010
let component: TimeRangeHeaderComponent<any>;
1111
let fixture: ComponentFixture<TimeRangeHeaderComponent<any>>;
1212

1313
const value = {
14-
stateChanges:{
14+
stateChanges: {
1515
pipe: () => {
16-
return of({sucess: 'test'})
16+
return of({sucess: 'test'});
1717
}
1818
},
1919
activeDate: new Date()
20-
}
20+
};
2121

2222
beforeEach(async () => {
2323
await TestBed.configureTestingModule({
@@ -59,22 +59,22 @@ describe('TimeRangeHeaderComponent', () => {
5959
buttonsAll.forEach((button: any) => {
6060
spyOn(component, button.method);
6161
button.values.forEach((val: any) => {
62-
let buttonElement = fixture.debugElement.query(By.css(val.style));
62+
const buttonElement = fixture.debugElement.query(By.css(val.style));
6363
buttonElement.triggerEventHandler('click', null);
6464
tick();
6565
expect(component[button.method]).toHaveBeenCalledWith(val.call);
66-
})
67-
})
66+
});
67+
});
6868
}));
6969

7070
it('should call method changeDate with nextClicked', () => {
71-
spyOn(component, 'changeDate').withArgs('month', 1)
71+
spyOn(component, 'changeDate').withArgs('month', 1);
7272
component.nextClicked('month');
7373
expect(component.changeDate).toHaveBeenCalledWith('month', 1);
7474
});
7575

7676
it('should call method changeDate with previousClicked', () => {
77-
spyOn(component, 'changeDate').withArgs('year', -1)
77+
spyOn(component, 'changeDate').withArgs('year', -1);
7878
component.previousClicked('year');
7979
expect(component.changeDate).toHaveBeenCalledWith('year', -1);
8080
});
@@ -94,5 +94,5 @@ describe('TimeRangeHeaderComponent', () => {
9494
component.changeDate('year', -1);
9595
expect(component.calendar.activeDate.toDateString()).toEqual(makeDateYear.toDateString());
9696
});
97-
97+
9898
});

src/app/modules/reports/components/time-range-custom/time-range-header/time-range-header.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { MatCalendar } from '@angular/material/datepicker';
1414
import { Subject } from 'rxjs';
1515
import { takeUntil } from 'rxjs/operators';
1616

17+
1718
@Component({
1819
// selector: 'app-time-range-header',
1920
templateUrl: './time-range-header.component.html',

src/app/modules/reports/components/time-range-custom/time-range-panel/time-range-panel.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
>
88
{{ item }}
99
</button>
10-
</mat-card>
10+
</mat-card>

src/app/modules/reports/components/time-range-custom/time-range-panel/time-range-panel.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ $width: 128px;
1111
left: 0;
1212
display: flex;
1313
width: 100%;
14-
}
14+
}

src/app/modules/reports/components/time-range-custom/time-range-panel/time-range-panel.component.spec.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ import { MatDateRangePicker } from '@angular/material/datepicker';
55
import { MatDialogModule } from '@angular/material/dialog';
66
import { By } from '@angular/platform-browser';
77
import { ToastrService } from 'ngx-toastr';
8-
98
import { TimeRangePanelComponent } from './time-range-panel.component';
109

10+
1111
describe('TimeRangePanelComponent', () => {
1212
let component: TimeRangePanelComponent<any>;
1313
let fixture: ComponentFixture<TimeRangePanelComponent<any>>;
14-
const valueFunction = () => {
14+
const valueFunction = () => {
1515
return '';
1616
};
1717
const toastrServiceStub = {
18-
error: () => {
18+
error: () => {
1919
return 'error';
2020
}
2121
};
@@ -53,7 +53,7 @@ describe('TimeRangePanelComponent', () => {
5353

5454

5555
it('should click selectRange button and call calculateDateRange method', () => {
56-
spyOn(component, 'calculateDateRange').and.returnValues(['','']);
56+
spyOn(component, 'calculateDateRange').and.returnValues(['', '']);
5757
component.selectRange('today');
5858
expect(component.calculateDateRange).toHaveBeenCalled();
5959
});
@@ -92,27 +92,29 @@ describe('TimeRangePanelComponent', () => {
9292
const dataAll = [
9393
{range: 'this year', values:
9494
{start: {year: currentYear, month: 0, day: 1},
95-
end:{year: currentYear, month: 11, day: 31}
95+
end: {year: currentYear, month: 11, day: 31}
9696
}
9797
},
9898
{range: 'last year',
9999
values:
100-
{start: {year: currentYear-1, month: 0, day: 1},
101-
end: {year: currentYear-1, month: 11, day: 31}
100+
{start: {year: currentYear - 1, month: 0, day: 1},
101+
end: {year: currentYear - 1, month: 11, day: 31}
102102
}
103103
},
104104
];
105105
dataAll.forEach((val: any) => {
106106
const [start, end] = component.calculateDateRange(val.range);
107-
expect(new Date(start).toDateString()).toEqual(new Date(val.values.start.year, val.values.start.month, val.values.start.day).toDateString());
108-
expect(new Date(end).toDateString()).toEqual(new Date(val.values.end.year, val.values.end.month, val.values.end.day).toDateString());
107+
expect(new Date(start).toDateString()).toEqual(
108+
new Date(val.values.start.year, val.values.start.month, val.values.start.day).toDateString());
109+
expect(new Date(end).toDateString()).toEqual(
110+
new Date(val.values.end.year, val.values.end.month, val.values.end.day).toDateString());
109111
});
110112
});
111113

112114
it('should return a time range month when is called calculateMonth method', () => {
113115
const currentYear = new Date().getFullYear();
114116
const currentMonth = new Date().getMonth();
115-
const currentDays= new Date(currentYear, currentMonth + 1, 0).getDate()
117+
const currentDays = new Date(currentYear, currentMonth + 1, 0).getDate();
116118
const [start, end] = component.calculateMonth(new Date());
117119
expect(new Date(start).toDateString()).toEqual(new Date(currentYear, currentMonth, 1).toDateString());
118120
expect(new Date(end).toDateString()).toEqual(new Date(currentYear, currentMonth , currentDays).toDateString());

0 commit comments

Comments
 (0)