Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: TT-33 include ticket changes in tests
  • Loading branch information
andresacg30 committed Jun 7, 2022
commit fafe5bc8aef488a62eb8c6112150237f8b9c0ebe
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import * as entryActions from '../../../time-clock/store/entry.actions';
import {Store} from '@ngrx/store';
import {EntryState} from '../../../time-clock/store/entry.reducer';
import * as moment from 'moment';
import { DateAdapter } from '@angular/material/core';


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line break


@Component({
Expand All @@ -21,11 +23,13 @@ export class TimeRangeFormComponent implements OnInit, OnChanges {
private startDate = new FormControl('');
private endDate = new FormControl('');

constructor(private store: Store<EntryState>, private toastrService: ToastrService) {
constructor(private store: Store<EntryState>, private toastrService: ToastrService, private date: DateAdapter<Date>) {
this.reportForm = new FormGroup({
startDate: this.startDate,
endDate: this.endDate
});
date.getFirstDayOfWeek = () => 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a test


}
ngOnInit(): void {
this.setInitialDataOnScreen();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@ import { InputDateComponent } from '../../../shared/components/input-date/input-
import * as entryActions from '../../../time-clock/store/entry.actions';
import * as moment from 'moment';
import { SimpleChange } from '@angular/core';
import { DateAdapter } from '@angular/material/core';

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line break


describe('Reports Page', () => {
describe('TimeRangeFormComponent', () => {
let component: TimeRangeFormComponent;
let fixture: ComponentFixture<TimeRangeFormComponent>;
let store: MockStore<EntryState>;
let date: DateAdapter<Date>;

const toastrServiceStub = {
error: (message?: string, title?: string, override?: Partial<IndividualConfig>) => { }
};
Expand Down Expand Up @@ -46,10 +50,12 @@ describe('Reports Page', () => {
declarations: [TimeRangeFormComponent, InputDateComponent],
providers: [
provideMockStore({ initialState: state }),
{ provide: ToastrService, useValue: toastrServiceStub }
{ provide: ToastrService, useValue: toastrServiceStub },
{ provide: DateAdapter, useClass: DateAdapter }
],
}).compileComponents();
store = TestBed.inject(MockStore);
date = TestBed.inject(DateAdapter);

}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ export class InputDateComponent implements ControlValueAccessor {
onChange = (_: any) => { };
onTouch = () => { };

constructor(date: DateAdapter<Date>) {
date.getFirstDayOfWeek = () => 1;
}

onInput(value: moment.Moment) {
onInput(value: moment.Moment, date: DateAdapter<Date>) {
this.value = value.format(DATE_FORMAT_YEAR);
this.onTouch();
this.onChange(this.value);
Expand Down
2 changes: 1 addition & 1 deletion src/environments/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

export const environment = {
production: false,
timeTrackerApiUrl: 'http://localhost:7071/api',
timeTrackerApiUrl: 'https://0390-2800-4f0-546-4680-b5ef-416e-decc-9774.ngrok.io/api',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this be localhost again?

stackexchangeApiUrl: 'https://api.stackexchange.com',
};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove line break

Expand Down