Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/Sage-Bionetworks/Agora i…
Browse files Browse the repository at this point in the history
…nto develop
  • Loading branch information
gatof81 committed Nov 14, 2018
2 parents 53e716f + c4057a4 commit 444aff6
Show file tree
Hide file tree
Showing 22 changed files with 247 additions and 31 deletions.
2 changes: 1 addition & 1 deletion src/app/core/contrib-teams/contrib-teams.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { OrderBy } from '../../shared/pipes';

import { MockComponent } from 'ng-mocks';

describe('NavbarComponent', () => {
describe('Component: ContribTeamsPage', () => {
let component: ContribTeamsPageComponent;
let fixture: ComponentFixture<ContribTeamsPageComponent>;

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/footer/footer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

import { DataService, GeneService, NavigationService } from '../services';

describe('NavbarComponent', () => {
describe('Component: Footer', () => {
let component: FooterComponent;
let fixture: ComponentFixture<FooterComponent>;

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/help/help.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { MockComponent } from 'ng-mocks';

import { Button } from 'primeng/button';

describe('NavbarComponent', () => {
describe('Component: Help', () => {
let component: HelpComponent;
let fixture: ComponentFixture<HelpComponent>;

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/navbar/navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {

import { DataService, GeneService, NavigationService } from '../services';

describe('NavbarComponent', () => {
describe('Component: Navbar', () => {
let component: NavbarComponent;
let navService: NavigationServiceStub;
let fixture: ComponentFixture<NavbarComponent>;
Expand Down
14 changes: 3 additions & 11 deletions src/app/core/services/gene.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,12 @@
import {
async,
ComponentFixture,
TestBed,
fakeAsync,
tick
TestBed
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA, ReflectiveInjector } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';

import {
RouterStub,
GeneServiceStub,
mockInfo1
GeneServiceStub
} from '../../testing';

import { GeneService } from '../../core/services';
import { GeneService } from './';

describe('Service: Gene: TestBed', () => {
let geneService: GeneServiceStub;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

import { DataService, GeneService } from '../services';

describe('NavbarComponent', () => {
describe('Component: SynapseAccount', () => {
let component: SynapseAccountComponent;
let fixture: ComponentFixture<SynapseAccountComponent>;

Expand Down
14 changes: 13 additions & 1 deletion src/app/dialogs/bp-dialog/bp-dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
fakeAsync
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub
Expand All @@ -14,9 +15,11 @@ import { BPDialogComponent } from './bp-dialog.component';

import { DialogsService } from '../services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: SGDialog', () => {
describe('Component: BPDialog', () => {
let component: BPDialogComponent;
let fixture: ComponentFixture<BPDialogComponent>;
let dialogsService: DialogsServiceStub;
Expand All @@ -25,6 +28,7 @@ describe('Component: SGDialog', () => {
TestBed.configureTestingModule({
declarations: [
BPDialogComponent,
MockComponent(Dialog),
MockComponent(BPDialogComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
Expand All @@ -47,4 +51,12 @@ describe('Component: SGDialog', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
14 changes: 13 additions & 1 deletion src/app/dialogs/br-dialog/br-dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
fakeAsync
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub
Expand All @@ -14,9 +15,11 @@ import { BRDialogComponent } from './br-dialog.component';

import { DialogsService } from '../services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: SGDialog', () => {
describe('Component: BRDialog', () => {
let component: BRDialogComponent;
let fixture: ComponentFixture<BRDialogComponent>;
let dialogsService: DialogsServiceStub;
Expand All @@ -25,6 +28,7 @@ describe('Component: SGDialog', () => {
TestBed.configureTestingModule({
declarations: [
BRDialogComponent,
MockComponent(Dialog),
MockComponent(BRDialogComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
Expand All @@ -47,4 +51,12 @@ describe('Component: SGDialog', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
12 changes: 12 additions & 0 deletions src/app/dialogs/dg-dialog/dg-dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
fakeAsync
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub
Expand All @@ -14,6 +15,8 @@ import { DRUggabilityComponent } from './dg-dialog.component';

import { DialogsService } from '../services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: DGDialog', () => {
Expand All @@ -25,6 +28,7 @@ describe('Component: DGDialog', () => {
TestBed.configureTestingModule({
declarations: [
DRUggabilityComponent,
MockComponent(Dialog),
MockComponent(DRUggabilityComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
Expand All @@ -47,4 +51,12 @@ describe('Component: DGDialog', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
14 changes: 13 additions & 1 deletion src/app/dialogs/me-dialog/me-dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
fakeAsync
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub
Expand All @@ -14,9 +15,11 @@ import { MEDialogComponent } from './me-dialog.component';

import { DialogsService } from '../services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: SGDialog', () => {
describe('Component: MEDialog', () => {
let component: MEDialogComponent;
let fixture: ComponentFixture<MEDialogComponent>;
let dialogsService: DialogsServiceStub;
Expand All @@ -25,6 +28,7 @@ describe('Component: SGDialog', () => {
TestBed.configureTestingModule({
declarations: [
MEDialogComponent,
MockComponent(Dialog),
MockComponent(MEDialogComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
Expand All @@ -47,4 +51,12 @@ describe('Component: SGDialog', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
7 changes: 7 additions & 0 deletions src/app/dialogs/more-info/more-info.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
TestBed
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { By } from '@angular/platform-browser';

import {
DataServiceStub
Expand Down Expand Up @@ -45,4 +46,10 @@ describe('Component: MoreInfo', () => {
it('should have a text to display', () => {
expect(component.text).toEqual('View more information');
});

it('should have content to put the dialogs', () => {
fixture.detectChanges();
const el = fixture.debugElement.query(By.css('ng-content'));
expect(el).toBeDefined();
});
});
12 changes: 12 additions & 0 deletions src/app/dialogs/nt-dialog/nt-dialog.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub,
Expand All @@ -19,6 +20,8 @@ import { NOMinatedTargetComponent } from './nt-dialog.component';
import { DialogsService } from '../services';
import { NavigationService } from '../../core/services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: NTDialog', () => {
Expand All @@ -32,6 +35,7 @@ describe('Component: NTDialog', () => {
TestBed.configureTestingModule({
declarations: [
NOMinatedTargetComponent,
MockComponent(Dialog),
MockComponent(NOMinatedTargetComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
Expand Down Expand Up @@ -59,4 +63,12 @@ describe('Component: NTDialog', () => {
it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
74 changes: 74 additions & 0 deletions src/app/dialogs/rna-dialog/rna-dialog.component.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import {
async,
ComponentFixture,
TestBed,
fakeAsync
} from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { Router, ActivatedRoute } from '@angular/router';
import { By } from '@angular/platform-browser';

import {
DialogsServiceStub,
RouterStub,
ActivatedRouteStub,
NavigationServiceStub
} from '../../testing';

import { RNAComponent } from './rna-dialog.component';

import { DialogsService } from '../services';
import { NavigationService } from '../../core/services';

import { Dialog } from 'primeng/dialog';

import { MockComponent } from 'ng-mocks';

describe('Component: RNADialog', () => {
let component: RNAComponent;
let fixture: ComponentFixture<RNAComponent>;
let router: RouterStub;
let dialogsService: DialogsServiceStub;
let activatedRoute: any;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
RNAComponent,
MockComponent(Dialog),
MockComponent(RNAComponent)
],
// The NO_ERRORS_SCHEMA tells the Angular compiler to ignore unrecognized
// elements and attributes
schemas: [NO_ERRORS_SCHEMA],
providers: [
{ provide: Router, useValue: new RouterStub() },
{ provide: ActivatedRoute, useValue: new ActivatedRouteStub() },
{ provide: DialogsService, useValue: new DialogsServiceStub() },
{ provide: NavigationService, useValue: new NavigationServiceStub() },
]
})
.compileComponents();

fixture = TestBed.createComponent(RNAComponent);

// Get the injected instances
router = fixture.debugElement.injector.get(Router);
dialogsService = fixture.debugElement.injector.get(DialogsService);
activatedRoute = fixture.debugElement.injector.get(ActivatedRoute);

component = fixture.componentInstance; // Component test instance
}));

it('should create', () => {
expect(component).toBeTruthy();
});

it('should have a dialog element', () => {
const el = fixture.debugElement.query(By.css('p-dialog'));
expect(el).toBeDefined();

const aEl = fixture.debugElement.queryAll(By.css('p-dialog'));
expect(aEl.length).toEqual(1);
});
});
27 changes: 27 additions & 0 deletions src/app/dialogs/services/dialogs.service.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
TestBed
} from '@angular/core/testing';

import {
DialogsServiceStub
} from '../../testing';

import { DialogsService } from './';

describe('Service: Dialogs: TestBed', () => {
let geneService: DialogsServiceStub;

beforeEach(() => {
TestBed.configureTestingModule({
providers: [
{ provide: DialogsService, useValue: new DialogsServiceStub() }
]
});

geneService = TestBed.get(DialogsService);
});

it('should create an instance', () => {
expect(geneService).toBeDefined();
});
});
Loading

0 comments on commit 444aff6

Please sign in to comment.