Skip to content

Commit

Permalink
fix(components-spec): fix paths in spec.ts files (#4859)
Browse files Browse the repository at this point in the history
* fix(spec): fix paths in spec.ts files

* fix(spec): fix paths in spec.ts files
  • Loading branch information
svetoldo4444ka authored and valorkin committed Nov 30, 2018
1 parent d583f74 commit 1662554
Show file tree
Hide file tree
Showing 23 changed files with 37 additions and 24 deletions.
2 changes: 1 addition & 1 deletion src/spec/accordion.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { AccordionConfig, AccordionModule } from 'ngx-bootstrap/accordion';
import { AccordionConfig, AccordionModule } from '../accordion';

@Component({
selector: 'accordion-test',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/alert.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ChangeDetectorRef, Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { AlertComponent, AlertConfig, AlertModule } from 'ngx-bootstrap/alert';
import { AlertComponent, AlertConfig, AlertModule } from '../alert';

@Component({selector: 'alert-test', template: ''})
class TestAlertComponent extends AlertComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/bs-dropdown.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Component } from '@angular/core';
import { fakeAsync, TestBed, tick } from '@angular/core/testing';

import { BsDropdownConfig, BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { BsDropdownConfig, BsDropdownModule } from '../dropdown';

@Component({
selector: 'dropdown-test',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/button.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component } from '@angular/
import { ComponentFixture, ComponentFixtureAutoDetect, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';

import { ButtonsModule } from 'ngx-bootstrap/buttons';
import { ButtonsModule } from '../buttons';

@Component({selector: 'buttons-test', template: ''})
class TestButtonsComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/carousel.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { CarouselModule } from 'ngx-bootstrap/carousel';
import { CarouselModule } from '../carousel';

@Component({selector: 'carousel-test', template: ''})
class TestCarouselComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/collapse.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { CollapseModule } from 'ngx-bootstrap/collapse';
import { CollapseModule } from '../collapse';

const template = `
<div [collapse]="isCollapsed">
Expand Down
2 changes: 1 addition & 1 deletion src/spec/draggable-item.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component } from '@angular/core';
import { fakeAsync, inject, TestBed } from '@angular/core/testing';
import { DraggableItem, DraggableItemService, SortableItem } from 'ngx-bootstrap/sortable';
import { DraggableItem, DraggableItemService, SortableItem } from '../sortable';

@Component({
template: `<h1>Test</h1>`
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/alert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { TestBed, inject } from '@angular/core/testing';
import { createGenericTestComponent } from './test/common';
import { ChangeDetectorRef, Component } from '@angular/core';
import { AlertModule, AlertComponent, AlertConfig } from 'ngx-bootstrap/alert';
import { AlertModule, AlertComponent, AlertConfig } from '../../alert';

@Component({
selector: 'test-cmp',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/carousel.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { discardPeriodicTasks, fakeAsync, inject, TestBed, tick } from '@angular

import { By } from '@angular/platform-browser';

import { CarouselComponent, CarouselConfig, CarouselModule } from 'ngx-bootstrap/carousel';
import { CarouselComponent, CarouselConfig, CarouselModule } from '../../carousel';
import { createGenericTestComponent } from './test/common';

@Component({selector: 'test-cmp', template: ''})
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/collapse.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createGenericTestComponent } from './test/common';

import { Component } from '@angular/core';

import { CollapseModule } from 'ngx-bootstrap/collapse';
import { CollapseModule } from '../../collapse';

@Component({ selector: 'test-cmp', template: '' })
class TestComponent {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/popover.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
PopoverContainerComponent,
PopoverDirective,
PopoverConfig
} from 'ngx-bootstrap/popover';
} from '../../popover';
import { createGenericTestComponent } from './test/common';

@Component({selector: 'test-cmpt', template: ``})
Expand Down
2 changes: 1 addition & 1 deletion src/spec/ng-bootstrap/tooltip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { fakeAsync, inject, TestBed, tick } from '@angular/core/testing';

import { By } from '@angular/platform-browser';

import { TooltipConfig, TooltipContainerComponent, TooltipDirective, TooltipModule } from 'ngx-bootstrap/tooltip';
import { TooltipConfig, TooltipContainerComponent, TooltipDirective, TooltipModule } from '../../tooltip';
import { createGenericTestComponent } from './test/common';

@Component({
Expand Down
6 changes: 4 additions & 2 deletions src/spec/ng-bootstrap/utils/triggers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @copyright Valor Software
* @copyright Angular ng-bootstrap team
*/
import { parseTriggers } from 'ngx-bootstrap/utils';
import { parseTriggers } from '../../../utils';

describe('triggers', () => {
describe('parseTriggers', () => {
Expand Down Expand Up @@ -64,8 +64,10 @@ describe('triggers', () => {

it('should detect manual triggers', () => {
const t = parseTriggers('manual');
spyOn(t[0], 'isManual').and.stub();

expect(spyOn).toBeTruthy();

expect(t[0].isManual).toBeTruthy();
});

it('should ignore empty inputs', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/pager.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
fakeAsync,
tick
} from '@angular/core/testing';
import { PagerComponent, PaginationModule } from 'ngx-bootstrap/pagination';
import { PagerComponent, PaginationModule } from '../pagination';
import { fireEvent } from '../../scripts/helpers';

describe('Component: Pager:', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/spec/pagination.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
fakeAsync,
tick
} from '@angular/core/testing';
import { PaginationModule, PaginationComponent } from 'ngx-bootstrap/pagination';
import { PaginationModule, PaginationComponent } from '../pagination';

describe('Component: Pagination:', () => {
let fixture: ComponentFixture<PaginationComponent>;
Expand Down
2 changes: 1 addition & 1 deletion src/spec/progressbar.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ProgressbarComponent, ProgressbarModule } from 'ngx-bootstrap/progressbar';
import { ProgressbarComponent, ProgressbarModule } from '../progressbar';

@Component({
selector: 'progressbar-test',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/rating.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';

import { RatingComponent, RatingModule } from 'ngx-bootstrap/rating';
import { RatingComponent, RatingModule } from '../rating';

@Component({
selector: 'rating-test',
Expand Down
4 changes: 3 additions & 1 deletion src/spec/sortable.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
SortableComponent,
SortableItem,
SortableModule
} from 'ngx-bootstrap/sortable';
} from '../sortable';

const HEROES: string[] = ['Windstorm', 'Bombasto', 'Magneta', 'Tornado'];
/* tslint:disable-next-line: no-any */
Expand Down Expand Up @@ -100,6 +100,7 @@ xdescribe('Component: Sortable', () => {
sort1.itemActiveStyle
);
// act
/* tslint:disable-next-line:no-inferred-empty-object-type */
const style = sort1.getItemStyle(true);
// assert
expect(style).toEqual(activeItemStyle);
Expand All @@ -109,6 +110,7 @@ xdescribe('Component: Sortable', () => {
// arrange
const normalItemStyle = Object.assign({}, sort1.itemStyle);
// act
/* tslint:disable-next-line:no-inferred-empty-object-type */
const style = sort1.getItemStyle(false);
// assert
expect(style).toEqual(normalItemStyle);
Expand Down
2 changes: 1 addition & 1 deletion src/spec/tabset.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* tslint:disable: max-file-line-count */
import { Component, ViewChild } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TabsetConfig, TabsModule, TabsetComponent } from 'ngx-bootstrap/tabs';
import { TabsetConfig, TabsModule, TabsetComponent } from '../tabs';

@Component({
selector: 'tabs-test',
Expand Down
11 changes: 10 additions & 1 deletion src/spec/timepicker/timepicker.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
TimepickerComponent,
TimepickerConfig,
TimepickerModule
} from 'ngx-bootstrap/timepicker';
} from '../../timepicker';

/* tslint:disable-next-line: no-any */
function getInputElements(fixture: any) {
Expand Down Expand Up @@ -981,6 +981,7 @@ describe('Component: TimepickerComponent', () => {
component.updateHours('99');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
expect(component.invalidHours).toEqual(true);
});
Expand All @@ -993,6 +994,7 @@ describe('Component: TimepickerComponent', () => {
component.updateHours('19');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
expect(component.invalidHours).toEqual(true);
});
Expand All @@ -1005,6 +1007,7 @@ describe('Component: TimepickerComponent', () => {
component.updateHours('17');

expect(component.invalidHours).toEqual(false);
/* tslint:disable-next-line:no-unbound-method */
expect(component._updateTime).toHaveBeenCalled();
});

Expand All @@ -1016,6 +1019,7 @@ describe('Component: TimepickerComponent', () => {
component.updateMinutes('99');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
});

Expand All @@ -1027,6 +1031,7 @@ describe('Component: TimepickerComponent', () => {
component.updateMinutes('30');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
});

Expand All @@ -1037,6 +1042,7 @@ describe('Component: TimepickerComponent', () => {
component.updateMinutes('30');

expect(component.invalidMinutes).toEqual(false);
/* tslint:disable-next-line:no-unbound-method */
expect(component._updateTime).toHaveBeenCalled();
});

Expand All @@ -1049,6 +1055,7 @@ describe('Component: TimepickerComponent', () => {
component.updateSeconds('99');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
});

Expand All @@ -1060,6 +1067,7 @@ describe('Component: TimepickerComponent', () => {
component.updateSeconds('50');

expect(methodSpy).toHaveBeenCalledWith(null);
/* tslint:disable-next-line:no-unbound-method */
expect(component.isValid.emit).toHaveBeenCalledWith(false);
});

Expand All @@ -1070,6 +1078,7 @@ describe('Component: TimepickerComponent', () => {
component.updateSeconds('30');

expect(component.invalidSeconds).toEqual(false);
/* tslint:disable-next-line:no-unbound-method */
expect(component._updateTime).toHaveBeenCalled();
});

Expand Down
2 changes: 1 addition & 1 deletion src/spec/tooltip.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { fireEvent } from '../../scripts/helpers';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { TooltipModule } from '../tooltip';

@Component({
selector: 'test-tooltip',
Expand Down
2 changes: 1 addition & 1 deletion src/spec/typeahead-container.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
TypeaheadDirective,
TypeaheadMatch,
TypeaheadOptions
} from 'ngx-bootstrap/typeahead';
} from '../typeahead';

describe('Component: TypeaheadContainer', () => {
let fixture: ComponentFixture<TypeaheadContainerComponent>;
Expand Down
2 changes: 1 addition & 1 deletion src/spec/typeahead.directive.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { FormsModule } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { of } from 'rxjs';
import { fireEvent } from '../../scripts/helpers';
import { TypeaheadMatch, TypeaheadDirective, TypeaheadModule } from 'ngx-bootstrap/typeahead';
import { TypeaheadMatch, TypeaheadDirective, TypeaheadModule } from '../typeahead';

interface State {
id: number;
Expand Down

0 comments on commit 1662554

Please sign in to comment.