fix linter
This commit is contained in:
parent
75152c044f
commit
5e73523237
@ -5,11 +5,11 @@ import {MatSnackBar} from '@angular/material/snack-bar';
|
|||||||
import {NGXLogger} from 'ngx-logger';
|
import {NGXLogger} from 'ngx-logger';
|
||||||
import {MatDialog} from '@angular/material/dialog';
|
import {MatDialog} from '@angular/material/dialog';
|
||||||
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
import {HttpClientTestingModule} from '@angular/common/http/testing';
|
||||||
import {FeedService} from "../../services/feed.service";
|
import {FeedService} from '../../services/feed.service';
|
||||||
import {Observable} from "rxjs";
|
import {Observable} from 'rxjs';
|
||||||
import {IFeed} from "../../interfaces/feed.interface";
|
import {IFeed} from '../../interfaces/feed.interface';
|
||||||
import {Tweet} from "../../interfaces/interface";
|
import {Tweet} from '../../interfaces/interface';
|
||||||
import {By} from "@angular/platform-browser";
|
import {By} from '@angular/platform-browser';
|
||||||
|
|
||||||
|
|
||||||
class MockSnackBar {
|
class MockSnackBar {
|
||||||
@ -21,7 +21,7 @@ class MockMatDialog {
|
|||||||
class MockNGXLogger {
|
class MockNGXLogger {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fake Feed Service
|
// Fake Feed Service
|
||||||
export class MockFeedService {
|
export class MockFeedService {
|
||||||
getFeeds(): Observable<IFeed[]> {
|
getFeeds(): Observable<IFeed[]> {
|
||||||
return new Observable<IFeed[]>();
|
return new Observable<IFeed[]>();
|
||||||
@ -30,7 +30,7 @@ export class MockFeedService {
|
|||||||
|
|
||||||
export function mockFillTweets() {
|
export function mockFillTweets() {
|
||||||
for (let i = 0; i < 6; i++) {
|
for (let i = 0; i < 6; i++) {
|
||||||
const tweet: Tweet = {tweet_id: i, created_date: null, text: "Mock", url: "Mock", icon: null}
|
const tweet: Tweet = {tweet_id: i, created_date: null, text: 'Mock', url: 'Mock', icon: null};
|
||||||
this.tweets.push(tweet);
|
this.tweets.push(tweet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -41,7 +41,7 @@ describe('Component: Tweets', () => {
|
|||||||
|
|
||||||
beforeEach(async(() => {
|
beforeEach(async(() => {
|
||||||
|
|
||||||
//Cancelling initial load and mock http calls
|
// Cancelling initial load and mock http calls
|
||||||
TweetsComponent.prototype.ngOnInit = () => {
|
TweetsComponent.prototype.ngOnInit = () => {
|
||||||
};
|
};
|
||||||
TweetsComponent.prototype.fillTweets = mockFillTweets;
|
TweetsComponent.prototype.fillTweets = mockFillTweets;
|
||||||
@ -72,7 +72,7 @@ describe('Component: Tweets', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Do not show text if feeds are filled', () => {
|
it('Do not show text if feeds are filled', () => {
|
||||||
const feed: IFeed = {active: true, icon: null, id: 1, keywords: null, match_all_keywords: "false", url: ""};
|
const feed: IFeed = {active: true, icon: null, id: 1, keywords: null, match_all_keywords: 'false', url: ''};
|
||||||
component.feeds.push(feed);
|
component.feeds.push(feed);
|
||||||
expect(fixture.debugElement.query(By.css('.feeds'))).toBeNull();
|
expect(fixture.debugElement.query(By.css('.feeds'))).toBeNull();
|
||||||
});
|
});
|
||||||
@ -83,7 +83,7 @@ describe('Component: Tweets', () => {
|
|||||||
|
|
||||||
it('Show text if tweets are empty', () => {
|
it('Show text if tweets are empty', () => {
|
||||||
expect(fixture.debugElement.query(By.css('.tweets'))).toBeDefined();
|
expect(fixture.debugElement.query(By.css('.tweets'))).toBeDefined();
|
||||||
})
|
});
|
||||||
|
|
||||||
it('Do not show text if tweets are filled', () => {
|
it('Do not show text if tweets are filled', () => {
|
||||||
component.fillTweets();
|
component.fillTweets();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user