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-281 UI Test Coverage Second Part
  • Loading branch information
baguilar6174 committed Jan 28, 2022
commit 865e044a1ed39c3d67751903767a58c4a2d20c37
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,14 @@ describe('activityManagementReducer', () => {

it('on SetActivityidToEdit, message equal to \"Set activityIdToEdit property\"', () => {
const action = new actions.SetActivityToEdit('1');

const state = activityManagementReducer(initialState, action);

expect(state.message).toEqual('Set activityIdToEdit property');
expect(state.isLoading).toBeFalse();
});

it('on ResetActivityIdToEdit, message equal to \"Reset activityIdToEdit property\"', () => {
const action = new actions.ResetActivityToEdit();

const state = activityManagementReducer(initialState, action);

expect(state.message).toEqual('Reset activityIdToEdit property');
expect(state.isLoading).toBeFalse();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -742,18 +742,12 @@ describe('DetailsFieldsComponent', () => {
expect(toastrServiceStub.warning).toHaveBeenCalled();
});

it('call the close method if opened equals true', () => {
const datepicker: any = { opened : true, open : () => ({}), close : () => ({}) };
spyOn(datepicker, 'close');
component.openOrCloseDatePicker(datepicker);
expect(datepicker.close).toHaveBeenCalled();
});

it('call the open method if opened equals false', () => {
const datepicker: any = { opened : false, open : () => ({}), close : () => ({}) };
spyOn(datepicker, 'open');
component.openOrCloseDatePicker(datepicker);
expect(datepicker.open).toHaveBeenCalled();
it('if entry is set to project_name search_fiend is assigned in entryForm', () => {
const listProjects: Project[] = [{ id: 'id', name: 'abc', status: 'active', search_field: 'name'}];
component.listProjects = listProjects;
component.entryToEdit = { ...entryToEdit };
component.ngOnChanges();
expect(component.entryForm.value.project_name).toBe('name');
});

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ describe('InputDateComponent', () => {
expect(datepicker.open).toHaveBeenCalled();
});

it('isDisabled shuold be true if parameter is true', () => {
it('isDisabled should be true if parameter is true', () => {
component.setDisabledState(true);
expect(component.isDisabled).toBe(true);
});

it('isDisabled shuold be false if parameter is false', () => {
it('isDisabled should be false if parameter is false', () => {
component.setDisabledState(false);
expect(component.isDisabled).toBe(false);
});

it(`value shuold be '' in writeValue function when parameter is null`, () => {
it(`value should be '' in writeValue function when parameter is null`, () => {
const value: any = null;
component.writeValue(value);
expect(component.value).toEqual('');
});

it(`value shuold be '' in writeValue function when parameter is not defined`, () => {
it(`value should be '' in writeValue function when parameter is not defined`, () => {
const value: any = undefined;
component.writeValue(value);
expect(component.value).toEqual('');
Expand Down