Skip to content

Commit

Permalink
Fix unit tests for post-capture-card component.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanwu1105 committed Nov 4, 2020
1 parent 14da694 commit 4cc1976
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatIconModule } from '@angular/material/icon';
import { MatListModule } from '@angular/material/list';
import { IonicModule } from '@ionic/angular';
import { Proof } from 'src/app/services/data/proof/proof';
import { getTranslocoModule } from 'src/app/transloco/transloco-root.module.spec';
import { PostCaptureCardComponent } from './post-capture-card.component';

describe('PostCaptureCardComponent', () => {
let component: PostCaptureCardComponent;
let fixture: ComponentFixture<PostCaptureCardComponent>;
const expectedProof: Proof = { hash: '1234567890abcdef', timestamp: 1604473851208, mimeType: 'image/jpeg' };
const expectedImageSrc = 'https://picsum.photos/200/300';

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [PostCaptureCardComponent],
imports: [
IonicModule.forRoot(),
HttpClientTestingModule,
MatCardModule,
MatButtonModule,
MatIconModule,
Expand All @@ -26,6 +31,8 @@ describe('PostCaptureCardComponent', () => {

fixture = TestBed.createComponent(PostCaptureCardComponent);
component = fixture.componentInstance;
component.proof = expectedProof;
component.imageSrc = expectedImageSrc;
fixture.detectChanges();
}));

Expand Down

0 comments on commit 4cc1976

Please sign in to comment.