Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shuaib changes #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
936 changes: 813 additions & 123 deletions ml-search-server/package-lock.json

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions ml-search-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions ml-search-web/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import { TestBed, async } from '@angular/core/testing';

import { Router, RouterOutlet, RouterModule } from "@angular/router";
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

class MockRouter { public navigate() {}; }

describe('AppComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
providers: [
{provide: Router, useClass: MockRouter },
RouterOutlet,
RouterModule
],
imports: [ RouterTestingModule ]
}).compileComponents();
}));

Expand All @@ -20,13 +29,13 @@ describe('AppComponent', () => {
it(`should have as title 'app'`, async(() => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('app');
expect(app.title).toEqual('MarkLogic Search Sample');
}));

it('should render title in a h1 tag', async(() => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!');
expect(compiled.querySelector('a').textContent).toContain('Marklogic Search');
}));
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { FormsModule } from '@angular/forms';
import { SearchBoxComponent } from './search-box.component';

describe('SearchBoxComponent', () => {
Expand All @@ -8,6 +8,7 @@ describe('SearchBoxComponent', () => {

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ FormsModule ],
declarations: [ SearchBoxComponent ]
})
.compileComponents();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { FormsModule } from '@angular/forms';
import { SearchContainerComponent } from './search-container.component';
import { SearchBoxComponent } from '../search-box/search-box.component';
import { SearchResultComponent } from '../search-result/search-result.component';
import { PagerComponent } from '../pager/pager.component';
import { RouterTestingModule } from '@angular/router/testing';
import { Store, StoreModule } from '@ngrx/store';

describe('SearchContainerComponent', () => {
let component: SearchContainerComponent;
let fixture: ComponentFixture<SearchContainerComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SearchContainerComponent ]
imports: [ FormsModule, RouterTestingModule, StoreModule.forRoot({ }) ],
declarations: [
SearchContainerComponent,
SearchBoxComponent,
SearchResultComponent,
PagerComponent
]
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { Router, RouterOutlet, RouterModule } from "@angular/router";
import { RouterTestingModule } from '@angular/router/testing';
import { SearchResultComponent } from './search-result.component';

class MockRouter { public navigate() {}; }

describe('SearchResultComponent', () => {
let component: SearchResultComponent;
let fixture: ComponentFixture<SearchResultComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ SearchResultComponent ]
imports: [
RouterTestingModule
],
declarations: [ SearchResultComponent ],
providers: [
{provide: Router, useClass: MockRouter },
RouterOutlet,
RouterModule
],
})
.compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { Store, StoreModule } from '@ngrx/store';
import { ViewDocContainerComponent } from './view-doc-container.component';
import { RouterTestingModule } from '@angular/router/testing';

describe('ViewDocContainerComponent', () => {
let component: ViewDocContainerComponent;
let fixture: ComponentFixture<ViewDocContainerComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [ RouterTestingModule, StoreModule.forRoot({ }) ],
declarations: [ ViewDocContainerComponent ]
})
.compileComponents();
Expand Down