diff --git a/frontend/src/app/component/tweets/tweets.component.spec.ts b/frontend/src/app/component/tweets/tweets.component.spec.ts index 29dc7a5..51014eb 100644 --- a/frontend/src/app/component/tweets/tweets.component.spec.ts +++ b/frontend/src/app/component/tweets/tweets.component.spec.ts @@ -23,14 +23,12 @@ class MockNGXLogger { //Fake Feed Service export class MockFeedService { - getFeeds(): Observable { return new Observable(); } } export function mockFillTweets() { - for (let i = 0; i < 6; i++) { const tweet: Tweet = {tweet_id: i, created_date: null, text: "Mock", url: "Mock", icon: null} this.tweets.push(tweet); @@ -69,62 +67,44 @@ describe('Component: Tweets', () => { expect(component).toBeDefined(); }); - it('Show text if feeds are empty', () => { expect(fixture.debugElement.query(By.css('.feeds'))).toBeDefined(); }); 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: ""}; component.feeds.push(feed); - expect(fixture.debugElement.query(By.css('.feeds'))).toBeNull(); - }); - it('initial Tweets empty', () => { - expect(component.tweets.length).toEqual(0); - }); - it('Show text if tweets are empty', () => { expect(fixture.debugElement.query(By.css('.tweets'))).toBeDefined(); }) - it('Do not show text if tweets are filled', () => { - component.fillTweets(); expect(fixture.debugElement.query(By.css('.tweets'))).toBeNull(); - }); - it('load initial six Tweets works', () => { component.fillTweets(); expect(component.tweets.length).toEqual(6); }); it('load more Tweets works', () => { - component.fillTweets(); component.loadMore(); expect(component.tweets.length).toEqual(12); - }); it('load more Tweets twice works', () => { - - component.fillTweets() + component.fillTweets(); component.loadMore(); component.loadMore(); expect(component.tweets.length).toEqual(18); - }); - - });