Skip to content

Commit

Permalink
fixed tests for angular 17
Browse files Browse the repository at this point in the history
  • Loading branch information
00Kadie00 committed Jul 7, 2024
1 parent 74d2007 commit 73e03db
Show file tree
Hide file tree
Showing 37 changed files with 350 additions and 433 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { MatListModule } from '@angular/material/list';

import { BuildISOComponent } from './build-iso.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('BuildISOComponent', () => {
let component: BuildISOComponent;
let fixture: ComponentFixture<BuildISOComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatListModule
],
declarations: [
BuildISOComponent,
RouterOutletStubComponent
]
})
.compileComponents();
imports: [MatListModule, BuildISOComponent, RouterOutletStubComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { MatListModule } from '@angular/material/list';
import { CheckSysComponent } from './check-sys.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('CheckSysComponent', () => {
let component: CheckSysComponent;
let fixture: ComponentFixture<CheckSysComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatListModule
],
declarations: [
CheckSysComponent,
RouterOutletStubComponent
]
})
.compileComponents();
imports: [MatListModule, CheckSysComponent, RouterOutletStubComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { MatListModule } from '@angular/material/list';

import { ImportDVDComponent } from './import-dvd.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('ImportDVDComponent', () => {
let component: ImportDVDComponent;
let fixture: ComponentFixture<ImportDVDComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatListModule
],
declarations: [
ImportDVDComponent,
RouterOutletStubComponent
]
})
.compileComponents();
imports: [MatListModule, ImportDVDComponent, RouterOutletStubComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { MatListModule } from '@angular/material/list';

import { RepoSyncComponent } from './repo-sync.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('RepoSyncComponent', () => {
let component: RepoSyncComponent;
let fixture: ComponentFixture<RepoSyncComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatListModule
],
declarations: [
RepoSyncComponent,
RouterOutletStubComponent
]
})
.compileComponents();
imports: [MatListModule, RepoSyncComponent, RouterOutletStubComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {Component} from '@angular/core';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { MatListModule } from '@angular/material/list';

import { SyncComponent } from './sync.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('SyncComponent', () => {
let component: SyncComponent;
let fixture: ComponentFixture<SyncComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatListModule
],
declarations: [
SyncComponent,
RouterOutletStubComponent
]
})
.compileComponents();
imports: [MatListModule, SyncComponent, RouterOutletStubComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,21 @@
import {Component} from '@angular/core';
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatListModule} from '@angular/material/list';
import { Component } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatListModule } from '@angular/material/list';

import {AppEventsComponent} from './app-events.component';
import { AppEventsComponent } from './app-events.component';

// eslint-disable-next-line @angular-eslint/component-selector
@Component({selector: 'router-outlet', template: ''})
class RouterOutletStubComponent {
}
@Component({ selector: 'router-outlet', template: '' })
class RouterOutletStubComponent {}

describe('AppEventsComponent', () => {
let component: AppEventsComponent;
let fixture: ComponentFixture<AppEventsComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [
AppEventsComponent,
RouterOutletStubComponent
],
imports: [
MatListModule
]
})
.compileComponents();
imports: [AppEventsComponent, RouterOutletStubComponent, MatListModule],
}).compileComponents();
});

beforeEach(() => {
Expand Down
10 changes: 3 additions & 7 deletions projects/cobbler-frontend/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {HttpClientTestingModule} from '@angular/common/http/testing';
import {Component} from '@angular/core';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { Component } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

@Component({selector: 'cobbler-manage-menu', template: ''})
Expand All @@ -12,10 +11,7 @@ describe('AppComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
RouterTestingModule,
HttpClientTestingModule
],
declarations: [
HttpClientTestingModule,
AppComponent,
AppManageMenuStubComponent
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatTreeModule} from '@angular/material/tree';
import { MatTreeModule } from '@angular/material/tree';

import { EditableTreeComponent } from './editable-tree.component';

Expand All @@ -9,12 +9,8 @@ describe('EditableTreeComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatTreeModule
],
declarations: [ EditableTreeComponent ]
})
.compileComponents();
imports: [MatTreeModule, EditableTreeComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
<mat-tree
[dataSource]="dataSource"
[treeControl]="viewableTreeControl"
*ngIf="inputLength(inputObject) > 0">
@if(inputLength(inputObject) > 0){
<mat-tree [dataSource]="dataSource" [treeControl]="viewableTreeControl">
<!-- This is the tree node template for leaf nodes -->
<mat-tree-node *matTreeNodeDef="let node" matTreeNodePadding>
<!-- use a disabled button to provide padding for tree leaf -->
<button mat-icon-button disabled></button>
{{node.name}}: {{node.value}}
{{ node.name }}: {{ node.value }}
</mat-tree-node>
<!-- This is the tree node template for expandable nodes -->
<mat-tree-node *matTreeNodeDef="let node;when: hasChild" matTreeNodePadding>
<button mat-icon-button matTreeNodeToggle
[attr.aria-label]="'Toggle ' + node.name">
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
<button
mat-icon-button
matTreeNodeToggle
[attr.aria-label]="'Toggle ' + node.name"
>
<mat-icon class="mat-icon-rtl-mirror">
{{viewableTreeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
{{
viewableTreeControl.isExpanded(node) ? "expand_more" : "chevron_right"
}}
</mat-icon>
</button>
{{node.name}}
{{ node.name }}
</mat-tree-node>
</mat-tree>
<span
*ngIf="inputLength(inputObject) === 0"
class="settings-values">
&#123;&nbsp;&#125;
</span>
} @if(inputLength(inputObject) === 0){
<span class="settings-values"> &#123;&nbsp;&#125; </span>
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {MatTreeModule} from '@angular/material/tree';
import { MatTreeModule } from '@angular/material/tree';

import { ViewableTreeComponent } from './viewable-tree.component';

Expand All @@ -9,12 +9,8 @@ describe('ViewableTreeComponent', () => {

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [
MatTreeModule
],
declarations: [ ViewableTreeComponent ]
})
.compileComponents();
imports: [MatTreeModule, ViewableTreeComponent],
}).compileComponents();
});

beforeEach(() => {
Expand Down
Loading

0 comments on commit 73e03db

Please sign in to comment.