Skip to content

Commit

Permalink
Fixing tests and lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Fâciu committed Sep 7, 2016
1 parent 6f42e30 commit 48128be
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
20 changes: 13 additions & 7 deletions components/file-upload/file-drop.directive.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
import {Component} from '@angular/core';
import {it, inject, beforeEachProviders} from '@angular/core/testing';
import {ComponentFixture} from '@angular/compiler/testing';
import {inject,ComponentFixture, TestBed} from '@angular/core/testing';

import {FileUploader} from './file-uploader.class';
import {FileSelectDirective} from './file-select.directive';
import {FileUploadModule} from './file-upload.module';

@Component({
selector: 'container',
template: `<input type="file" ng2FileSelect [uploader]="uploader" />`,
directives: [FileSelectDirective]
template: `<input type="file" ng2FileSelect [uploader]="uploader" />`
})
export class ContainerComponent {
public uploader:FileUploader = new FileUploader({url: 'localhost:3000'});
}

describe('Directive: FileSelectDirective', () => {
beforeEachProviders(() => [
ContainerComponent
beforeEach(() => [
TestBed.configureTestingModule({
imports: [FileUploadModule],
declarations: [ContainerComponent],
providers: [ContainerComponent]
})
]);

it('should be fine', inject([ContainerComponent], (fixture:ComponentFixture<ContainerComponent>) => {
expect(fixture).not.toBeNull();
}));
Expand Down
3 changes: 2 additions & 1 deletion components/file-upload/file-upload.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ import { FileSelectDirective } from './file-select.directive';
declarations: [FileDropDirective, FileSelectDirective],
exports: [FileDropDirective, FileSelectDirective]
})
export class FileUploadModule { }
export class FileUploadModule {
}
2 changes: 1 addition & 1 deletion demo/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ let gettingStarted = require('./getting-started.md');
`
})
export class DemoComponent {
}
}
6 changes: 2 additions & 4 deletions demo/components/file-upload-section.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ let tabDesc:Array<any> = [
}
];

// <{{desc.heading.toLowerCase()}}-demo *ngIf="currentHeading === '{{desc.heading}}'"></{{desc.heading.toLowerCase()}}-demo>

@Component({
selector: 'file-upload-section',
template: `
Expand Down Expand Up @@ -55,7 +53,7 @@ let tabDesc:Array<any> = [
<div class="card card-block panel panel-default panel-body" [innerHTML]="doc"></div>
</div>
</section>
`,
`
})
export class FileUploadSectionComponent {
public name:string = 'File Upload';
Expand All @@ -68,4 +66,4 @@ export class FileUploadSectionComponent {
this.currentHeading = e.heading;
}
}
}
}
4 changes: 2 additions & 2 deletions demo/ng2-file-upload-demo.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';

import { Ng2BootstrapModule } from 'ng2-bootstrap/ng2-bootstrap'
import { Ng2BootstrapModule } from 'ng2-bootstrap/ng2-bootstrap';
import { FileUploadModule } from '../components/file-upload/file-upload.module';
import { DemoComponent } from './app.component.ts';
import { FileUploadSectionComponent } from './components/file-upload-section';
Expand All @@ -15,4 +15,4 @@ import { SimpleDemoComponent } from './components/file-upload/simple-demo';
bootstrap: [DemoComponent]
})
export class NgFileUploadDemo {
}
}

0 comments on commit 48128be

Please sign in to comment.