Skip to content

Commit

Permalink
fix: fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriocomo committed Dec 10, 2024
1 parent 0dd3395 commit cb15be3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { HostAttributeToken } from '@angular/core';
import { TranslateService, TranslateStore } from '@ngx-translate/core';
import { tb_base } from 'projects/design-angular-kit/src/test';
import { TransferStore } from '../store/transfer.store';
import { ItTransferListComponent } from './transfer-list.component';
Expand All @@ -14,12 +13,10 @@ describe('ItTransferListComponent', <T>() => {
const { imports, providers } = tb_base;

await TestBed.configureTestingModule({
imports: [...imports, ItTransferListComponent],
imports,
providers: [
...providers,
TransferStore,
TranslateStore,
TranslateService,
{ provide: new HostAttributeToken('title'), useValue: 'title' },
{ provide: new HostAttributeToken('sourceType'), useValue: 'source' },
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { TranslateFakeLoader, TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { tb_base } from 'projects/design-angular-kit/src/test';
import { TransferStore } from './store/transfer.store';
import { ItTransferComponent } from './transfer.component';
Expand All @@ -13,18 +12,8 @@ describe('ItTransferComponent', () => {
const { imports, providers } = tb_base;

await TestBed.configureTestingModule({
imports: [
...imports,
ItTransferComponent,
//https://stackoverflow.com/a/52461467/2642723
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useClass: TranslateFakeLoader,
},
}),
],
providers: [...providers, TransferStore, TranslateService],
imports,
providers: [...providers, TransferStore],
}).compileComponents();

fixture = TestBed.createComponent(ItTransferComponent);
Expand Down

0 comments on commit cb15be3

Please sign in to comment.