Skip to content

Commit 865e044

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

File tree

3 files changed

+10
-20
lines changed

3 files changed

+10
-20
lines changed

src/app/modules/activities-management/store/activity-management.reducers.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,18 +145,14 @@ describe('activityManagementReducer', () => {
145145

146146
it('on SetActivityidToEdit, message equal to \"Set activityIdToEdit property\"', () => {
147147
const action = new actions.SetActivityToEdit('1');
148-
149148
const state = activityManagementReducer(initialState, action);
150-
151149
expect(state.message).toEqual('Set activityIdToEdit property');
152150
expect(state.isLoading).toBeFalse();
153151
});
154152

155153
it('on ResetActivityIdToEdit, message equal to \"Reset activityIdToEdit property\"', () => {
156154
const action = new actions.ResetActivityToEdit();
157-
158155
const state = activityManagementReducer(initialState, action);
159-
160156
expect(state.message).toEqual('Reset activityIdToEdit property');
161157
expect(state.isLoading).toBeFalse();
162158
});

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -742,18 +742,12 @@ describe('DetailsFieldsComponent', () => {
742742
expect(toastrServiceStub.warning).toHaveBeenCalled();
743743
});
744744

745-
it('call the close method if opened equals true', () => {
746-
const datepicker: any = { opened : true, open : () => ({}), close : () => ({}) };
747-
spyOn(datepicker, 'close');
748-
component.openOrCloseDatePicker(datepicker);
749-
expect(datepicker.close).toHaveBeenCalled();
750-
});
751-
752-
it('call the open method if opened equals false', () => {
753-
const datepicker: any = { opened : false, open : () => ({}), close : () => ({}) };
754-
spyOn(datepicker, 'open');
755-
component.openOrCloseDatePicker(datepicker);
756-
expect(datepicker.open).toHaveBeenCalled();
745+
it('if entry is set to project_name search_fiend is assigned in entryForm', () => {
746+
const listProjects: Project[] = [{ id: 'id', name: 'abc', status: 'active', search_field: 'name'}];
747+
component.listProjects = listProjects;
748+
component.entryToEdit = { ...entryToEdit };
749+
component.ngOnChanges();
750+
expect(component.entryForm.value.project_name).toBe('name');
757751
});
758752

759753
/*

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ describe('InputDateComponent', () => {
5151
expect(datepicker.open).toHaveBeenCalled();
5252
});
5353

54-
it('isDisabled shuold be true if parameter is true', () => {
54+
it('isDisabled should be true if parameter is true', () => {
5555
component.setDisabledState(true);
5656
expect(component.isDisabled).toBe(true);
5757
});
5858

59-
it('isDisabled shuold be false if parameter is false', () => {
59+
it('isDisabled should be false if parameter is false', () => {
6060
component.setDisabledState(false);
6161
expect(component.isDisabled).toBe(false);
6262
});
6363

64-
it(`value shuold be '' in writeValue function when parameter is null`, () => {
64+
it(`value should be '' in writeValue function when parameter is null`, () => {
6565
const value: any = null;
6666
component.writeValue(value);
6767
expect(component.value).toEqual('');
6868
});
6969

70-
it(`value shuold be '' in writeValue function when parameter is not defined`, () => {
70+
it(`value should be '' in writeValue function when parameter is not defined`, () => {
7171
const value: any = undefined;
7272
component.writeValue(value);
7373
expect(component.value).toEqual('');

0 commit comments

Comments
 (0)