Skip to content

Commit

Permalink
updated tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Katherine Brown authored and Katherine Brown committed Oct 28, 2024
1 parent 5c61d60 commit 19cbe88
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatDialogRef } from '@angular/material/dialog';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { HttpClientModule } from '@angular/common/http';
import { MatDialogModule } from '@angular/material/dialog';
import { ArcLayerDeleteDialogComponent } from './arc-layer-delete-dialog.component';
import { ArcService } from '../arc.service'

describe('Arc Layer Delete Dialog', () => {
let component: ArcLayerDeleteDialogComponent;
let fixture: ComponentFixture<ArcLayerDeleteDialogComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientModule, MatDialogModule],
declarations: [ArcLayerDeleteDialogComponent],
imports: [HttpClientTestingModule],
providers: [{
provide: MatDialogRef,
useValue: {}
},]
providers: [
{
provide: MatDialogRef,
useValue: {
close: jasmine.createSpy('close')
}
},
{
provide: MAT_DIALOG_DATA,
useValue: {}
},
ArcService
]
}).compileComponents();
}));
});

beforeEach(() => {
fixture = TestBed.createComponent(ArcLayerDeleteDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});


it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { MatDialogRef } from '@angular/material/dialog';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { HttpClientModule } from '@angular/common/http';
import { MatDialogModule } from '@angular/material/dialog';
import { ArcLayerDialogComponent } from './arc-layer-dialog.component';
import { ArcService } from '../arc.service';

describe('Arc Layer Dialog', () => {
let component: ArcLayerDialogComponent;
let fixture: ComponentFixture<ArcLayerDialogComponent>;

beforeEach(waitForAsync(() => {
TestBed.configureTestingModule({
beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [HttpClientModule, MatDialogModule],
declarations: [ArcLayerDialogComponent],
imports: [HttpClientTestingModule],
providers: [{
provide: MatDialogRef,
useValue: {}
},]
providers: [
{
provide: MatDialogRef,
useValue: {
close: jasmine.createSpy('close')
}
},
{
provide: MAT_DIALOG_DATA,
useValue: {}
},
ArcService
]
}).compileComponents();
}));
});

beforeEach(() => {
fixture = TestBed.createComponent(ArcLayerDialogComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});


it('should create', () => {
expect(component).toBeTruthy();
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="arc-layer">
<mat-card appearance="outlined">
<section class="arc-service">
<header>
<h2>Feature Layers</h2>
Expand Down Expand Up @@ -34,4 +35,5 @@ <h2>Feature Layers</h2>
</div>
</div>
</section>
</mat-card>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,8 @@ section {
height: inherit;
line-height: inherit;
width: inherit;
}
}

mat-card {
margin-bottom: 16px;
}
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
import { TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';

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

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

it('should create the app', () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app).toBeTruthy();
});

it(`should have as title 'showcase'`, () => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.componentInstance;
expect(app.title).toEqual('showcase');
beforeEach(() => {
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.nativeElement as HTMLElement;
expect(compiled.querySelector('.content span')?.textContent).toContain('showcase app is running!');
it('should create the app component', () => {
expect(component).toBeTruthy();
});
});

0 comments on commit 19cbe88

Please sign in to comment.