Skip to content

Commit

Permalink
chore(testing): Adding test coverage to form utils (bullhorn#435)
Browse files Browse the repository at this point in the history
* chore(testing): Adding test coverage to form utils extracting nested
classes from class files into their own files for increased
modularization of code; making testing easier.

* chore(testing): fixed AOT bug from unexposed interface

* chore(testing): added specs for PopOver and ThOrderable

* chore(testing): added stubs for DatePicker & QuickNote

* chore(testing): extracted BasePickerResults and stubbed out a spec

* chore(testing): extracted BasePickerResults and stubbed out a spec

* chore(testing): cleaning up test log

* chore(testing): updated export of BasePickerResults

* chore(testing): Added table specs and modularized Table components

* chore(testing): Added stubs for PopOver and CardBestTime

* chore(testing): Cleaning up Table module

* chore(testing): Added stubs around Picker, modularized PickerContainer, refactored instances of components that use PickerContainer, added spec stubs for Pagination & TimePicker

* chore(testing): modularized DrawerElement directives and service
  • Loading branch information
krsween authored and jgodi committed Mar 19, 2017
1 parent 28c651f commit b4cc8c1
Show file tree
Hide file tree
Showing 66 changed files with 3,394 additions and 1,448 deletions.
5 changes: 3 additions & 2 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,14 @@ export { PagedArrayCollection } from './src/services/data-provider/PagedArrayCol
// Export classes that will need to be imported
export { NovoModalParams, NovoModalRef } from './src/elements/modal/Modal';
export { QuickNoteResults } from './src/elements/quick-note/extras/quick-note-results/QuickNoteResults';
export { PickerResults, BasePickerResults } from './src/elements/picker/extras/picker-results/PickerResults';
export { PickerResults } from './src/elements/picker/extras/picker-results/PickerResults';
export { BasePickerResults } from './src/elements/picker/extras/base-picker-results/BasePickerResults';
export { EntityPickerResult, EntityPickerResults } from './src/elements/picker/extras/entity-picker-results/EntityPickerResults';
export { ChecklistPickerResults } from './src/elements/picker/extras/checklist-picker-results/ChecklistPickerResults';
export { BaseRenderer } from './src/elements/table/extras/base-renderer/BaseRenderer';
export { DateCell } from './src/elements/table/extras/date-cell/DateCell';
export { FormValidators } from './src/elements/form/FormValidators';
export { FormUtils } from './src/elements/form/FormUtils';
export { FormUtils } from './src/utils/form-utils/FormUtils';
export * from './src/elements/form/FormControls';
// Utils
export { OutsideClick } from './src/utils/outside-click/OutsideClick';
Expand Down
2 changes: 1 addition & 1 deletion novo-elements.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import { NovoPopOverModule } from './src/elements/popover/PopOver.module';
import { NovoLabelService } from './src/services/novo-label-service';
import { NovoDragulaService } from './src/elements/dragula/DragulaService';
import { ComponentUtils } from './src/utils/component-utils/ComponentUtils';
import { FormUtils } from './src/elements/form/FormUtils';
import { FormUtils } from './src/utils/form-utils/FormUtils';

@NgModule({
imports: [
Expand Down
2 changes: 2 additions & 0 deletions src/elements/card/extras/best-time/CardBestTime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ describe('Elements: CardElement', () => {
it('should initialize correctly', () => {
expect(component).toBeTruthy();
expect(component.ngOnChanges).toBeDefined();
component.ngOnChanges();
});
});

describe('Method: getTimeOfDayStyleAndIcon()', () => {
it('should be defined.', () => {
expect(component.getTimeOfDayStyleAndIcon).toBeDefined();
component.getTimeOfDayStyleAndIcon('2-PM');
});
});
});
Expand Down
3 changes: 2 additions & 1 deletion src/elements/chips/Chips.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { FormsModule } from '@angular/forms';
import { TestBed, async } from '@angular/core/testing';
// App
import { NovoChipElement, NovoChipsElement } from './Chips';
import { NovoPickerElement, NovoPickerContainer } from '../picker/Picker';
import { NovoPickerElement } from '../picker/Picker';
import { NovoPickerContainer } from '../picker/extras/picker-container/PickerContainer';
import { ComponentUtils } from '../../utils/component-utils/ComponentUtils';
import { NovoLabelService } from '../../services/novo-label-service';

Expand Down
171 changes: 170 additions & 1 deletion src/elements/date-picker/DatePicker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,177 @@ describe('Elements: NovoDatePickerElement', () => {
}));

describe('Method: ngOnInit()', () => {
it('should initialize correctly', () => {
it('should be defined.', () => {
expect(component).toBeTruthy();
expect(component.ngOnInit).toBeTruthy();
});
});

describe('Method: isSelectingRange()', () => {
it('should be defined.', () => {
expect(component.isSelectingRange).toBeTruthy();
component.isSelectingRange();
});
});

describe('Method: isEndFill()', () => {
it('should be defined.', () => {
expect(component.isEndFill).toBeTruthy();
component.isEndFill();
});
});

describe('Method: isStartFill()', () => {
it('should be defined.', () => {
expect(component.isStartFill).toBeTruthy();
component.isStartFill();
});
});

describe('Method: isFiller()', () => {
it('should be defined.', () => {
expect(component.isFiller).toBeTruthy();
component.isFiller();
});
});

xdescribe('Method: isSelected()', () => {
it('should be defined.', () => {
expect(component.isSelected).toBeTruthy();
component.isSelected();
});
});

describe('Method: isDisabled()', () => {
it('should be defined.', () => {
expect(component.isDisabled).toBeTruthy();
component.isDisabled();
});
});

describe('Method: updateView()', () => {
it('should be defined.', () => {
expect(component.updateView).toBeTruthy();
component.updateView();
});
});

describe('Method: setToday()', () => {
it('should be defined.', () => {
expect(component.setToday).toBeTruthy();
component.setToday();
});
});

describe('Method: clearRange()', () => {
it('should be defined.', () => {
expect(component.clearRange).toBeTruthy();
component.clearRange();
});
});

describe('Method: setMonth()', () => {
it('should be defined.', () => {
expect(component.setMonth).toBeTruthy();
component.setMonth();
});
});

describe('Method: setYear()', () => {
it('should be defined.', () => {
expect(component.setYear).toBeTruthy();
component.setYear();
});
});

xdescribe('Method: select()', () => {
it('should be defined.', () => {
expect(component.select).toBeTruthy();
component.select();
});
});

describe('Method: open()', () => {
it('should be defined.', () => {
expect(component.open).toBeTruthy();
component.open();
});
});

xdescribe('Method: previousMonth()', () => {
it('should be defined.', () => {
expect(component.previousMonth).toBeTruthy();
component.previousMonth();
});
});

xdescribe('Method: nextMonth()', () => {
it('should be defined.', () => {
expect(component.nextMonth).toBeTruthy();
component.nextMonth();
});
});

describe('Method: updateHeading()', () => {
it('should be defined.', () => {
expect(component.updateHeading).toBeTruthy();
component.updateHeading();
});
});

describe('Method: removeTime()', () => {
it('should be defined.', () => {
expect(component.removeTime).toBeTruthy();
component.removeTime();
});
});

xdescribe('Method: buildMonth()', () => {
it('should be defined.', () => {
expect(component.buildMonth).toBeTruthy();
component.buildMonth();
});
});

xdescribe('Method: buildWeek()', () => {
it('should be defined.', () => {
expect(component.buildWeek).toBeTruthy();
component.buildWeek();
});
});

describe('Method: toggleRangeSelect()', () => {
it('should be defined.', () => {
expect(component.toggleRangeSelect).toBeTruthy();
component.toggleRangeSelect();
});
});

xdescribe('Method: rangeHover()', () => {
it('should be defined.', () => {
expect(component.rangeHover).toBeTruthy();
component.rangeHover();
});
});

describe('Method: writeValue()', () => {
it('should be defined.', () => {
expect(component.writeValue).toBeTruthy();
component.writeValue();
});
});

describe('Method: registerOnChange()', () => {
it('should be defined.', () => {
expect(component.registerOnChange).toBeTruthy();
component.registerOnChange();
});
});

describe('Method: registerOnTouched()', () => {
it('should be defined.', () => {
expect(component.registerOnTouched).toBeTruthy();
component.registerOnTouched();
});
});
});
Loading

0 comments on commit b4cc8c1

Please sign in to comment.