Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
style: #228 Removing some warnings on console when running unit tests
  • Loading branch information
Juan Gabriel Guzman committed May 20, 2020
commit b061fc45722a741a359f1cdd73c12222235c4420
20 changes: 10 additions & 10 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ module.exports = function (config) {
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-spec-reporter')
require('karma-spec-reporter'),
require('karma-coverage-istanbul-reporter')

],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
Expand All @@ -27,14 +27,14 @@ module.exports = function (config) {
functions: 80
}
},
reporters: ['spec', 'kjhtml'],
reporters: ['spec'],
specReporter: {
maxLogLines: 5, // limit number of lines logged per test
suppressErrorSummary: true, // do not print error summary
suppressFailed: false, // do not print information about failed tests
suppressPassed: false, // do not print information about passed tests
suppressSkipped: true, // do not print information about skipped tests
showSpecTiming: false // print the time elapsed for each spec
maxLogLines: 5,
suppressErrorSummary: false,
suppressFailed: false,
suppressPassed: false,
suppressSkipped: true,
showSpecTiming: false
},

port: 9876,
Expand Down
2 changes: 2 additions & 0 deletions src/app/modules/shared/components/user/user.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { of } from 'rxjs';
import { UserComponent } from './user.component';
import { AzureAdB2CService } from '../../../login/services/azure.ad.b2c.service';
import {AppRoutingModule} from '../../../../app-routing.module';

describe('UserComponent', () => {
let component: UserComponent;
Expand All @@ -20,6 +21,7 @@ describe('UserComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [UserComponent],
imports: [AppRoutingModule],
providers: [{ providers: AzureAdB2CService, useValue: azureAdB2CServiceStub }],
}).compileComponents();
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { FormBuilder } from '@angular/forms';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { provideMockStore, MockStore } from '@ngrx/store/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import {FormBuilder} from '@angular/forms';
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
import {provideMockStore, MockStore} from '@ngrx/store/testing';
import {HttpClientTestingModule} from '@angular/common/http/testing';

import { ProjectListHoverComponent } from './project-list-hover.component';
import { ProjectState } from '../../../customer-management/components/projects/components/store/project.reducer';
import { getCustomerProjects } from '../../../customer-management/components/projects/components/store/project.selectors';
import { FilterProjectPipe } from '../../../shared/pipes';
import { CreateEntry, UpdateActiveEntry } from '../../store/entry.actions';
import {ProjectListHoverComponent} from './project-list-hover.component';
import {ProjectState} from '../../../customer-management/components/projects/components/store/project.reducer';
import {getCustomerProjects} from '../../../customer-management/components/projects/components/store/project.selectors';
import {FilterProjectPipe} from '../../../shared/pipes';
import {CreateEntry, UpdateActiveEntry} from '../../store/entry.actions';
import {AutocompleteLibModule} from 'angular-ng-autocomplete';

describe('ProjectListHoverComponent', () => {
let component: ProjectListHoverComponent;
Expand All @@ -18,7 +19,7 @@ describe('ProjectListHoverComponent', () => {
const state = {
projects: {
projects: [],
customerProjects: [{ id: 'id', name: 'name', description: 'description', project_type_id: '123' }],
customerProjects: [{id: 'id', name: 'name', description: 'description', project_type_id: '123'}],
isLoading: false,
message: '',
projectToEdit: undefined,
Expand All @@ -38,8 +39,8 @@ describe('ProjectListHoverComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ProjectListHoverComponent, FilterProjectPipe],
providers: [FormBuilder, provideMockStore({ initialState: state })],
imports: [HttpClientTestingModule],
providers: [FormBuilder, provideMockStore({initialState: state})],
imports: [HttpClientTestingModule, AutocompleteLibModule],
}).compileComponents();
store = TestBed.inject(MockStore);
mockProjectsSelector = store.overrideSelector(getCustomerProjects, state.projects);
Expand All @@ -65,7 +66,7 @@ describe('ProjectListHoverComponent', () => {
});

it('dispatchs a UpdateEntry action when activeEntry is not null', () => {
const entry = { id: '123', project_id: 'p1', start_date: new Date().toISOString() };
const entry = {id: '123', project_id: 'p1', start_date: new Date().toISOString()};
component.activeEntry = entry;
spyOn(store, 'dispatch');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import { getProjects } from '../../customer-management/components/projects/compo
import { EntryState } from '../../time-clock/store/entry.reducer';
import { allEntries } from '../../time-clock/store/entry.selectors';
import * as entryActions from '../../time-clock/store/entry.actions';
import {TechnologiesComponent} from '../../shared/components/technologies/technologies.component';
import {TimeEntriesSummaryComponent} from '../../time-clock/components/time-entries-summary/time-entries-summary.component';

describe('TimeEntriesComponent', () => {
type Merged = TechnologyState & ProjectState & EntryState;
Expand Down Expand Up @@ -67,6 +69,8 @@ describe('TimeEntriesComponent', () => {
GroupByDatePipe,
MonthPickerComponent,
TimeEntriesComponent,
TechnologiesComponent,
TimeEntriesSummaryComponent
],
providers: [provideMockStore({ initialState: state })],
imports: [FormsModule, ReactiveFormsModule],
Expand Down