mirror of
https://github.com/WowUp/WowUp.git
synced 2026-05-19 12:04:50 -04:00
Fixed my-addons-addon-cell.component.spec.ts
This commit is contained in:
@@ -12,6 +12,7 @@ import { OverlayModule } from "@angular/cdk/overlay";
|
||||
import { MatSnackBarModule } from "@angular/material/snack-bar";
|
||||
import { BehaviorSubject, Subject } from "rxjs";
|
||||
import { UpdateCheckResult } from "electron-updater";
|
||||
import { MatTooltipModule } from "@angular/material/tooltip";
|
||||
|
||||
describe("FooterComponent", () => {
|
||||
let component: FooterComponent;
|
||||
@@ -39,6 +40,7 @@ describe("FooterComponent", () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [FooterComponent],
|
||||
imports: [
|
||||
MatTooltipModule,
|
||||
MatDialogModule,
|
||||
OverlayModule,
|
||||
MatSnackBarModule,
|
||||
|
||||
@@ -18,11 +18,6 @@ describe("InstallFromUrlDialogComponent", () => {
|
||||
let addonServiceSpy: any;
|
||||
|
||||
beforeEach(async () => {
|
||||
// addonServiceSpy = jasmine.createSpyObj("AddonService", [""], {
|
||||
// scanUpdate$: new BehaviorSubject<ScanUpdate>({ type: ScanUpdateType.Unknown }).asObservable(),
|
||||
// })
|
||||
|
||||
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [InstallFromUrlDialogComponent],
|
||||
imports: [
|
||||
|
||||
@@ -1,8 +1,51 @@
|
||||
import { ComponentFixture, TestBed } from "@angular/core/testing";
|
||||
import { TranslateCompiler, TranslateLoader, TranslateModule } from "@ngx-translate/core";
|
||||
import { HttpClient, HttpClientModule } from "@angular/common/http";
|
||||
import { httpLoaderFactory } from "../../app.module";
|
||||
import { TranslateMessageFormatCompiler } from "ngx-translate-messageformat-compiler";
|
||||
import { MatDialogModule, MatDialogRef } from "@angular/material/dialog";
|
||||
import { MyAddonsAddonCellComponent } from "./my-addons-addon-cell.component";
|
||||
import { MatTooltipModule } from "@angular/material/tooltip";
|
||||
import { AddonViewModel } from "../../business-objects/my-addon-list-item";
|
||||
import { Addon } from "../../entities/addon";
|
||||
|
||||
describe("MyAddonsAddonCellComponent", () => {
|
||||
let component: MyAddonsAddonCellComponent;
|
||||
let fixture: ComponentFixture<MyAddonsAddonCellComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [MyAddonsAddonCellComponent],
|
||||
imports: [
|
||||
MatTooltipModule,
|
||||
MatDialogModule,
|
||||
HttpClientModule,
|
||||
TranslateModule.forRoot({
|
||||
loader: {
|
||||
provide: TranslateLoader,
|
||||
useFactory: httpLoaderFactory,
|
||||
deps: [HttpClient],
|
||||
},
|
||||
compiler: {
|
||||
provide: TranslateCompiler,
|
||||
useClass: TranslateMessageFormatCompiler,
|
||||
},
|
||||
})
|
||||
],
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(MyAddonsAddonCellComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
component.listItem = new AddonViewModel({
|
||||
name: "Teelo's Test Tool",
|
||||
dependencies: [],
|
||||
} as Addon);
|
||||
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it("should create", () => {
|
||||
const instance = new MyAddonsAddonCellComponent();
|
||||
expect(instance).toBeTruthy();
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user