cic-staff-client/src/app/_services/transaction.service.spec.ts

33 lines
1.0 KiB
TypeScript
Raw Normal View History

import {fakeAsync, TestBed, tick} from '@angular/core/testing';
2020-11-04 13:35:20 +01:00
import { TransactionService } from './transaction.service';
import {HttpClient} from '@angular/common/http';
import {HttpClientTestingModule, HttpTestingController} from '@angular/common/http/testing';
2020-11-04 13:35:20 +01:00
describe('TransactionService', () => {
let httpClient: HttpClient;
let httpTestingController: HttpTestingController;
2020-11-04 13:35:20 +01:00
let service: TransactionService;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule]
});
httpClient = TestBed.inject(HttpClient);
httpTestingController = TestBed.inject(HttpTestingController);
2020-11-04 13:35:20 +01:00
service = TestBed.inject(TransactionService);
});
it('should be created', () => {
expect(service).toBeTruthy();
});
// it('#getUser() should fetch userInfo', fakeAsync(() => {
// expect(service.userInfo).toBeUndefined();
// service.getUser('0x9D7c284907acbd4a0cE2dDD0AA69147A921a573D').then(
// );
// tick();
// expect(service.userInfo).toBe('Hey');
// }));
2020-11-04 13:35:20 +01:00
});