Skip to content

Commit 513e48c

Browse files
committed
test: TT-281 UI Test Coverage Second Part
1 parent e144a1b commit 513e48c

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

src/app/modules/customer-management/components/projects/components/store/project.reducer.spec.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,6 @@ describe('projectReducer', () => {
4141
expect(state.isLoading).toEqual(false);
4242
});
4343

44-
/* it('on LoadProjectsSuccess, projectsFound are saved in the store', () => {
45-
const projectsFound: Project[] = [{ id: '', name: '', description: '', project_type_id: '123' }];
46-
const action = new actions.LoadProjectsSuccess(projectsFound);
47-
const state = projectReducer(initialState, action);
48-
expect(state.customerProjects).toEqual(projectsFound);
49-
}); */
50-
51-
/* it('on LoadProjectsFail, Projects equal []', () => {
52-
const action = new actions.LoadProjectsFail('error');
53-
const state = projectReducer(initialState, action);
54-
expect(state).toEqual([]);
55-
}); */
56-
57-
5844
it('on LoadCustomerProjects, isLoading is true', () => {
5945
const action = new actions.LoadCustomerProjects('1');
6046
const state = projectReducer(initialState, action);

src/app/modules/shared/components/details-fields/details-fields.component.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -743,21 +743,19 @@ describe('DetailsFieldsComponent', () => {
743743
});
744744

745745
it('call the close method if opened equals true', () => {
746-
const datepicker: any = { opened : true, open : () => {}, close : () => {} };
746+
const datepicker: any = { opened : true, open : () => ({}), close : () => ({}) };
747747
spyOn(datepicker, 'close');
748748
component.openOrCloseDatePicker(datepicker);
749749
expect(datepicker.close).toHaveBeenCalled();
750750
});
751751

752752
it('call the open method if opened equals false', () => {
753-
const datepicker: any = { opened : false, open : () => {}, close : () => {} };
753+
const datepicker: any = { opened : false, open : () => ({}), close : () => ({}) };
754754
spyOn(datepicker, 'open');
755755
component.openOrCloseDatePicker(datepicker);
756756
expect(datepicker.open).toHaveBeenCalled();
757757
});
758758

759-
// TODO: test en la función find del método onChange
760-
761759
/*
762760
TODO As part of https://github.com/ioet/time-tracker-ui/issues/424 a new parameter was added to the details-field-component,
763761
and now these couple of tests are failing. A solution to this error might be generate a Test Wrapper Component. More details here:

src/app/modules/shared/components/input-date/input-date.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ describe('InputDateComponent', () => {
3838
}));
3939

4040
it('call the close method if opened equals true', () => {
41-
const datepicker: any = { opened : true, open : () => {}, close : () => {} };
41+
const datepicker: any = { opened : true, open : () => ({}), close : () => ({}) };
4242
spyOn(datepicker, 'close');
4343
component.openOrCloseDatePicker(datepicker);
4444
expect(datepicker.close).toHaveBeenCalled();
4545
});
4646

4747
it('call the open method if opened equals false', () => {
48-
const datepicker: any = { opened : false, open : () => {}, close : () => {}};
48+
const datepicker: any = { opened : false, open : () => ({}), close : () => ({}) };
4949
spyOn(datepicker, 'open');
5050
component.openOrCloseDatePicker(datepicker);
5151
expect(datepicker.open).toHaveBeenCalled();

0 commit comments

Comments
 (0)