mirror of
https://github.com/Dansen999/at-certification-stock.git
synced 2026-01-11 05:24:27 +00:00
Fixed tests.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SentimentCardComponent } from './sentiment-card.component';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
|
||||
describe('SentimentCardComponent', () => {
|
||||
let component: SentimentCardComponent;
|
||||
@@ -8,7 +9,11 @@ describe('SentimentCardComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SentimentCardComponent ]
|
||||
declarations: [ SentimentCardComponent ],
|
||||
imports: [
|
||||
HttpClientTestingModule
|
||||
]
|
||||
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SentimentComponent } from './sentiment.component';
|
||||
import {MonthPipe} from "../../pipes/month.pipe";
|
||||
import {TendencyComponent} from "../tendency/tendency.component";
|
||||
import {ActivatedRoute, RouterModule} from "@angular/router";
|
||||
|
||||
describe('SentinmentComponent', () => {
|
||||
let component: SentimentComponent;
|
||||
@@ -8,7 +11,8 @@ describe('SentinmentComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SentimentComponent ]
|
||||
declarations: [ SentimentComponent, MonthPipe, TendencyComponent ],
|
||||
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { StockCardComponent } from './stock-card.component';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
|
||||
describe('StockCardComponent', () => {
|
||||
let component: StockCardComponent;
|
||||
@@ -8,7 +9,11 @@ describe('StockCardComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ StockCardComponent ]
|
||||
declarations: [ StockCardComponent ],
|
||||
imports: [
|
||||
HttpClientTestingModule
|
||||
]
|
||||
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LandingPageComponent } from './landing-page.component';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
import {MatSnackBarModule} from "@angular/material/snack-bar";
|
||||
|
||||
describe('LandingPageComponent', () => {
|
||||
let component: LandingPageComponent;
|
||||
@@ -8,7 +10,10 @@ describe('LandingPageComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ LandingPageComponent ]
|
||||
declarations: [ LandingPageComponent ],
|
||||
imports: [
|
||||
HttpClientTestingModule, MatSnackBarModule
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,14 +1,20 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { SentimentPageComponent } from './sentiment-page.component';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
import {AppRoutingModule} from "../../app-routing.module";
|
||||
|
||||
describe('SentimentComponent', () => {
|
||||
describe('SentimentPageComponent', () => {
|
||||
let component: SentimentPageComponent;
|
||||
let fixture: ComponentFixture<SentimentPageComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SentimentPageComponent ]
|
||||
declarations: [ SentimentPageComponent ],
|
||||
imports: [
|
||||
HttpClientTestingModule,
|
||||
AppRoutingModule
|
||||
]
|
||||
})
|
||||
.compileComponents();
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
import {Pipe, PipeTransform} from '@angular/core';
|
||||
import {formatDate} from "@angular/common";
|
||||
|
||||
@Pipe({
|
||||
@@ -6,11 +6,14 @@ import {formatDate} from "@angular/common";
|
||||
})
|
||||
export class MonthPipe implements PipeTransform {
|
||||
|
||||
transform(value: number): unknown {
|
||||
transform(value: number | string): string {
|
||||
|
||||
let date = new Date();
|
||||
if (typeof value === 'number') {
|
||||
date.setMonth(value);
|
||||
return formatDate(date, 'MMMM','en-US');
|
||||
return formatDate(date, 'MMMM', 'en-US');
|
||||
}
|
||||
return 'NaN'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
import {TestBed} from '@angular/core/testing';
|
||||
|
||||
import { FinnhubService } from './finnhub.service';
|
||||
import {FinnhubService} from './finnhub.service';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
|
||||
describe('FinnhubService', () => {
|
||||
let service: FinnhubService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(FinnhubService);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { StorageService } from './storage.service';
|
||||
import {HttpClientTestingModule} from "@angular/common/http/testing";
|
||||
|
||||
describe('StorageService', () => {
|
||||
let service: StorageService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
HttpClientTestingModule
|
||||
]
|
||||
});
|
||||
service = TestBed.inject(StorageService);
|
||||
});
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>AtCertificationStock</title>
|
||||
<title>At Certification Stock</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
||||
Reference in New Issue
Block a user