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