Skip to content

Commit

Permalink
SHIBUI-1267 fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmathis committed Jun 6, 2019
1 parent f94c393 commit 714c1ed
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ describe('Editor Nav Component', () => {
id: 'common',
label: 'Common Attributes',
index: 2,
initialValues: [],
schema: 'assets/schema/provider/filebacked-http-common.schema.json'
initialValues: []
};

beforeEach(async(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ProviderItemComponent } from '../component/provider-item.component';
import { FileBackedHttpMetadataResolver } from '../../domain/entity';
import { MockI18nModule } from '../../../../testing/i18n.stub';
import { CustomDatePipe } from '../../../shared/pipe/date.pipe';
import { Observable, of } from 'rxjs';


describe('Dashboard Providers List Page', () => {
Expand Down Expand Up @@ -61,6 +62,7 @@ describe('Dashboard Providers List Page', () => {
modal = TestBed.get(NgbModal);

spyOn(store, 'dispatch').and.callThrough();
spyOn(store, 'select').and.returnValues(of([]), of({'foo': true}));
});

it('should compile', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { getOpenProviders } from '../reducer';
import { ToggleEntityDisplay } from '../action/manager.action';
import { map } from 'rxjs/operators';
import { ChangeProviderOrderUp, ChangeProviderOrderDown } from '../../provider/action/collection.action';
import { Metadata } from '../../domain/domain.type';

@Component({
selector: 'dashboard-providers-list',
Expand All @@ -17,7 +18,7 @@ import { ChangeProviderOrderUp, ChangeProviderOrderDown } from '../../provider/a

export class DashboardProvidersListComponent implements OnInit {

providers$: Observable<MetadataProvider[]>;
providers$: Observable<Metadata[]>;
providersOpen$: Observable<{ [key: string]: boolean }>;

constructor(
Expand All @@ -26,7 +27,7 @@ export class DashboardProvidersListComponent implements OnInit {
) { }

ngOnInit(): void {
this.providers$ = this.store.select(getOrderedProviders) as Observable<MetadataProvider[]>;
this.providers$ = this.store.select(getOrderedProviders);
this.providersOpen$ = this.store.select(getOpenProviders);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { StoreModule, Store, combineReducers } from '@ngrx/store';
import { NgbPaginationModule, NgbModal, NgbModalModule, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import * as fromDashboard from '../reducer';
import { ProviderSearchComponent } from '../component/provider-search.component';
import { EntityItemComponent } from '../component/entity-item.component';
import { DeleteDialogComponent } from '../component/delete-dialog.component';
import { RouterStub } from '../../../../testing/router.stub';
import { NgbModalStub } from '../../../../testing/modal.stub';
Expand Down Expand Up @@ -100,13 +99,6 @@ describe('Dashboard Resolvers List Page', () => {
});
});

describe('openPreviewDialog method', () => {
it('should fire a redux action', () => {
instance.openPreviewDialog(resolver);
expect(store.dispatch).toHaveBeenCalled();
});
});

describe('search method', () => {
it('should fire a redux action', () => {
instance.search();
Expand Down
6 changes: 3 additions & 3 deletions ui/src/app/wizard/reducer/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ describe('wizard index selectors', () => {
describe('getSchema method', () => {
it('should return the schema by index name', () => {
expect(
selectors.getSchemaPath('common', FileBackedHttpMetadataProviderWizard)
).toBe(FileBackedHttpMetadataProviderWizard.steps[0].schema);
selectors.getSchemaPath(FileBackedHttpMetadataProviderWizard)
).toBe(FileBackedHttpMetadataProviderWizard.schema);
});
it('should return nothing if no schema is found', () => {
expect(
selectors.getSchemaPath('common', null)
selectors.getSchemaPath(null)
).toBeFalsy();
});
});
Expand Down

0 comments on commit 714c1ed

Please sign in to comment.