Skip to content

Commit

Permalink
[DURACOM-208] Remove unused dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
atarix83 committed Nov 22, 2023
1 parent 9268ef9 commit a989beb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { ChangeDetectorRef, Component, NO_ERRORS_SCHEMA } from '@angular/core';
import { Component, NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, inject, TestBed, waitForAsync } from '@angular/core/testing';
import { CdkTreeModule } from '@angular/cdk/tree';
import { By } from '@angular/platform-browser';

import { of as observableOf } from 'rxjs';
import { StoreModule } from '@ngrx/store';
import { TranslateModule } from '@ngx-translate/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { provideMockStore } from '@ngrx/store/testing';

import { createTestComponent } from '../../testing/utils.test';
import { VocabularyTreeviewComponent } from './vocabulary-treeview.component';
Expand All @@ -16,10 +15,6 @@ import { TreeviewFlatNode, TreeviewNode } from './vocabulary-treeview-node.model
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';
import { VocabularyOptions } from '../../../core/submission/vocabularies/models/vocabulary-options.model';
import { PageInfo } from '../../../core/shared/page-info.model';
import { AuthTokenInfo } from '../../../core/auth/models/auth-token-info.model';
import { authReducer } from '../../../core/auth/auth.reducer';
import { storeModuleConfig } from '../../../app.reducer';
import { By } from '@angular/platform-browser';
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';

Expand All @@ -28,7 +23,6 @@ describe('VocabularyTreeviewComponent test suite', () => {
let comp: VocabularyTreeviewComponent;
let compAsAny: any;
let fixture: ComponentFixture<VocabularyTreeviewComponent>;
let initialState;
let de;

const item = new VocabularyEntryDetail();
Expand Down Expand Up @@ -59,25 +53,10 @@ describe('VocabularyTreeviewComponent test suite', () => {
clearSearchTopRequests: jasmine.createSpy('clearSearchTopRequests')
});

initialState = {
core: {
auth: {
authenticated: true,
loaded: true,
blocking: false,
loading: false,
authToken: new AuthTokenInfo('test_token'),
userId: 'testid',
authMethods: []
}
}
};

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
imports: [
CdkTreeModule,
StoreModule.forRoot({ auth: authReducer }, storeModuleConfig),
TranslateModule.forRoot()
],
declarations: [
Expand All @@ -88,8 +67,6 @@ describe('VocabularyTreeviewComponent test suite', () => {
{ provide: VocabularyTreeviewService, useValue: vocabularyTreeviewServiceStub },
{ provide: VocabularyService, useValue: vocabularyServiceStub },
{ provide: NgbActiveModal, useValue: modalStub },
provideMockStore({ initialState }),
ChangeDetectorRef,
VocabularyTreeviewComponent
],
schemas: [NO_ERRORS_SCHEMA]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { FlatTreeControl } from '@angular/cdk/tree';
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';

import { Observable, Subscription } from 'rxjs';
import { Store } from '@ngrx/store';
import { TranslateService } from '@ngx-translate/core';

import { VocabularyEntryDetail } from '../../../core/submission/vocabularies/models/vocabulary-entry-detail.model';
Expand All @@ -14,7 +13,6 @@ import { PageInfo } from '../../../core/shared/page-info.model';
import { VocabularyEntry } from '../../../core/submission/vocabularies/models/vocabulary-entry.model';
import { VocabularyTreeFlattener } from './vocabulary-tree-flattener';
import { VocabularyTreeFlatDataSource } from './vocabulary-tree-flat-data-source';
import { CoreState } from '../../../core/core-state.model';
import { VocabularyService } from '../../../core/submission/vocabularies/vocabulary.service';
import { FormFieldMetadataValueObject } from '../builder/models/form-field-metadata-value.model';

Expand Down Expand Up @@ -107,11 +105,6 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
*/
@Output() deselect: EventEmitter<VocabularyTreeItemType> = new EventEmitter<VocabularyTreeItemType>(null);

/**
* A boolean representing if user is authenticated
*/
private isAuthenticated: Observable<boolean>;

/**
* Array to track all subscriptions and unsubscribe them onDestroy
*/
Expand All @@ -122,13 +115,11 @@ export class VocabularyTreeviewComponent implements OnDestroy, OnInit, OnChanges
*
* @param {VocabularyTreeviewService} vocabularyTreeviewService
* @param {vocabularyService} vocabularyService
* @param {Store<CoreState>} store
* @param {TranslateService} translate
*/
constructor(
private vocabularyTreeviewService: VocabularyTreeviewService,
private vocabularyService: VocabularyService,
private store: Store<CoreState>,
private translate: TranslateService
) {
this.treeFlattener = new VocabularyTreeFlattener(this.transformer, this.getLevel,
Expand Down

0 comments on commit a989beb

Please sign in to comment.