2020-11-25 08:51:15 +01:00
|
|
|
import { TestBed } from '@angular/core/testing';
|
|
|
|
|
2021-02-17 13:49:04 +01:00
|
|
|
import { TokenService } from '@app/_services/token.service';
|
2020-11-25 08:51:15 +01:00
|
|
|
|
|
|
|
describe('TokenService', () => {
|
|
|
|
let service: TokenService;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
TestBed.configureTestingModule({});
|
|
|
|
service = TestBed.inject(TokenService);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should be created', () => {
|
|
|
|
expect(service).toBeTruthy();
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return token for available token', () => {
|
2021-02-17 13:49:04 +01:00
|
|
|
expect(service.getTokenBySymbol('RSV')).toEqual({ name: 'Reserve', symbol: 'RSV' });
|
2020-11-25 08:51:15 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
it('should not return token for unavailable token', () => {
|
2021-02-17 13:49:04 +01:00
|
|
|
expect(service.getTokenBySymbol('ABC')).toBeUndefined();
|
2020-11-25 08:51:15 +01:00
|
|
|
});
|
|
|
|
});
|