adding typescript interfaces for type hinting and testing
some code reformatting adding tests for services and components. cleanup of unused dependencies in components. refactor dashboard service so that wrapper is removed before data is passed to component. (no more this.data.data...). refactored components so that variable names are consistent (dashboardService vs smartService). ensure argument and return types are specified everywhere. adding tests for pipes. adding ng test to ci steps. change dir before running npm install. trying to install nodejs in continer. test frontend separately. upload coverage for frontend and backend. upload coverage for frontend and backend. testing coverage file locations. retry file upload.
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
import { DeviceTitlePipe } from './device-title.pipe';
|
||||
import {FileSizePipe} from "./file-size.pipe";
|
||||
import {DeviceModel} from "../core/models/device-model";
|
||||
import {DeviceTitlePipe} from './device-title.pipe';
|
||||
import {DeviceModel} from 'app/core/models/device-model';
|
||||
|
||||
describe('DeviceTitlePipe', () => {
|
||||
it('create an instance', () => {
|
||||
const pipe = new DeviceTitlePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
it('create an instance', () => {
|
||||
const pipe = new DeviceTitlePipe();
|
||||
expect(pipe).toBeTruthy();
|
||||
});
|
||||
|
||||
describe('#deviceTitleForType',() => {
|
||||
describe('#deviceTitleForType', () => {
|
||||
const testCases = [
|
||||
{
|
||||
'device': {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
import {DeviceModel} from 'app/core/models/device-model';
|
||||
|
||||
@Pipe({
|
||||
@@ -36,7 +36,7 @@ export class DeviceTitlePipe implements PipeTransform {
|
||||
return titleParts.join(' - ')
|
||||
}
|
||||
|
||||
static deviceTitleWithFallback(device, titleType: string): string {
|
||||
static deviceTitleWithFallback(device: DeviceModel, titleType: string): string {
|
||||
console.log(`Displaying Device ${device.wwn} with: ${titleType}`)
|
||||
const titleParts = []
|
||||
if (device.host_id) titleParts.push(device.host_id)
|
||||
@@ -48,7 +48,7 @@ export class DeviceTitlePipe implements PipeTransform {
|
||||
}
|
||||
|
||||
|
||||
transform(device: any, titleType: string = 'name'): string {
|
||||
transform(device: DeviceModel, titleType: string = 'name'): string {
|
||||
return DeviceTitlePipe.deviceTitleWithFallback(device, titleType)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user