Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
henrik-falk committed Jan 13, 2025
1 parent c5345e7 commit 7d2db3d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { ContainerDetailsInfoComponent } from './container-details-info.component';
import {provideHttpClient} from '@angular/common/http';
import {provideHttpClientTesting} from '@angular/common/http/testing';
import {signal} from '@angular/core';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ContainerDetailsInfoComponent]
imports: [ContainerDetailsInfoComponent],
providers: [provideHttpClient(), provideHttpClientTesting()]
})
.compileComponents();

fixture = TestBed.createComponent(ContainerDetailsInfoComponent);
component = fixture.componentInstance;
component.infoData = signal([]);
fixture.detectChanges();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 1,24 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import {signal} from '@angular/core';
import { ContainerDetailsTokenTableComponent } from './container-details-token-table.component';
import {provideHttpClient} from '@angular/common/http';
import {provideHttpClientTesting} from '@angular/common/http/testing';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [ContainerDetailsTokenTableComponent]
imports: [ContainerDetailsTokenTableComponent, BrowserAnimationsModule],
providers: [provideHttpClient(), provideHttpClientTesting()]
})
.compileComponents();

fixture = TestBed.createComponent(ContainerDetailsTokenTableComponent);
component = fixture.componentInstance;
component.dataSource = signal([]);
fixture.detectChanges();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import {ComponentFixture, TestBed} from '@angular/core/testing';

import { LostTokenComponent } from './lost-token.component';
import {LostTokenComponent} from './lost-token.component';
import {provideHttpClient} from '@angular/common/http';
import {provideHttpClientTesting} from '@angular/common/http/testing';
import {MAT_DIALOG_DATA} from '@angular/material/dialog';

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

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [LostTokenComponent]
imports: [LostTokenComponent],
providers: [provideHttpClient(), provideHttpClientTesting(),
{provide: MAT_DIALOG_DATA, useValue: {
serial: () => 'mockSerialValue'
}}]
})
.compileComponents();
.compileComponents();

fixture = TestBed.createComponent(LostTokenComponent);
component = fixture.componentInstance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 19,7 @@ import {TokenService} from '../../../../../services/token/token.service';
MatIcon
],
templateUrl: './lost-token.component.html',
styleUrl: './lost-token.component.css'
styleUrl: './lost-token.component.scss'
})
export class LostTokenComponent {
constructor(protected tokenService: TokenService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 15,9 @@ describe('EditButtonsComponent', () => {

fixture = TestBed.createComponent(EditButtonsComponent);
component = fixture.componentInstance;
component.element = {keyMap: {key: 'value', label: 'label'}};
component.element = {keyMap: {key: 'value', label: 'label'}, isEditing: signal(false)};
component.isEditingUser = signal(false);
component.isEditingInfo = signal(false);
component.shouldHideEdit = signal(false);
fixture.detectChanges();
});
Expand Down

0 comments on commit 7d2db3d

Please sign in to comment.