Skip to content

Commit

Permalink
remove test execution
Browse files Browse the repository at this point in the history
Signed-off-by: Mirko Mollik <[email protected]>
  • Loading branch information
Mirko Mollik committed May 12, 2024
1 parent 09b52eb commit d48f8c4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
7 changes: 0 additions & 7 deletions apps/holder-browser-extension/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@
},
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/holder-browser-extension/jest.config.ts"
}
}
}
}
7 changes: 0 additions & 7 deletions apps/issuer-frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@
"lint": {
"executor": "@nx/eslint:lint"
},
"test": {
"executor": "@nx/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "apps/issuer-frontend/jest.config.ts"
}
},
"container": {
"executor": "@nx-tools/nx-container:build",
"dependsOn": ["build"],
Expand Down
48 changes: 42 additions & 6 deletions apps/issuer-frontend/src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
import { TestBed } from '@angular/core/testing';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AppComponent } from './app.component';
import { RouterTestingModule } from '@angular/router/testing';
import { IssuerService } from './issuer.service';
import { MatSnackBar } from '@angular/material/snack-bar';
import { of } from 'rxjs';

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

const mockIssuerService = {
getUrl: jest.fn().mockReturnValue(of('')),
uri: 'test-uri',
};

const mockSnackBar = {
open: jest.fn(),
};

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [AppComponent, RouterTestingModule],
declarations: [AppComponent],
providers: [
{ provide: IssuerService, useValue: mockIssuerService },
{ provide: MatSnackBar, useValue: mockSnackBar },
],
}).compileComponents();
});

it('should render title', () => {
const fixture = TestBed.createComponent(AppComponent);
fixture = TestBed.createComponent(AppComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});

it('should generate QR code', async () => {
await component.generate();
expect(mockIssuerService.getUrl).toHaveBeenCalled();
expect(component.qrCodeField.value).toBe('test-uri');
});

it('should copy value to clipboard', () => {
component.copyValue();
expect(mockSnackBar.open).toHaveBeenCalledWith(
'URL copied to clipboard',
'Close',
{ duration: 3000 }
);
});
});
16 changes: 0 additions & 16 deletions apps/issuer-frontend/src/app/issuer.service.spec.ts

This file was deleted.

0 comments on commit d48f8c4

Please sign in to comment.