mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-16 12:10:40 +00:00
Add imports and providers to enable basic testing
This commit is contained in:
parent
3ee9bc097f
commit
236816cb93
@ -19,17 +19,4 @@ describe('AppComponent', () => {
|
|||||||
const app = fixture.componentInstance;
|
const app = fixture.componentInstance;
|
||||||
expect(app).toBeTruthy();
|
expect(app).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it(`should have as title 'tech-ui'`, () => {
|
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
|
||||||
const app = fixture.componentInstance;
|
|
||||||
expect(app.title).toEqual('tech-ui');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should render title', () => {
|
|
||||||
const fixture = TestBed.createComponent(AppComponent);
|
|
||||||
fixture.detectChanges();
|
|
||||||
const compiled = fixture.nativeElement;
|
|
||||||
expect(compiled.querySelector('.content span').textContent).toContain('tech-ui app is running!');
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
@ -1,24 +1,25 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { ChartComponent } from './chart.component';
|
import { ChartComponent } from './chart.component';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
|
class MockService {
|
||||||
|
getAll() {
|
||||||
|
// unimplemented
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
describe('ChartComponent', () => {
|
describe('ChartComponent', () => {
|
||||||
let component: ChartComponent;
|
let component: ChartComponent;
|
||||||
let fixture: ComponentFixture<ChartComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ ChartComponent ]
|
imports: [HttpClientModule],
|
||||||
})
|
providers: [ChartComponent]
|
||||||
.compileComponents();
|
}).compileComponents();
|
||||||
|
component = TestBed.inject(ChartComponent);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
fixture = TestBed.createComponent(ChartComponent);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
});
|
});
|
||||||
|
@ -1,23 +1,19 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { DonutChartComponent } from './donut-chart.component';
|
import { DonutChartComponent } from './donut-chart.component';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('DonutChartComponent', () => {
|
describe('DonutChartComponent', () => {
|
||||||
let component: DonutChartComponent;
|
let component: DonutChartComponent;
|
||||||
let fixture: ComponentFixture<DonutChartComponent>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ DonutChartComponent ]
|
declarations: [DonutChartComponent],
|
||||||
})
|
providers: [DonutChartComponent]
|
||||||
.compileComponents();
|
}).compileComponents();
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
component = TestBed.inject(DonutChartComponent);
|
||||||
fixture = TestBed.createComponent(DonutChartComponent);
|
}));
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<span>Tech UI</span>
|
<span>Tech UI</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<mat-progress-bar mode="determinate" value="20"></mat-progress-bar>
|
<mat-progress-bar mode="determinate" value="95.67"></mat-progress-bar>
|
||||||
<div fxLayout="column" fxLayoutGap="16px" class="grid-container" [@loading]="isLoading ? 'start' : 'done'">
|
<div fxLayout="column" fxLayoutGap="16px" class="grid-container" [@loading]="isLoading ? 'start' : 'done'">
|
||||||
<div fxLayout="row" fxLayoutGap="16px" fxLayoutAlign="space-between stretch">
|
<div fxLayout="row" fxLayoutGap="16px" fxLayoutAlign="space-between stretch">
|
||||||
<app-chart [type]=folderChart fxFlex="50"></app-chart>
|
<app-chart [type]=folderChart fxFlex="50"></app-chart>
|
||||||
|
@ -1,13 +1,8 @@
|
|||||||
import { LayoutModule } from '@angular/cdk/layout';
|
|
||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
|
||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
import { MatButtonModule } from '@angular/material/button';
|
|
||||||
import { MatCardModule } from '@angular/material/card';
|
|
||||||
import { MatGridListModule } from '@angular/material/grid-list';
|
|
||||||
import { MatIconModule } from '@angular/material/icon';
|
|
||||||
import { MatMenuModule } from '@angular/material/menu';
|
|
||||||
|
|
||||||
import { DashboardComponent } from './dashboard.component';
|
import { DashboardComponent } from './dashboard.component';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { NoopAnimationsModule, BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
||||||
|
|
||||||
describe('DashboardComponent', () => {
|
describe('DashboardComponent', () => {
|
||||||
let component: DashboardComponent;
|
let component: DashboardComponent;
|
||||||
@ -17,15 +12,14 @@ describe('DashboardComponent', () => {
|
|||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [DashboardComponent],
|
declarations: [DashboardComponent],
|
||||||
imports: [
|
imports: [
|
||||||
|
HttpClientModule,
|
||||||
NoopAnimationsModule,
|
NoopAnimationsModule,
|
||||||
LayoutModule,
|
BrowserAnimationsModule,
|
||||||
MatButtonModule,
|
],
|
||||||
MatCardModule,
|
providers: [DashboardComponent]
|
||||||
MatGridListModule,
|
|
||||||
MatIconModule,
|
|
||||||
MatMenuModule,
|
|
||||||
]
|
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
|
|
||||||
|
component = TestBed.inject(DashboardComponent);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
@ -5,6 +5,8 @@ import { MatSortModule } from '@angular/material/sort';
|
|||||||
import { MatTableModule } from '@angular/material/table';
|
import { MatTableModule } from '@angular/material/table';
|
||||||
|
|
||||||
import { DeviceListComponent } from './device-list.component';
|
import { DeviceListComponent } from './device-list.component';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
describe('DeviceListComponent', () => {
|
describe('DeviceListComponent', () => {
|
||||||
let component: DeviceListComponent;
|
let component: DeviceListComponent;
|
||||||
@ -13,20 +15,12 @@ describe('DeviceListComponent', () => {
|
|||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [DeviceListComponent],
|
declarations: [DeviceListComponent],
|
||||||
imports: [
|
imports: [HttpClientModule],
|
||||||
NoopAnimationsModule,
|
providers: [DeviceListComponent, ChangeDetectorRef]
|
||||||
MatPaginatorModule,
|
|
||||||
MatSortModule,
|
|
||||||
MatTableModule,
|
|
||||||
]
|
|
||||||
}).compileComponents();
|
}).compileComponents();
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
component = TestBed.inject(DeviceListComponent);
|
||||||
fixture = TestBed.createComponent(DeviceListComponent);
|
}));
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should compile', () => {
|
it('should compile', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { FolderListComponent } from './folder-list.component';
|
import { FolderListComponent } from './folder-list.component';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
import { ChangeDetectorRef } from '@angular/core';
|
||||||
|
|
||||||
describe('FolderListComponent', () => {
|
describe('FolderListComponent', () => {
|
||||||
let component: FolderListComponent;
|
let component: FolderListComponent;
|
||||||
@ -8,16 +10,14 @@ describe('FolderListComponent', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
TestBed.configureTestingModule({
|
TestBed.configureTestingModule({
|
||||||
declarations: [ FolderListComponent ]
|
declarations: [FolderListComponent],
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [FolderListComponent, ChangeDetectorRef]
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
}));
|
|
||||||
|
|
||||||
beforeEach(() => {
|
component = TestBed.inject(FolderListComponent);
|
||||||
fixture = TestBed.createComponent(FolderListComponent);
|
}));
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should create', () => {
|
it('should create', () => {
|
||||||
expect(component).toBeTruthy();
|
expect(component).toBeTruthy();
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { DbCompletionService } from './db-completion.service';
|
import { DbCompletionService } from './db-completion.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('DbCompletionService', () => {
|
describe('DbCompletionService', () => {
|
||||||
let service: DbCompletionService;
|
let service: DbCompletionService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [DbCompletionService]
|
||||||
|
});
|
||||||
service = TestBed.inject(DbCompletionService);
|
service = TestBed.inject(DbCompletionService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { DbStatusService } from './db-status.service';
|
import { DbStatusService } from './db-status.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('DbStatusService', () => {
|
describe('DbStatusService', () => {
|
||||||
let service: DbStatusService;
|
let service: DbStatusService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [DbStatusService]
|
||||||
|
});
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({});
|
||||||
service = TestBed.inject(DbStatusService);
|
service = TestBed.inject(DbStatusService);
|
||||||
});
|
});
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { DeviceService } from './device.service';
|
import { DeviceService } from './device.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('DeviceService', () => {
|
describe('DeviceService', () => {
|
||||||
let service: DeviceService;
|
let service: DeviceService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [DeviceService]
|
||||||
|
});
|
||||||
service = TestBed.inject(DeviceService);
|
service = TestBed.inject(DeviceService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { FolderService } from './folder.service';
|
import { FolderService } from './folder.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('FolderService', () => {
|
describe('FolderService', () => {
|
||||||
let service: FolderService;
|
let service: FolderService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [FolderService]
|
||||||
|
});
|
||||||
service = TestBed.inject(FolderService);
|
service = TestBed.inject(FolderService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { SystemConfigService } from './system-config.service';
|
import { SystemConfigService } from './system-config.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('SystemConfigService', () => {
|
describe('SystemConfigService', () => {
|
||||||
let service: SystemConfigService;
|
let service: SystemConfigService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [SystemConfigService]
|
||||||
|
});
|
||||||
service = TestBed.inject(SystemConfigService);
|
service = TestBed.inject(SystemConfigService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { SystemConnectionsService } from './system-connections.service';
|
import { SystemConnectionsService } from './system-connections.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('SystemConnectionsService', () => {
|
describe('SystemConnectionsService', () => {
|
||||||
let service: SystemConnectionsService;
|
let service: SystemConnectionsService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [SystemConnectionsService]
|
||||||
|
});
|
||||||
service = TestBed.inject(SystemConnectionsService);
|
service = TestBed.inject(SystemConnectionsService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { TestBed } from '@angular/core/testing';
|
import { TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
import { SystemStatusService } from './system-status.service';
|
import { SystemStatusService } from './system-status.service';
|
||||||
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
|
|
||||||
describe('SystemStatusService', () => {
|
describe('SystemStatusService', () => {
|
||||||
let service: SystemStatusService;
|
let service: SystemStatusService;
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
TestBed.configureTestingModule({});
|
TestBed.configureTestingModule({
|
||||||
|
imports: [HttpClientModule],
|
||||||
|
providers: [SystemStatusService]
|
||||||
|
});
|
||||||
service = TestBed.inject(SystemStatusService);
|
service = TestBed.inject(SystemStatusService);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user